summaryrefslogtreecommitdiffstats
path: root/source/widgets
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2020-01-01 15:44:01 +0100
committerDave Davenport <qball@gmpclient.org>2020-01-01 15:44:01 +0100
commit7650ed5d7a8ea2d8b048691183f7f0ef5d8b2513 (patch)
tree5594e9bd581c51408e1b3f986f160c9058188667 /source/widgets
parentb03edc5cf3b3adb3b1ecdd2cbc9cea66a5706249 (diff)
[Listview] Small fix when distributing remaining space whith scrollbar.
Diffstat (limited to 'source/widgets')
-rw-r--r--source/widgets/listview.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/widgets/listview.c b/source/widgets/listview.c
index d1667da8..1bd6289d 100644
--- a/source/widgets/listview.c
+++ b/source/widgets/listview.c
@@ -420,13 +420,13 @@ static void listview_draw ( widget *wid, cairo_t *draw )
// Set new x/y position.
unsigned int max = MIN ( lv->cur_elements, lv->req_elements - offset );
if ( lv->rchanged ) {
- unsigned int width = lv->widget.w - spacing_hori * ( lv->cur_columns - 1 );
+ unsigned int width = lv->widget.w;
width -= widget_padding_get_padding_width ( wid );
if ( widget_enabled ( WIDGET ( lv->scrollbar ) ) ) {
width -= spacing_hori;
width -= widget_get_width ( WIDGET ( lv->scrollbar ) );
}
- unsigned int element_width = ( width ) / lv->cur_columns;
+ unsigned int element_width = ( width - spacing_hori * ( lv->cur_columns - 1 )) / lv->cur_columns;
int d = width - (element_width+spacing_hori)*(lv->cur_columns-1)-element_width;
if ( lv->cur_columns > 1)