mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-01-02 19:42:38 +00:00
macos: add key binding for equalizing split sizes
This commit is contained in:
@@ -95,6 +95,9 @@ pub const App = struct {
|
||||
/// Resize the current split.
|
||||
resize_split: ?*const fn (SurfaceUD, input.SplitResizeDirection, u16) callconv(.C) void = null,
|
||||
|
||||
/// Equalize all splits in the current window
|
||||
equalize_splits: ?*const fn (SurfaceUD) callconv(.C) void = null,
|
||||
|
||||
/// Zoom the current split.
|
||||
toggle_split_zoom: ?*const fn (SurfaceUD) callconv(.C) void = null,
|
||||
|
||||
@@ -396,6 +399,15 @@ pub const Surface = struct {
|
||||
func(self.opts.userdata, direction, amount);
|
||||
}
|
||||
|
||||
pub fn equalizeSplits(self: *const Surface) void {
|
||||
const func = self.app.opts.equalize_splits orelse {
|
||||
log.info("runtime embedder does not support equalize splits", .{});
|
||||
return;
|
||||
};
|
||||
|
||||
func(self.opts.userdata);
|
||||
}
|
||||
|
||||
pub fn toggleSplitZoom(self: *const Surface) void {
|
||||
const func = self.app.opts.toggle_split_zoom orelse {
|
||||
log.info("runtime embedder does not support split zoom", .{});
|
||||
@@ -1388,6 +1400,11 @@ pub const CAPI = struct {
|
||||
ptr.resizeSplit(direction, amount);
|
||||
}
|
||||
|
||||
/// Equalize the size of all splits in the current window.
|
||||
export fn ghostty_surface_split_equalize(ptr: *Surface) void {
|
||||
ptr.equalizeSplits();
|
||||
}
|
||||
|
||||
/// Invoke an action on the surface.
|
||||
export fn ghostty_surface_binding_action(
|
||||
ptr: *Surface,
|
||||
|
||||
Reference in New Issue
Block a user