summaryrefslogtreecommitdiffstats
path: root/cmd-display-menu.c
diff options
context:
space:
mode:
authornicm <nicm>2023-08-15 07:01:47 +0000
committernicm <nicm>2023-08-15 07:01:47 +0000
commitb770a429c63a8e286dbd3939215fbffa59e73d9a (patch)
treed1bdeafad49032ea9cbf908c37b2e9737b828a91 /cmd-display-menu.c
parent57837bbf67c10638e0684c93bb29e88ca9b07b52 (diff)
Add an option menu-selected-style to configure the currently selected
menu item, from Alexis Hildebrandt.
Diffstat (limited to 'cmd-display-menu.c')
-rw-r--r--cmd-display-menu.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd-display-menu.c b/cmd-display-menu.c
index a0a86b1f..7d0d3e59 100644
--- a/cmd-display-menu.c
+++ b/cmd-display-menu.c
@@ -39,11 +39,11 @@ const struct cmd_entry cmd_display_menu_entry = {
.name = "display-menu",
.alias = "menu",
- .args = { "b:c:C:t:s:S:OT:x:y:", 1, -1, cmd_display_menu_args_parse },
+ .args = { "b:c:C:H:s:S:Ot:T:x:y:", 1, -1, cmd_display_menu_args_parse },
.usage = "[-O] [-b border-lines] [-c target-client] "
- "[-C starting-choice] [-s style] [-S border-style] "
- CMD_TARGET_PANE_USAGE "[-T title] [-x position] [-y position] "
- "name key command ...",
+ "[-C starting-choice] [-H selected-style] [-s style] "
+ "[-S border-style] " CMD_TARGET_PANE_USAGE "[-T title] "
+ "[-x position] [-y position] name key command ...",
.target = { 't', CMD_FIND_PANE, 0 },
@@ -293,6 +293,7 @@ cmd_display_menu_exec(struct cmd *self, struct cmdq_item *item)
const char *key, *name, *value;
const char *style = args_get(args, 's');
const char *border_style = args_get(args, 'S');
+ const char *selected_style = args_get(args, 'H');
enum box_lines lines = BOX_LINES_DEFAULT;
char *title, *cause;
int flags = 0, starting_choice = 0;
@@ -376,7 +377,7 @@ cmd_display_menu_exec(struct cmd *self, struct cmdq_item *item)
if (!event->m.valid)
flags |= MENU_NOMOUSE;
if (menu_display(menu, flags, starting_choice, item, px, py, tc, lines,
- style, border_style, target, NULL, NULL) != 0)
+ style, selected_style, border_style, target, NULL, NULL) != 0)
return (CMD_RETURN_NORMAL);
return (CMD_RETURN_WAIT);
}