1
0
Fork 0
forked from wry/wry

all: add support for hy3 like tiling

This commit is contained in:
kossLAN 2026-04-10 13:16:35 -04:00
parent a41dbae899
commit cea4187fc0
No known key found for this signature in database
21 changed files with 1237 additions and 48 deletions

View file

@ -23,6 +23,7 @@ use {
ahash::{AHashMap, AHashSet},
error_reporter::Report,
jay_config::{
Axis,
client::Client,
config, config_dir,
exec::{Command, set_env, unset_env},
@ -40,7 +41,7 @@ use {
set_color_management_enabled, set_default_workspace_capture, set_explicit_sync_enabled,
set_float_above_fullscreen, set_idle, set_idle_grace_period,
set_floating_titles, set_middle_click_paste_enabled, set_show_bar, set_show_float_pin_icon,
set_show_titles, set_corner_radius,
set_show_titles, set_corner_radius, set_autotile, set_tab_title_align,
set_ui_drag_enabled, set_ui_drag_threshold,
status::{set_i3bar_separator, set_status, set_status_command, unset_status_command},
switch_to_vt,
@ -169,11 +170,6 @@ impl Action {
Action::SimpleCommand { cmd } => match cmd {
SimpleCommand::Focus(dir) => b.new(move || s.focus(dir)),
SimpleCommand::Move(dir) => window_or_seat!(s, s.move_(dir)),
SimpleCommand::Split(axis) => window_or_seat!(s, s.create_split(axis)),
SimpleCommand::ToggleSplit => window_or_seat!(s, s.toggle_split()),
SimpleCommand::SetSplit(b) => window_or_seat!(s, s.set_split(b)),
SimpleCommand::ToggleMono => window_or_seat!(s, s.toggle_mono()),
SimpleCommand::SetMono(b) => window_or_seat!(s, s.set_mono(b)),
SimpleCommand::ToggleFullscreen => window_or_seat!(s, s.toggle_fullscreen()),
SimpleCommand::SetFullscreen(b) => window_or_seat!(s, s.set_fullscreen(b)),
SimpleCommand::FocusParent => b.new(move || s.focus_parent()),
@ -259,6 +255,35 @@ impl Action {
let persistent = state.persistent.clone();
b.new(move || persistent.seat.warp_mouse_to_focus())
}
SimpleCommand::ToggleTab => b.new(move || s.toggle_tab()),
SimpleCommand::MakeGroupH => {
b.new(move || s.make_group(Axis::Horizontal, true))
}
SimpleCommand::MakeGroupV => {
b.new(move || s.make_group(Axis::Vertical, true))
}
SimpleCommand::MakeGroupTab => {
b.new(move || {
s.make_group(Axis::Horizontal, true);
s.toggle_tab();
})
}
SimpleCommand::ChangeGroupOpposite => {
b.new(move || s.change_group_opposite())
}
SimpleCommand::Equalize => b.new(move || s.equalize(false)),
SimpleCommand::EqualizeRecursive => b.new(move || s.equalize(true)),
SimpleCommand::MoveTabLeft => b.new(move || s.move_tab(false)),
SimpleCommand::MoveTabRight => b.new(move || s.move_tab(true)),
SimpleCommand::SetAutotile(enabled) => {
b.new(move || set_autotile(enabled))
}
SimpleCommand::ToggleAutotile => {
b.new(move || {
// Toggle not directly supported; set to true
set_autotile(true)
})
}
},
Action::Multi { actions } => {
let actions: Vec<_> = actions.into_iter().map(|a| a.into_fn(state)).collect();
@ -997,6 +1022,14 @@ impl State {
color!(UNFOCUSED_TITLE_BACKGROUND_COLOR, unfocused_title_bg_color);
color!(UNFOCUSED_TITLE_TEXT_COLOR, unfocused_title_text_color);
color!(HIGHLIGHT_COLOR, highlight_color);
color!(TAB_ACTIVE_BACKGROUND_COLOR, tab_active_bg_color);
color!(TAB_ACTIVE_BORDER_COLOR, tab_active_border_color);
color!(TAB_INACTIVE_BACKGROUND_COLOR, tab_inactive_bg_color);
color!(TAB_INACTIVE_BORDER_COLOR, tab_inactive_border_color);
color!(TAB_ACTIVE_TEXT_COLOR, tab_active_text_color);
color!(TAB_INACTIVE_TEXT_COLOR, tab_inactive_text_color);
color!(TAB_BAR_BACKGROUND_COLOR, tab_bar_bg_color);
color!(TAB_ATTENTION_BACKGROUND_COLOR, tab_attention_bg_color);
macro_rules! size {
($sized:ident, $field:ident) => {
if let Some(size) = theme.$field {
@ -1010,6 +1043,12 @@ impl State {
size!(BAR_SEPARATOR_WIDTH, bar_separator_width);
size!(GAP, gap);
size!(TITLE_GAP, title_gap);
size!(TAB_BAR_HEIGHT, tab_bar_height);
size!(TAB_BAR_PADDING, tab_bar_padding);
size!(TAB_BAR_RADIUS, tab_bar_radius);
size!(TAB_BAR_BORDER_WIDTH, tab_bar_border_width);
size!(TAB_BAR_TEXT_PADDING, tab_bar_text_padding);
size!(TAB_BAR_GAP, tab_bar_gap);
macro_rules! font {
($fun:ident, $field:ident) => {
if let Some(font) = &theme.$field {
@ -1023,6 +1062,9 @@ impl State {
if let Some(radius) = theme.corner_radius {
set_corner_radius(radius);
}
if let Some(ref align) = theme.tab_title_align {
set_tab_title_align(align);
}
}
fn handle_switch_device(self: &Rc<Self>, dev: InputDevice, actions: &Rc<SwitchActions>) {