From c67c0b0c94c6533dbc03df816073c3d0be78e627 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 13 Aug 2025 22:35:58 +0200 Subject: [PATCH] feat: add style switching command to palette (alt+f9) --- src/keybind/builtin/flow.json | 1 + src/tui/mode/overlay/palette.zig | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/keybind/builtin/flow.json b/src/keybind/builtin/flow.json index cbecedd..aafa86e 100644 --- a/src/keybind/builtin/flow.json +++ b/src/keybind/builtin/flow.json @@ -285,6 +285,7 @@ }, "overlay/palette": { "press": [ + ["alt+f9", "overlay_next_widget_style"], ["alt+!", "add_task"], ["ctrl+j", "toggle_panel"], ["ctrl+q", "quit"], diff --git a/src/tui/mode/overlay/palette.zig b/src/tui/mode/overlay/palette.zig index 722f27d..d5c2472 100644 --- a/src/tui/mode/overlay/palette.zig +++ b/src/tui/mode/overlay/palette.zig @@ -532,6 +532,14 @@ pub fn Create(options: type) type { } pub const overlay_toggle_inputview_meta: Meta = .{}; + pub fn overlay_next_widget_style(self: *Self, _: Ctx) Result { + Widget.Style.set_next_style(widget_style_type); + const padding = Widget.Style.from_type(widget_style_type).padding; + self.do_resize(padding); + tui.need_render(); + } + pub const overlay_next_widget_style_meta: Meta = .{}; + pub fn mini_mode_paste(self: *Self, ctx: Ctx) Result { return overlay_insert_bytes(self, ctx); }