Add change_ratio keybind

This commit is contained in:
Ben Buhse 2026-01-30 21:47:16 -06:00
commit 365c000b6e
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
5 changed files with 49 additions and 16 deletions

View file

@ -9,8 +9,7 @@ pub const Command = union(enum) {
focus_next,
focus_prev,
zoom,
// ratio_up, // TODO
// ratio_down, // TODO
change_ratio: f32,
// reload_config, // TODO
toggle_fullscreen,
close_window,
@ -128,6 +127,12 @@ const XkbBinding = struct {
};
current_focus.link.swapWith(&first_window.link);
},
.change_ratio => |diff| {
const new_ratio = context.wm.primary_ratio + diff;
if (new_ratio >= 0.10 and new_ratio <= 0.90) {
context.wm.pending_manage.primary_ratio = context.wm.primary_ratio + diff;
}
},
.toggle_fullscreen => {
const seat = context.wm.seats.first() orelse return;
const window = seat.focused orelse return;