gtk: add command palette to titlebar menu
parent
048e4acb2c
commit
3b013b1174
|
|
@ -1047,6 +1047,7 @@ fn syncActionAccelerators(self: *App) !void {
|
|||
try self.syncActionAccelerator("app.open-config", .{ .open_config = {} });
|
||||
try self.syncActionAccelerator("app.reload-config", .{ .reload_config = {} });
|
||||
try self.syncActionAccelerator("win.toggle-inspector", .{ .inspector = .toggle });
|
||||
try self.syncActionAccelerator("win.toggle-command-palette", .toggle_command_palette);
|
||||
try self.syncActionAccelerator("win.close", .{ .close_window = {} });
|
||||
try self.syncActionAccelerator("win.new-window", .{ .new_window = {} });
|
||||
try self.syncActionAccelerator("win.new-tab", .{ .new_tab = {} });
|
||||
|
|
|
|||
|
|
@ -587,6 +587,7 @@ fn initActions(self: *Window) void {
|
|||
.{ "split-left", gtkActionSplitLeft },
|
||||
.{ "split-up", gtkActionSplitUp },
|
||||
.{ "toggle-inspector", gtkActionToggleInspector },
|
||||
.{ "toggle-command-palette", gtkActionToggleCommandPalette },
|
||||
.{ "copy", gtkActionCopy },
|
||||
.{ "paste", gtkActionPaste },
|
||||
.{ "reset", gtkActionReset },
|
||||
|
|
@ -1102,6 +1103,14 @@ fn gtkActionToggleInspector(
|
|||
self.performBindingAction(.{ .inspector = .toggle });
|
||||
}
|
||||
|
||||
fn gtkActionToggleCommandPalette(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
self: *Window,
|
||||
) callconv(.C) void {
|
||||
self.performBindingAction(.toggle_command_palette);
|
||||
}
|
||||
|
||||
fn gtkActionCopy(
|
||||
_: *gio.SimpleAction,
|
||||
_: ?*glib.Variant,
|
||||
|
|
|
|||
|
|
@ -81,6 +81,11 @@ menu menu {
|
|||
}
|
||||
|
||||
section {
|
||||
item {
|
||||
label: _("Command Palette");
|
||||
action: "win.toggle-command-palette";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("Terminal Inspector");
|
||||
action: "win.toggle-inspector";
|
||||
|
|
|
|||
Loading…
Reference in New Issue