feat: add alternating autotiling
This commit is contained in:
parent
ce14169d6b
commit
5c2f631fdb
17 changed files with 244 additions and 59 deletions
|
|
@ -2079,6 +2079,12 @@ impl ConfigClient {
|
|||
self.send(&ClientMessage::SetAutotile { enabled });
|
||||
}
|
||||
|
||||
pub fn get_autotile(&self) -> bool {
|
||||
let res = self.send_with_response(&ClientMessage::GetAutotile);
|
||||
get_response!(res, false, GetAutotile { enabled });
|
||||
enabled
|
||||
}
|
||||
|
||||
pub fn set_tab_title_align(&self, align: u32) {
|
||||
self.send(&ClientMessage::SetTabTitleAlign { align });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -923,6 +923,7 @@ pub enum ClientMessage<'a> {
|
|||
SetAutotile {
|
||||
enabled: bool,
|
||||
},
|
||||
GetAutotile,
|
||||
SetTabTitleAlign {
|
||||
align: u32,
|
||||
},
|
||||
|
|
@ -1189,6 +1190,9 @@ pub enum Response {
|
|||
GetCornerRadius {
|
||||
radius: f32,
|
||||
},
|
||||
GetAutotile {
|
||||
enabled: bool,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
|
|
|||
|
|
@ -453,14 +453,21 @@ pub fn get_corner_radius() -> f32 {
|
|||
|
||||
/// Enables or disables autotiling.
|
||||
///
|
||||
/// When enabled, new windows are automatically placed in a perpendicular
|
||||
/// sub-container if the predicted body would be narrower than tall (or vice versa).
|
||||
/// When enabled, newly tiled windows alternate split orientation from the
|
||||
/// focused tiled window: the first split uses the containing group's direction,
|
||||
/// then subsequent splits wrap the focused window in the perpendicular
|
||||
/// direction.
|
||||
///
|
||||
/// The default is `false`.
|
||||
pub fn set_autotile(enabled: bool) {
|
||||
get!().set_autotile(enabled)
|
||||
}
|
||||
|
||||
/// Returns whether autotiling is enabled.
|
||||
pub fn get_autotile() -> bool {
|
||||
get!(false).get_autotile()
|
||||
}
|
||||
|
||||
/// Sets the horizontal alignment of title text within tab buttons.
|
||||
///
|
||||
/// - `"start"` — left-aligned (default)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue