From 80d148707a06cfba74b25cf7e5a216cd87742317 Mon Sep 17 00:00:00 2001 From: QC Date: Sun, 6 Sep 2015 10:12:09 +0200 Subject: [PATCH] Don't overlay sb on textboxes. --- source/rofi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/rofi.c b/source/rofi.c index 6908137a..82bebc9e 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -780,6 +780,9 @@ static void menu_draw ( MenuState *state ) scrollbar_draw ( state->scrollbar ); // Element width. unsigned int element_width = state->w - ( 2 * ( config.padding ) ); + if ( state->scrollbar != NULL ) { + element_width -= state->scrollbar->w; + } if ( columns > 0 ) { element_width = ( element_width - ( columns - 1 ) * config.line_margin ) / columns; } @@ -1023,10 +1026,11 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom state.element_width, element_height, NORMAL, "" ); } if ( !config.hide_scrollbar ) { + unsigned int sbw = config.line_margin + 8; state.scrollbar = scrollbar_create ( main_window, &vinfo, map, - state.w - config.padding - config.line_margin - 8, + state.w - config.padding - sbw, state.top_offset, - config.line_margin + 8, + sbw, ( state.max_rows - 1 ) * ( element_height + config.line_margin ) + element_height ); }