gtk-ng: add TODOs about passing surface that toggled command palette

This commit is contained in:
Jeffrey C. Ollie
2025-08-08 13:51:51 -05:00
committed by Mitchell Hashimoto
parent 8af1230228
commit 3221421a74
2 changed files with 6 additions and 0 deletions

View File

@@ -551,6 +551,7 @@ pub const Surface = extern struct {
}
pub fn toggleCommandPalette(self: *Self) bool {
// TODO: pass the surface with the action
return self.as(gtk.Widget).activateAction("win.toggle-command-palette", null) != 0;
}

View File

@@ -343,6 +343,7 @@ pub const Window = extern struct {
.{ "paste", actionPaste, null },
.{ "reset", actionReset, null },
.{ "clear", actionClear, null },
// TODO: accept the surface that toggled the command palette
.{ "toggle-command-palette", actionToggleCommandPalette, null },
};
@@ -1703,6 +1704,8 @@ pub const Window = extern struct {
}
/// Toggle the command palette.
///
/// TODO: accept the surface that toggled the command palette as a parameter
fn toggleCommandPalette(self: *Window) void {
const priv = self.private();
// Get a reference to a command palette. First check the weak reference
@@ -1756,6 +1759,8 @@ pub const Window = extern struct {
_: ?*glib.Variant,
self: *Window,
) callconv(.c) void {
// TODO: accept the surface that toggled the command palette as a
// parameter
self.toggleCommandPalette();
}