mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-06-15 16:13:56 +00:00
gtk: add "Close Split" to right-click context menu
Add a "Close Split" option to the split submenu in the right-click context menu, allowing users to close the focused split pane directly from the context menu. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -186,6 +186,7 @@ pub const SplitTree = extern struct {
|
||||
.init("new-split", actionNewSplit, s_variant_type),
|
||||
.init("equalize", actionEqualize, null),
|
||||
.init("zoom", actionZoom, null),
|
||||
.init("close-pane", actionClosePane, null),
|
||||
};
|
||||
|
||||
_ = ext.actions.addAsGroup(Self, self, "split-tree", &actions);
|
||||
@@ -663,6 +664,15 @@ pub const SplitTree = extern struct {
|
||||
self.as(gobject.Object).notifyByPspec(properties.tree.impl.param_spec);
|
||||
}
|
||||
|
||||
pub fn actionClosePane(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Self,
|
||||
) callconv(.c) void {
|
||||
const surface = self.getActiveSurface() orelse return;
|
||||
surface.close();
|
||||
}
|
||||
|
||||
fn surfaceCloseRequest(
|
||||
surface: *Surface,
|
||||
self: *Self,
|
||||
|
||||
@@ -316,6 +316,11 @@ menu context_menu_model {
|
||||
action: "split-tree.new-split";
|
||||
target: "right";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("Close Split");
|
||||
action: "split-tree.close-pane";
|
||||
}
|
||||
}
|
||||
|
||||
submenu {
|
||||
|
||||
Reference in New Issue
Block a user