apprt/gtk-ng: proper split operations
parent
34be4de018
commit
9ad92d2c3d
|
|
@ -148,10 +148,10 @@ pub const SplitTree = extern struct {
|
||||||
const actions = .{
|
const actions = .{
|
||||||
// All of these will eventually take a target surface parameter.
|
// All of these will eventually take a target surface parameter.
|
||||||
// For now all our targets originate from the focused surface.
|
// For now all our targets originate from the focused surface.
|
||||||
.{ "new-left", actionNew, null },
|
.{ "new-left", actionNewLeft, null },
|
||||||
.{ "new-right", actionNew, null },
|
.{ "new-right", actionNewRight, null },
|
||||||
.{ "new-up", actionNew, null },
|
.{ "new-up", actionNewUp, null },
|
||||||
.{ "new-down", actionNew, null },
|
.{ "new-down", actionNewDown, null },
|
||||||
};
|
};
|
||||||
|
|
||||||
// We need to collect our actions into a group since we're just
|
// We need to collect our actions into a group since we're just
|
||||||
|
|
@ -405,7 +405,21 @@ pub const SplitTree = extern struct {
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
// Signal handlers
|
// 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,
|
_: *gio.SimpleAction,
|
||||||
parameter_: ?*glib.Variant,
|
parameter_: ?*glib.Variant,
|
||||||
self: *Self,
|
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(
|
fn propSurfaceFocused(
|
||||||
surface: *Surface,
|
surface: *Surface,
|
||||||
_: *gobject.ParamSpec,
|
_: *gobject.ParamSpec,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue