mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-23 21:30:19 +00:00
apprt/gtk-ng: proper split operations
This commit is contained in:
@@ -148,10 +148,10 @@ pub const SplitTree = extern struct {
|
||||
const actions = .{
|
||||
// All of these will eventually take a target surface parameter.
|
||||
// For now all our targets originate from the focused surface.
|
||||
.{ "new-left", actionNew, null },
|
||||
.{ "new-right", actionNew, null },
|
||||
.{ "new-up", actionNew, null },
|
||||
.{ "new-down", actionNew, null },
|
||||
.{ "new-left", actionNewLeft, null },
|
||||
.{ "new-right", actionNewRight, null },
|
||||
.{ "new-up", actionNewUp, null },
|
||||
.{ "new-down", actionNewDown, null },
|
||||
};
|
||||
|
||||
// We need to collect our actions into a group since we're just
|
||||
@@ -405,7 +405,21 @@ pub const SplitTree = extern struct {
|
||||
//---------------------------------------------------------------
|
||||
// Signal handlers
|
||||
|
||||
pub fn actionNew(
|
||||
pub fn actionNewLeft(
|
||||
_: *gio.SimpleAction,
|
||||
parameter_: ?*glib.Variant,
|
||||
self: *Self,
|
||||
) callconv(.c) void {
|
||||
_ = parameter_;
|
||||
self.newSplit(
|
||||
.left,
|
||||
self.getActiveSurface(),
|
||||
) catch |err| {
|
||||
log.warn("new split failed error={}", .{err});
|
||||
};
|
||||
}
|
||||
|
||||
pub fn actionNewRight(
|
||||
_: *gio.SimpleAction,
|
||||
parameter_: ?*glib.Variant,
|
||||
self: *Self,
|
||||
@@ -419,6 +433,34 @@ pub const SplitTree = extern struct {
|
||||
};
|
||||
}
|
||||
|
||||
pub fn actionNewUp(
|
||||
_: *gio.SimpleAction,
|
||||
parameter_: ?*glib.Variant,
|
||||
self: *Self,
|
||||
) callconv(.c) void {
|
||||
_ = parameter_;
|
||||
self.newSplit(
|
||||
.up,
|
||||
self.getActiveSurface(),
|
||||
) catch |err| {
|
||||
log.warn("new split failed error={}", .{err});
|
||||
};
|
||||
}
|
||||
|
||||
pub fn actionNewDown(
|
||||
_: *gio.SimpleAction,
|
||||
parameter_: ?*glib.Variant,
|
||||
self: *Self,
|
||||
) callconv(.c) void {
|
||||
_ = parameter_;
|
||||
self.newSplit(
|
||||
.down,
|
||||
self.getActiveSurface(),
|
||||
) catch |err| {
|
||||
log.warn("new split failed error={}", .{err});
|
||||
};
|
||||
}
|
||||
|
||||
fn propSurfaceFocused(
|
||||
surface: *Surface,
|
||||
_: *gobject.ParamSpec,
|
||||
|
||||
Reference in New Issue
Block a user