summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-01-06 13:42:00 +0100
committerDave Davenport <qball@gmpclient.org>2017-01-06 13:42:00 +0100
commit52f4f32d89396e29890acaa50cc87dbd79ffae42 (patch)
treec8beabf387a5138fc34cd67d337054d535a3b7eb /source
parent0e037237f88ac6a60fd7d1ae5549e82952292755 (diff)
Listview: hide widget when no row is visible and dynamic is enabled.
Diffstat (limited to 'source')
-rw-r--r--source/view.c7
-rw-r--r--source/widgets/listview.c4
2 files changed, 4 insertions, 7 deletions
diff --git a/source/view.c b/source/view.c
index 77db45eb..dcec9c70 100644
--- a/source/view.c
+++ b/source/view.c
@@ -1381,13 +1381,6 @@ static int rofi_view_calculate_height ( RofiViewState *state )
height = CacheState.mon.h;
return height;
}
- if ( state->filtered_lines == 0 && !config.fixed_num_lines ) {
- widget_disable ( WIDGET ( state->list_view) );
- }
- else {
- widget_enable ( WIDGET ( state->list_view) );
- }
-
widget *main_window = WIDGET ( state->main_window );
height = widget_get_desired_height ( main_window );
diff --git a/source/widgets/listview.c b/source/widgets/listview.c
index 83c0872e..1c4365dc 100644
--- a/source/widgets/listview.c
+++ b/source/widgets/listview.c
@@ -523,6 +523,10 @@ static int listview_get_desired_height ( widget *wid )
}
}
if ( h == 0 ) {
+ if ( lv->dynamic && !lv->fixed_num_lines ){
+ // Hide widget fully.
+ return 0;
+ }
return widget_padding_get_padding_height ( WIDGET (lv) );
}
int height = widget_padding_get_padding_height ( WIDGET (lv) );