1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-03 04:23:42 -05:00

First calc size then draw handle.

This commit is contained in:
Dave Davenport 2015-09-04 17:58:30 +02:00
parent 1e4721b275
commit 67091fa1a7

View file

@ -766,7 +766,6 @@ static void menu_draw ( MenuState *state )
// Set the position. // Set the position.
scrollbar_set_handle ( state->scrollbar, page * state->max_elements ); scrollbar_set_handle ( state->scrollbar, page * state->max_elements );
} }
scrollbar_draw ( state->scrollbar );
// Re calculate the boxes and sizes, see if we can move this in the menu_calc*rowscolumns // Re calculate the boxes and sizes, see if we can move this in the menu_calc*rowscolumns
// Get number of remaining lines to display. // Get number of remaining lines to display.
unsigned int a_lines = MIN ( ( state->filtered_lines - offset ), state->max_elements ); unsigned int a_lines = MIN ( ( state->filtered_lines - offset ), state->max_elements );
@ -778,6 +777,7 @@ static void menu_draw ( MenuState *state )
// Update the handle length. // Update the handle length.
scrollbar_set_handle_length ( state->scrollbar, columns * state->max_rows ); scrollbar_set_handle_length ( state->scrollbar, columns * state->max_rows );
scrollbar_draw ( state->scrollbar );
// Element width. // Element width.
unsigned int element_width = state->w - ( 2 * ( config.padding ) ); unsigned int element_width = state->w - ( 2 * ( config.padding ) );
if ( columns > 0 ) { if ( columns > 0 ) {