diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2015-01-18 02:07:30 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2015-01-18 02:07:30 +0200 |
commit | c2eabf2be13de14e0e57ad6374cceb049b8d03da (patch) | |
tree | e02e3fec7d30285d64824c681ff489eb69afaeea /client | |
parent | f2eaf599f6bb585d1a4921f37a073ed09c619de9 (diff) | |
download | bemenu-c2eabf2be13de14e0e57ad6374cceb049b8d03da.tar.gz bemenu-c2eabf2be13de14e0e57ad6374cceb049b8d03da.tar.bz2 bemenu-c2eabf2be13de14e0e57ad6374cceb049b8d03da.zip |
Make scrollbar autohideable
Diffstat (limited to 'client')
-rw-r--r-- | client/common/common.c | 6 | ||||
-rw-r--r-- | client/common/common.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/client/common/common.c b/client/common/common.c index 982f89a..14837cb 100644 --- a/client/common/common.c +++ b/client/common/common.c @@ -68,7 +68,7 @@ usage(FILE *out, const char *name) " -p, --prompt defines the prompt text to be displayed.\n" " -P, --prefix text to shown before highlighted item.\n" " -I, --index select item at index automatically.\n" - " --scrollbar display scrollbar.\n\n" + " --scrollbar display scrollbar. (always, autohide)\n\n" "Use BEMENU_BACKEND env variable to force backend:\n" " curses ncurses based terminal backend\n" @@ -117,7 +117,7 @@ parse_args(struct client *client, int *argc, char **argv[]) { "prompt", required_argument, 0, 'p' }, { "index", required_argument, 0, 'I' }, { "prefix", required_argument, 0, 'P' }, - { "scrollbar", no_argument, 0, 0x113 }, + { "scrollbar", required_argument, 0, 0x113 }, { "bottom", no_argument, 0, 'b' }, { "grab", no_argument, 0, 'f' }, @@ -177,7 +177,7 @@ parse_args(struct client *client, int *argc, char **argv[]) client->selected = strtol(optarg, NULL, 10); break; case 0x113: - client->scrollbar = true; + client->scrollbar = (!strcmp(optarg, "always") ? BM_SCROLLBAR_ALWAYS : (!strcmp(optarg, "autohide") ? BM_SCROLLBAR_AUTOHIDE : BM_SCROLLBAR_NONE)); break; case 'b': diff --git a/client/common/common.h b/client/common/common.h index 914ddf0..eafbb3a 100644 --- a/client/common/common.h +++ b/client/common/common.h @@ -5,6 +5,7 @@ struct client { enum bm_filter_mode filter_mode; + enum bm_scrollbar_mode scrollbar; const char *colors[BM_COLOR_LAST]; const char *title; const char *prefix; @@ -15,7 +16,6 @@ struct client { bool bottom; bool grab; bool wrap; - bool scrollbar; }; void parse_args(struct client *client, int *argc, char **argv[]); |