all: add support for hy3 like tiling
This commit is contained in:
parent
a41dbae899
commit
cea4187fc0
21 changed files with 1237 additions and 48 deletions
|
|
@ -1757,6 +1757,41 @@ impl ConfigProxyHandler {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_seat_toggle_tab(&self, seat: Seat) -> Result<(), CphError> {
|
||||
let seat = self.get_seat(seat)?;
|
||||
seat.toggle_tab();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_seat_make_group(
|
||||
&self,
|
||||
seat: Seat,
|
||||
axis: Axis,
|
||||
ephemeral: bool,
|
||||
) -> Result<(), CphError> {
|
||||
let seat = self.get_seat(seat)?;
|
||||
seat.make_group(axis.into(), ephemeral);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_seat_change_group_opposite(&self, seat: Seat) -> Result<(), CphError> {
|
||||
let seat = self.get_seat(seat)?;
|
||||
seat.change_group_opposite();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_seat_equalize(&self, seat: Seat, recursive: bool) -> Result<(), CphError> {
|
||||
let seat = self.get_seat(seat)?;
|
||||
seat.equalize(recursive);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_seat_move_tab(&self, seat: Seat, right: bool) -> Result<(), CphError> {
|
||||
let seat = self.get_seat(seat)?;
|
||||
seat.move_tab(right);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_get_window_split(&self, window: Window) -> Result<(), CphError> {
|
||||
let window = self.get_window(window)?;
|
||||
self.respond(Response::GetWindowSplit {
|
||||
|
|
@ -2464,6 +2499,12 @@ impl ConfigProxyHandler {
|
|||
BAR_SEPARATOR_WIDTH => ThemeSized::bar_separator_width,
|
||||
GAP => ThemeSized::gap,
|
||||
TITLE_GAP => ThemeSized::title_gap,
|
||||
TAB_BAR_HEIGHT => ThemeSized::tab_bar_height,
|
||||
TAB_BAR_PADDING => ThemeSized::tab_bar_padding,
|
||||
TAB_BAR_RADIUS => ThemeSized::tab_bar_radius,
|
||||
TAB_BAR_BORDER_WIDTH => ThemeSized::tab_bar_border_width,
|
||||
TAB_BAR_TEXT_PADDING => ThemeSized::tab_bar_text_padding,
|
||||
TAB_BAR_GAP => ThemeSized::tab_bar_gap,
|
||||
_ => return Err(CphError::UnknownSized(sized.0)),
|
||||
};
|
||||
Ok(sized)
|
||||
|
|
@ -2541,6 +2582,14 @@ impl ConfigProxyHandler {
|
|||
BAR_STATUS_TEXT_COLOR => ThemeColor::bar_text,
|
||||
ATTENTION_REQUESTED_BACKGROUND_COLOR => ThemeColor::attention_requested_background,
|
||||
HIGHLIGHT_COLOR => ThemeColor::highlight,
|
||||
TAB_ACTIVE_BACKGROUND_COLOR => ThemeColor::tab_active_background,
|
||||
TAB_ACTIVE_BORDER_COLOR => ThemeColor::tab_active_border,
|
||||
TAB_INACTIVE_BACKGROUND_COLOR => ThemeColor::tab_inactive_background,
|
||||
TAB_INACTIVE_BORDER_COLOR => ThemeColor::tab_inactive_border,
|
||||
TAB_ACTIVE_TEXT_COLOR => ThemeColor::tab_active_text,
|
||||
TAB_INACTIVE_TEXT_COLOR => ThemeColor::tab_inactive_text,
|
||||
TAB_BAR_BACKGROUND_COLOR => ThemeColor::tab_bar_background,
|
||||
TAB_ATTENTION_BACKGROUND_COLOR => ThemeColor::tab_attention_background,
|
||||
_ => return Err(CphError::UnknownColor(colorable.0)),
|
||||
};
|
||||
Ok(colorable)
|
||||
|
|
@ -3448,6 +3497,40 @@ impl ConfigProxyHandler {
|
|||
} => self
|
||||
.handle_window_resize(window, dx1, dy1, dx2, dy2)
|
||||
.wrn("window_resize")?,
|
||||
ClientMessage::SeatToggleTab { seat } => self
|
||||
.handle_seat_toggle_tab(seat)
|
||||
.wrn("seat_toggle_tab")?,
|
||||
ClientMessage::SeatMakeGroup {
|
||||
seat,
|
||||
axis,
|
||||
ephemeral,
|
||||
} => self
|
||||
.handle_seat_make_group(seat, axis, ephemeral)
|
||||
.wrn("seat_make_group")?,
|
||||
ClientMessage::SeatChangeGroupOpposite { seat } => self
|
||||
.handle_seat_change_group_opposite(seat)
|
||||
.wrn("seat_change_group_opposite")?,
|
||||
ClientMessage::SeatEqualize { seat, recursive } => self
|
||||
.handle_seat_equalize(seat, recursive)
|
||||
.wrn("seat_equalize")?,
|
||||
ClientMessage::SetAutotile { enabled } => {
|
||||
self.state.theme.autotile_enabled.set(enabled);
|
||||
}
|
||||
ClientMessage::SeatToggleExpand { .. } => {
|
||||
// Removed feature; kept for binary protocol compatibility.
|
||||
}
|
||||
ClientMessage::SetTabTitleAlign { align } => {
|
||||
use crate::theme::TabTitleAlign;
|
||||
let val = match align {
|
||||
1 => TabTitleAlign::Center,
|
||||
2 => TabTitleAlign::End,
|
||||
_ => TabTitleAlign::Start,
|
||||
};
|
||||
self.state.theme.tab_title_align.set(val);
|
||||
}
|
||||
ClientMessage::SeatMoveTab { seat, right } => self
|
||||
.handle_seat_move_tab(seat, right)
|
||||
.wrn("seat_move_tab")?,
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue