1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-02-10 15:44:41 -05:00

Listview: hide widget when no row is visible and dynamic is enabled.

This commit is contained in:
Dave Davenport 2017-01-06 13:42:00 +01:00
parent 0e037237f8
commit 52f4f32d89
2 changed files with 4 additions and 7 deletions

View file

@ -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 );

View file

@ -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) );