mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
Force all three properties of scrollbar to be in sync
This commit is contained in:
parent
49f58a33f5
commit
74a1d0313a
1 changed files with 3 additions and 2 deletions
|
@ -149,6 +149,9 @@ static void listview_draw ( widget *wid, cairo_t *draw )
|
||||||
else {
|
else {
|
||||||
offset = scroll_per_page ( lv );
|
offset = scroll_per_page ( lv );
|
||||||
}
|
}
|
||||||
|
// Set these all together to make sure they update consistently.
|
||||||
|
scrollbar_set_max_value ( lv->scrollbar, lv->req_elements );
|
||||||
|
scrollbar_set_handle_length ( lv->scrollbar, lv->cur_columns * lv->max_rows );
|
||||||
scrollbar_set_handle ( lv->scrollbar, lv->selected );
|
scrollbar_set_handle ( lv->scrollbar, lv->selected );
|
||||||
lv->last_offset = offset;
|
lv->last_offset = offset;
|
||||||
if ( lv->cur_elements > 0 && lv->max_rows > 0 ) {
|
if ( lv->cur_elements > 0 && lv->max_rows > 0 ) {
|
||||||
|
@ -209,7 +212,6 @@ static void listview_recompute_elements ( listview *lv )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lv->rchanged = TRUE;
|
lv->rchanged = TRUE;
|
||||||
scrollbar_set_handle_length ( lv->scrollbar, lv->cur_columns * lv->max_rows );
|
|
||||||
lv->cur_elements = newne;
|
lv->cur_elements = newne;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +220,6 @@ void listview_set_num_elements ( listview *lv, unsigned int rows )
|
||||||
lv->req_elements = rows;
|
lv->req_elements = rows;
|
||||||
listview_set_selected ( lv, lv->selected );
|
listview_set_selected ( lv, lv->selected );
|
||||||
listview_recompute_elements ( lv );
|
listview_recompute_elements ( lv );
|
||||||
scrollbar_set_max_value ( lv->scrollbar, lv->req_elements );
|
|
||||||
widget_queue_redraw ( WIDGET ( lv ) );
|
widget_queue_redraw ( WIDGET ( lv ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue