Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e6f28f9
impl 'get_text_cursor'
AustinJ235 Apr 28, 2025
22f65a4
impl basic text editing
AustinJ235 Apr 28, 2025
a3fb043
sort of fix `byte_s` & `byte_e` when new lines occur
AustinJ235 Apr 28, 2025
750fa5e
fix empty lines
AustinJ235 Apr 28, 2025
c740762
make `get_cursor` more robust
AustinJ235 Apr 29, 2025
9e2f360
sort of fix selecting empty lines
AustinJ235 Apr 29, 2025
472683c
actually fix selecting empty lines
AustinJ235 May 1, 2025
0d1987e
add basic display cursor
AustinJ235 May 1, 2025
55427de
some minor fixes
AustinJ235 May 2, 2025
3b43c90
mockup some methods on TextBody
AustinJ235 May 2, 2025
4ac3041
Various
AustinJ235 May 3, 2025
ac20fd6
impl `cursor_delete`, `cursor_insert` & `push`
AustinJ235 May 3, 2025
4005af1
impl basic selection
AustinJ235 May 5, 2025
2ea7d70
impl `selection_value`
AustinJ235 May 5, 2025
76971b1
Fix end/start of line cursors from being displayed incorrectly.
AustinJ235 May 12, 2025
557ae86
Fix line_byte_mapping
AustinJ235 Jun 16, 2025
2d8d383
`TextCursor` Changes
AustinJ235 Jul 12, 2025
3a12995
Add `Bin::get_text_cursor_bounds`
AustinJ235 Jul 12, 2025
d2864be
Fix `Bin` content scrolling.
AustinJ235 Jul 14, 2025
3e4c1d3
impl `style_modify_then`
AustinJ235 Jul 15, 2025
800d4c6
Bin: use `read_recursive` instead of `read`.
AustinJ235 Jul 16, 2025
1e9918d
impl `selection_delete`
AustinJ235 Jul 16, 2025
90b5dde
add some docs
AustinJ235 Jul 16, 2025
fd59a73
disable ligatures as they break selection
AustinJ235 Jul 18, 2025
095b288
fix deadlock in `style_modify_then`
AustinJ235 Jul 19, 2025
d26e63c
fix content overflow calc from including scrolling
AustinJ235 Jul 19, 2025
208ceb2
impl `text_cursor_up` & `text_cursor_down`
AustinJ235 Jul 21, 2025
1a4cf0c
Refactor text layout to provide more accurate start/end of line cursors.
AustinJ235 Jul 26, 2025
e8d2955
impl `select_word` & `select_line`
AustinJ235 Jul 28, 2025
75c26c4
Refactor text selection/deletion
AustinJ235 Aug 3, 2025
a5a4047
fix selection_delete
AustinJ235 Aug 3, 2025
5a3458b
impl `cursor_insert_[string/spans]`
AustinJ235 Aug 3, 2025
ef2973b
fix `selection_string/span`
AustinJ235 Aug 3, 2025
2520a39
impl TextCursor/TextSelection helpers
AustinJ235 Aug 11, 2025
5977ba5
mockup TextBodyGuard
AustinJ235 Sep 17, 2025
a261ebb
more work on `TextBodyGuard`
AustinJ235 Sep 18, 2025
e1e99bb
more work on `TextBodyGuard`
AustinJ235 Sep 19, 2025
b8d80bd
more work on `TextBodyGuard`
AustinJ235 Sep 19, 2025
7acf41c
impl cursor_span_*
AustinJ235 Sep 19, 2025
5c5461d
more work on `TextBodyGuard`
AustinJ235 Sep 19, 2025
07d3b91
more work on `TextBodyGuard`
AustinJ235 Sep 20, 2025
0c34a14
more work on `TextBodyGuard`
AustinJ235 Sep 20, 2025
4a38cc2
fix deadlock in finish
AustinJ235 Sep 20, 2025
f0ae874
bug fixes
AustinJ235 Sep 20, 2025
f04e618
more `TextBodyGuard`
AustinJ235 Sep 21, 2025
c2ffdc3
cleanup a bit
AustinJ235 Sep 21, 2025
7a78c47
some fixes
AustinJ235 Sep 21, 2025
6e26b1b
fix deadlock
AustinJ235 Sep 21, 2025
aa0bddf
Move cursor & selection structs to text_body mod.
AustinJ235 Sep 21, 2025
14b13d1
remove old methods
AustinJ235 Sep 21, 2025
6bf53b3
impl shrink_selection
AustinJ235 Sep 21, 2025
8333d6c
impl selection_apply_attrs & span_apply_attrs
AustinJ235 Sep 21, 2025
4b3f2a8
initialize render's UpdateContext from window's shared UpdateContxt
AustinJ235 Sep 21, 2025
1d9d32d
fix update_layout
AustinJ235 Sep 22, 2025
08384cd
rework cursor_word_*
AustinJ235 Oct 2, 2025
33a48c3
rework word_ranges to work with multi-span words
AustinJ235 Oct 2, 2025
083f3fb
rework cursor_select_word
AustinJ235 Oct 3, 2025
ed2dbf9
add TextSelection::unordered & remove shrink/extend
AustinJ235 Oct 3, 2025
d4b2228
fix `is_selection_valid` & check if selection is valid for `selection…
AustinJ235 Oct 3, 2025
e52afb1
impl `TextBodyGuard::cursor_line_offset`
AustinJ235 Oct 12, 2025
2e4b7f3
rename `text_modify` mod to `text_guard`.
AustinJ235 Oct 12, 2025
8db8129
oops
AustinJ235 Oct 12, 2025
be49f10
fix `cursor_line_start` & `cursor_select_line` when `display_lines` i…
AustinJ235 Oct 17, 2025
0535677
make `get_cursor` more intuitive when selecting below or above body
AustinJ235 Oct 17, 2025
5868c3d
update children when a floating Bin is dropped
AustinJ235 Oct 19, 2025
31d6496
fix `on_hold` not removing hook when target is dropped
AustinJ235 Oct 19, 2025
0f34f47
Fix `cursor_line_column` & `line_column_cursor` when `as_displayed` i…
AustinJ235 Oct 19, 2025
86fa45a
Fix `cursor_line_start` & `cursor_line_end` when `as_displayed` is `f…
AustinJ235 Oct 20, 2025
22ddd8f
Fix alignment when `TextHoriAlign::Right` is used
AustinJ235 Oct 20, 2025
5f8046d
update changelog
AustinJ235 Oct 20, 2025
9717b3f
change lock order in `obtain_vertex_data` to avoid deadlocks
AustinJ235 Oct 20, 2025
f384226
fix horizonal scrolling
AustinJ235 Oct 20, 2025
91663eb
fix horizonal scrolling some more
AustinJ235 Oct 24, 2025
22741b5
add fallback case for `line_column_cursor`
AustinJ235 Oct 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

- **BREAKING**: `WindowManager::create` now returns an error enum instead of a string.
- Added `Window::on_bin_focus_change` method.
- Added `Window::attach_intvl_hook` method.
- Reduce usage of winit's event loop for event processing.
- winit event loop tends to get backed up fairly easily causing many basalt systems to behave poorly.
- Many `Bin` related events are now sent directly to the renderer improving latency.
Expand Down Expand Up @@ -63,10 +64,11 @@
- **BREAKING** Remove method `toggle_hidden` and `set_hidden`.
- Use `style_modify` instead.
- **BEHAVIOR**: Rewrote radius code to be more circular.
- Added method `style_modify`.
- Added method `style_modify` & `style_modify_then`.
- Added method `is_visible`.
- Added method `style_update_batch`.
- Added method `attach_intvl_hook`.
- Added method `text_body` which retrives a `TextBodyGuard` that can be used to modify the text body.
- Fixed `children_recursive` returning self.
- Fixed `children_recursive_with_self` returning self twice.
- Fixed text alignment being incorrect with scale.
Expand All @@ -76,6 +78,7 @@
- These callbacks are now called at the end of the update cycle instead of right away to ensure all other `Bin`'s post update state is up to date.
- Replaced usage of `ArcSwap` with `RwLock` to improve consistency.
- Improved `mouse_inside` performance to better handle high polling rate mice.
- `on_update_once` now takes `FnOnce` instead of `FnMut`.

## Changes to `BinPostUpdate`
- **BREAKING**: Added `inner_bounds` & `outer_bound` fields to `BinPostUpdate`.
Expand Down Expand Up @@ -188,6 +191,7 @@
- Added method `clear_bin_focus`.
- Added method `on_bin_focus_change` to `InputBuilder`.
- Changed how input is processed to better handle high polling rate devices.
- Fixed `on_hold` hooks not being removed after the associated `Bin` or `Window` drops.

# Version 0.21.0 (May 12, 2024)

Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ foldhash = "0.1"
vulkano = "0.35"
vulkano-shaders = "0.35"
vulkano-taskgraph = "0.35"
unicode-segmentation = "1"

[dependencies.cosmic-text]
version = "0.14"
Expand All @@ -52,3 +53,4 @@ default = ["image_decode", "image_download"]
style_validation_debug_on_drop = []
image_decode = ["dep:image"]
image_download = ["image_decode", "dep:curl", "dep:url"]
deadlock_detection = ["parking_lot/deadlock_detection"]
10 changes: 10 additions & 0 deletions src/input/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,16 @@ impl<'a> InputHoldBuilder<'a> {
}
});

match &self.parent.target {
InputHookTarget::Bin(bin) => {
bin.attach_intvl_hook(intvl_id);
},
InputHookTarget::Window(window) => {
window.attach_intvl_hook(intvl_id);
},
InputHookTarget::None => (),
}

self.parent.input.add_hook_with_id(
input_hook_id,
Hook {
Expand Down
2 changes: 1 addition & 1 deletion src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl Input {
/// .finish()
/// .unwrap();
/// ```
pub fn hook(&self) -> InputHookBuilder {
pub fn hook(&self) -> InputHookBuilder<'_> {
InputHookBuilder::start(self)
}

Expand Down
Loading