summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-11-06 20:49:26 +0100
committerDave Davenport <qball@gmpclient.org>2017-11-06 20:49:26 +0100
commitd9def879309d3e38b73742d4decff085e447b8f2 (patch)
tree186e6c2275eb30d2e7475b20f995fbba8a89bce3
parente689f2d98b21e72eeeea81cb0ac0a31d11faea45 (diff)
Allow height to be specified on window.
Fixes: #718
-rw-r--r--source/view.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/view.c b/source/view.c
index be5768bc..f1d6ea07 100644
--- a/source/view.c
+++ b/source/view.c
@@ -1457,15 +1457,19 @@ void rofi_view_frame_callback ( void )
static int rofi_view_calculate_height ( RofiViewState *state )
{
- unsigned int height = 0;
if ( CacheState.fullscreen == TRUE ) {
- height = CacheState.mon.h;
- return height;
+ return CacheState.mon.h;
}
+ RofiDistance h = rofi_theme_get_distance ( WIDGET ( state->main_window ), "height", 0 );
+ unsigned int height = distance_get_pixel ( h, ROFI_ORIENTATION_VERTICAL );
+ // If height is set, return it.
+ if ( height > 0 ) {
+ return height;
+ }
+ // Autosize based on widgets.
widget *main_window = WIDGET ( state->main_window );
- height = widget_get_desired_height ( main_window );
- return height;
+ return widget_get_desired_height ( main_window );
}
static WidgetTriggerActionResult textbox_sidebar_modi_trigger_action ( widget *wid, MouseBindingMouseDefaultAction action, G_GNUC_UNUSED gint x, G_GNUC_UNUSED gint y, G_GNUC_UNUSED void *user_data )