feat: add initial simplistic command palette implementation
This commit is contained in:
parent
acd65d0157
commit
25556336b9
9 changed files with 289 additions and 5 deletions
|
@ -40,7 +40,7 @@ pub fn create(a: std.mem.Allocator, parent: Widget) !Widget {
|
|||
try self.menu.add_item_with_handler("Open file ·················· :o", menu_action_open_file);
|
||||
try self.menu.add_item_with_handler("Open recent file ··········· :e", menu_action_open_recent_file);
|
||||
try self.menu.add_item_with_handler("Open recent project ·(wip)·· :r", menu_action_open_recent_project);
|
||||
try self.menu.add_item_with_handler("Show/Run commands ···(wip)·· :p", menu_action_show_commands);
|
||||
try self.menu.add_item_with_handler("Show/Run commands ·········· :p", menu_action_show_commands);
|
||||
try self.menu.add_item_with_handler("Open config file ··········· :c", menu_action_open_config);
|
||||
try self.menu.add_item_with_handler("Quit/Close ················· :q", menu_action_quit);
|
||||
self.menu.resize(.{ .y = 15, .x = 9, .w = 32 });
|
||||
|
@ -119,7 +119,7 @@ fn menu_action_open_recent_project(_: **Menu.State(*Self), _: *Button.State(*Men
|
|||
}
|
||||
|
||||
fn menu_action_show_commands(_: **Menu.State(*Self), _: *Button.State(*Menu.State(*Self))) void {
|
||||
tp.self_pid().send(.{ "log", "home", "open command palette not implemented" }) catch {};
|
||||
command.executeName("enter_overlay_mode", command.fmt(.{"command_palette"})) catch {};
|
||||
}
|
||||
|
||||
fn menu_action_open_config(_: **Menu.State(*Self), _: *Button.State(*Menu.State(*Self))) void {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue