diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-10-29 12:46:58 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-10-29 21:52:03 -0700 |
| commit | 13fe9c8ac362c5e9c7796a409be591518ce4190f (patch) | |
| tree | 70cc2c5c66294ce1b0c6b96cedac86617d43b6a2 | |
| parent | 6ecbf2db8a31484fe88b8faa399b9832da6c8a6a (diff) | |
| download | niri-13fe9c8ac362c5e9c7796a409be591518ce4190f.tar.gz niri-13fe9c8ac362c5e9c7796a409be591518ce4190f.tar.bz2 niri-13fe9c8ac362c5e9c7796a409be591518ce4190f.zip | |
[cfg-breaking] Rename hide-on-key-press to hide-when-typing
I originally preferred on-key-press, but when-typing feels more natural
and matches sway. This setting had not been in a stable release yet so
this is not stable release cfg breaking.
| -rw-r--r-- | niri-config/src/lib.rs | 8 | ||||
| -rw-r--r-- | src/input/mod.rs | 2 | ||||
| -rw-r--r-- | wiki/Configuration:-Miscellaneous.md | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index 5b0dace8..d8613def 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -666,7 +666,7 @@ pub struct Cursor { #[knuffel(child, unwrap(argument), default = 24)] pub xcursor_size: u8, #[knuffel(child)] - pub hide_on_key_press: bool, + pub hide_when_typing: bool, #[knuffel(child, unwrap(argument))] pub hide_after_inactive_ms: Option<u32>, } @@ -676,7 +676,7 @@ impl Default for Cursor { Self { xcursor_theme: String::from("default"), xcursor_size: 24, - hide_on_key_press: false, + hide_when_typing: false, hide_after_inactive_ms: None, } } @@ -3061,7 +3061,7 @@ mod tests { cursor { xcursor-theme "breeze_cursors" xcursor-size 16 - hide-on-key-press + hide-when-typing hide-after-inactive-ms 3000 } @@ -3286,7 +3286,7 @@ mod tests { cursor: Cursor { xcursor_theme: String::from("breeze_cursors"), xcursor_size: 16, - hide_on_key_press: true, + hide_when_typing: true, hide_after_inactive_ms: Some(3000), }, screenshot_path: Some(String::from("~/Screenshots/screenshot.png")), diff --git a/src/input/mod.rs b/src/input/mod.rs index 07c77e8c..9722d9b7 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -423,7 +423,7 @@ impl State { } fn hide_cursor_if_needed(&mut self) { - if !self.niri.config.borrow().cursor.hide_on_key_press { + if !self.niri.config.borrow().cursor.hide_when_typing { return; } diff --git a/wiki/Configuration:-Miscellaneous.md b/wiki/Configuration:-Miscellaneous.md index 243f4677..89c7b583 100644 --- a/wiki/Configuration:-Miscellaneous.md +++ b/wiki/Configuration:-Miscellaneous.md @@ -21,7 +21,7 @@ cursor { xcursor-theme "breeze_cursors" xcursor-size 48 - hide-on-key-press + hide-when-typing hide-after-inactive-ms 1000 } @@ -109,7 +109,7 @@ cursor { } ``` -#### `hide-on-key-press` +#### `hide-when-typing` <sup>Since: 0.1.10</sup> @@ -117,7 +117,7 @@ If set, hides the cursor when pressing a key on the keyboard. ```kdl cursor { - hide-on-key-press + hide-when-typing } ``` |
