config: allow disabling window titles
This commit is contained in:
parent
796269d31e
commit
daafb98336
19 changed files with 222 additions and 74 deletions
|
|
@ -1006,6 +1006,16 @@ impl ConfigClient {
|
|||
show
|
||||
}
|
||||
|
||||
pub fn set_show_titles(&self, show: bool) {
|
||||
self.send(&ClientMessage::SetShowTitles { show });
|
||||
}
|
||||
|
||||
pub fn get_show_titles(&self) -> bool {
|
||||
let res = self.send_with_response(&ClientMessage::GetShowTitles);
|
||||
get_response!(res, true, GetShowTitles { show });
|
||||
show
|
||||
}
|
||||
|
||||
pub fn set_middle_click_paste_enabled(&self, enabled: bool) {
|
||||
self.send(&ClientMessage::SetMiddleClickPasteEnabled { enabled });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -801,6 +801,10 @@ pub enum ClientMessage<'a> {
|
|||
SeatEnableUnicodeInput {
|
||||
seat: Seat,
|
||||
},
|
||||
SetShowTitles {
|
||||
show: bool,
|
||||
},
|
||||
GetShowTitles,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
|
@ -1036,6 +1040,9 @@ pub enum Response {
|
|||
SeatGetSimpleImEnabled {
|
||||
enabled: bool,
|
||||
},
|
||||
GetShowTitles {
|
||||
show: bool,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
|
|
|||
|
|
@ -336,6 +336,24 @@ pub fn toggle_show_bar() {
|
|||
get.set_show_bar(!get.get_show_bar());
|
||||
}
|
||||
|
||||
/// Sets whether title bars on windows are shown.
|
||||
///
|
||||
/// The default is `true`.
|
||||
pub fn set_show_titles(show: bool) {
|
||||
get!().set_show_titles(show)
|
||||
}
|
||||
|
||||
/// Returns whether title bars on windows are shown.
|
||||
pub fn get_show_titles() -> bool {
|
||||
get!(true).get_show_titles()
|
||||
}
|
||||
|
||||
/// Toggles whether title bars on windows are shown.
|
||||
pub fn toggle_show_titles() {
|
||||
let get = get!();
|
||||
get.set_show_titles(!get.get_show_titles());
|
||||
}
|
||||
|
||||
/// Sets a callback to run when this config is unloaded.
|
||||
///
|
||||
/// Only one callback can be set at a time. If another callback is already set, it will be
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue