Implement hide cursor on key press and on timeout

This commit is contained in:
yzy-1
2024-10-02 08:22:50 +08:00
committed by Ivan Molodetskikh
parent 1ba2be3928
commit 42a9daec9d
3 changed files with 74 additions and 2 deletions
+10
View File
@@ -615,6 +615,10 @@ pub struct Cursor {
pub xcursor_theme: String,
#[knuffel(child, unwrap(argument), default = 24)]
pub xcursor_size: u8,
#[knuffel(child)]
pub hide_on_key_press: bool,
#[knuffel(child, unwrap(argument))]
pub hide_after_inactive_ms: Option<u32>,
}
impl Default for Cursor {
@@ -622,6 +626,8 @@ impl Default for Cursor {
Self {
xcursor_theme: String::from("default"),
xcursor_size: 24,
hide_on_key_press: false,
hide_after_inactive_ms: None,
}
}
}
@@ -2953,6 +2959,8 @@ mod tests {
cursor {
xcursor-theme "breeze_cursors"
xcursor-size 16
hide-on-key-press
hide-after-inactive-ms 3000
}
screenshot-path "~/Screenshots/screenshot.png"
@@ -3154,6 +3162,8 @@ mod tests {
cursor: Cursor {
xcursor_theme: String::from("breeze_cursors"),
xcursor_size: 16,
hide_on_key_press: true,
hide_after_inactive_ms: Some(3000),
},
screenshot_path: Some(String::from("~/Screenshots/screenshot.png")),
hotkey_overlay: HotkeyOverlay {