forge
Explore
Log in

Don't you dare go Hollow

[cfg-breaking] Rename hide-on-key-press to hide-when-typing

Browse files at this commit

13fe9c8ac362c5e9c7796a409be591518ce4190fIvan MolodetskikhParent: 6ecbf2d
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.
niri-config/src/lib.rsmodified+4 -4
@@ -666,7 +666,7 @@ pub struct Cursor {
666 #[knuffel(child, unwrap(argument), default = 24)]666 #[knuffel(child, unwrap(argument), default = 24)]
667 pub xcursor_size: u8,667 pub xcursor_size: u8,
668 #[knuffel(child)]668 #[knuffel(child)]
669- pub hide_on_key_press: bool,669+ pub hide_when_typing: bool,
670 #[knuffel(child, unwrap(argument))]670 #[knuffel(child, unwrap(argument))]
671 pub hide_after_inactive_ms: Option<u32>,671 pub hide_after_inactive_ms: Option<u32>,
672 }672 }
@@ -676,7 +676,7 @@ impl Default for Cursor {
676 Self {676 Self {
677 xcursor_theme: String::from("default"),677 xcursor_theme: String::from("default"),
678 xcursor_size: 24,678 xcursor_size: 24,
679- hide_on_key_press: false,679+ hide_when_typing: false,
680 hide_after_inactive_ms: None,680 hide_after_inactive_ms: None,
681 }681 }
682 }682 }
@@ -3061,7 +3061,7 @@ mod tests {
3061 cursor {3061 cursor {
3062 xcursor-theme "breeze_cursors"3062 xcursor-theme "breeze_cursors"
3063 xcursor-size 163063 xcursor-size 16
3064- hide-on-key-press3064+ hide-when-typing
3065 hide-after-inactive-ms 30003065 hide-after-inactive-ms 3000
3066 }3066 }
3067 3067
@@ -3286,7 +3286,7 @@ mod tests {
3286 cursor: Cursor {3286 cursor: Cursor {
3287 xcursor_theme: String::from("breeze_cursors"),3287 xcursor_theme: String::from("breeze_cursors"),
3288 xcursor_size: 16,3288 xcursor_size: 16,
3289- hide_on_key_press: true,3289+ hide_when_typing: true,
3290 hide_after_inactive_ms: Some(3000),3290 hide_after_inactive_ms: Some(3000),
3291 },3291 },
3292 screenshot_path: Some(String::from("~/Screenshots/screenshot.png")),3292 screenshot_path: Some(String::from("~/Screenshots/screenshot.png")),
src/input/mod.rsmodified+1 -1
@@ -423,7 +423,7 @@ impl State {
423 }423 }
424 424
425 fn hide_cursor_if_needed(&mut self) {425 fn hide_cursor_if_needed(&mut self) {
426- if !self.niri.config.borrow().cursor.hide_on_key_press {426+ if !self.niri.config.borrow().cursor.hide_when_typing {
427 return;427 return;
428 }428 }
429 429
wiki/Configuration:-Miscellaneous.mdmodified+3 -3
@@ -21,7 +21,7 @@ cursor {
21 xcursor-theme "breeze_cursors"21 xcursor-theme "breeze_cursors"
22 xcursor-size 4822 xcursor-size 48
23 23
24- hide-on-key-press24+ hide-when-typing
25 hide-after-inactive-ms 100025 hide-after-inactive-ms 1000
26 }26 }
27 27
@@ -109,7 +109,7 @@ cursor {
109 }109 }
110 ```110 ```
111 111
112-#### `hide-on-key-press`112+#### `hide-when-typing`
113 113
114 <sup>Since: 0.1.10</sup>114 <sup>Since: 0.1.10</sup>
115 115
@@ -117,7 +117,7 @@ If set, hides the cursor when pressing a key on the keyboard.
117 117
118 ```kdl118 ```kdl
119 cursor {119 cursor {
120- hide-on-key-press120+ hide-when-typing
121 }121 }
122 ```122 ```
123 123