gtk: add support for resizing splits via keybinds

This adds support for resizing splits via keybinds to the GTK runtime.

Code is straightforward. I couldn't see a way to do it without keeping
track of the orientation of the splits, but I think that's fine.
This commit is contained in:
Thorsten Ball
2023-12-06 06:25:34 +01:00
parent f12371ec1c
commit 40e239bf7a
3 changed files with 61 additions and 0 deletions

View File

@@ -977,6 +977,28 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config {
.{ .goto_split = .right },
);
// Resizing splits
try result.keybind.set.put(
alloc,
.{ .key = .up, .mods = .{ .super = true, .ctrl = true, .shift = true } },
.{ .resize_split = .{ .up, 10 } },
);
try result.keybind.set.put(
alloc,
.{ .key = .down, .mods = .{ .super = true, .ctrl = true, .shift = true } },
.{ .resize_split = .{ .down, 10 } },
);
try result.keybind.set.put(
alloc,
.{ .key = .left, .mods = .{ .super = true, .ctrl = true, .shift = true } },
.{ .resize_split = .{ .left, 10 } },
);
try result.keybind.set.put(
alloc,
.{ .key = .right, .mods = .{ .super = true, .ctrl = true, .shift = true } },
.{ .resize_split = .{ .right, 10 } },
);
// Viewport scrolling
try result.keybind.set.put(
alloc,