1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

Add option to set scrollbar width

This commit is contained in:
Dave Davenport 2015-12-13 13:51:59 +01:00
parent f3c22c50e4
commit 97fa0cc61d
7 changed files with 16 additions and 2 deletions

View file

@ -11,6 +11,7 @@
- Regex matching (#113) - Regex matching (#113)
- Take Screenshot of rofi using keybinding. - Take Screenshot of rofi using keybinding.
- Hotkey for sorting: (#298) - Hotkey for sorting: (#298)
- Option to set scrollbar width.
Improvements: Improvements:
- Fix return code of multi-select. - Fix return code of multi-select.
- Update manpage (#289, #291) - Update manpage (#289, #291)

View file

@ -150,4 +150,5 @@ Settings config = {
.fake_transparency = FALSE, .fake_transparency = FALSE,
.dpi = -1, .dpi = -1,
.threads = 1, .threads = 1,
.scrollbar_width = 8,
}; };

View file

@ -359,6 +359,10 @@ Set separator style. Possible options are "none", "solid" or "dash".
Hide the scrollbar. Hide the scrollbar.
`-scrollbar-width` *width*
Set the scrollbar width.
`-glob` `-glob`
Use glob style matching Use glob style matching

View file

@ -598,6 +598,12 @@ Default: *dash*
Hide the scrollbar\. Hide the scrollbar\.
. .
.P .P
\fB\-scrollbar\-width\fR \fIwidth\fR
.
.P
Set the scrollbar width\.
.
.P
\fB\-glob\fR \fB\-glob\fR
. .
.P .P

View file

@ -230,6 +230,7 @@ typedef struct _Settings
int dpi; int dpi;
/** Number threads (1 to disable) */ /** Number threads (1 to disable) */
unsigned int threads; unsigned int threads;
unsigned int scrollbar_width;
} Settings; } Settings;
/** Global Settings structure. */ /** Global Settings structure. */

View file

@ -1382,7 +1382,7 @@ MenuReturn menu ( Mode *sw, char **input, char *prompt, unsigned int *selected_l
state.element_width, element_height, NORMAL, "" ); state.element_width, element_height, NORMAL, "" );
} }
if ( !config.hide_scrollbar ) { if ( !config.hide_scrollbar ) {
unsigned int sbw = config.line_margin + 8; unsigned int sbw = config.line_margin+config.scrollbar_width;
state.scrollbar = scrollbar_create ( state.w - state.border - sbw, state.top_offset, state.scrollbar = scrollbar_create ( state.w - state.border - sbw, state.top_offset,
sbw, ( state.max_rows - 1 ) * ( element_height + config.line_margin ) + element_height ); sbw, ( state.max_rows - 1 ) * ( element_height + config.line_margin ) + element_height );
} }

View file

@ -138,7 +138,8 @@ static XrmOption xrmOptions[] = {
{ xrm_Boolean, "fullscreen", { .num = &config.fullscreen }, NULL, "Fullscreen" }, { xrm_Boolean, "fullscreen", { .num = &config.fullscreen }, NULL, "Fullscreen" },
{ xrm_Boolean, "fake-transparency", { .num = &config.fake_transparency }, NULL, "Fake transparency" }, { xrm_Boolean, "fake-transparency", { .num = &config.fake_transparency }, NULL, "Fake transparency" },
{ xrm_SNumber, "dpi", { .snum = &config.dpi }, NULL, "DPI" }, { xrm_SNumber, "dpi", { .snum = &config.dpi }, NULL, "DPI" },
{ xrm_Number, "threads", { .num = &config.threads }, NULL, "Threads to use for string matching" } { xrm_Number, "threads", { .num = &config.threads }, NULL, "Threads to use for string matching" },
{ xrm_Number, "scrollbar-width", { .num = &config.scrollbar_width }, NULL, "Scrollbar width" }
}; };
// Dynamic options. // Dynamic options.