diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-01-06 17:21:16 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-01-06 17:21:21 +0100 |
commit | 8bc1831d172d17981449964e7f276096d94b28f1 (patch) | |
tree | 6ade3d575fc24dc7445a0a37815cda22151456e0 /source | |
parent | 9aaf21cd856d742f4fdbaa68aaad52e6d55b5778 (diff) |
Allow window width to be set in theme
Diffstat (limited to 'source')
-rw-r--r-- | source/view.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/view.c b/source/view.c index 75c6a03d..46c17637 100644 --- a/source/view.c +++ b/source/view.c @@ -674,8 +674,9 @@ static void rofi_view_calculate_window_width ( RofiViewState *state ) { if ( config.fullscreen ) { state->width = CacheState.mon.w; + return; } - else if ( config.menu_width < 0 ) { + if ( config.menu_width < 0 ) { double fw = textbox_get_estimated_char_width ( ); state->width = -( fw * config.menu_width ); state->width += widget_padding_get_padding_width ( WIDGET ( state->main_window ) ); @@ -684,6 +685,9 @@ static void rofi_view_calculate_window_width ( RofiViewState *state ) // Calculate as float to stop silly, big rounding down errors. state->width = config.menu_width < 101 ? ( CacheState.mon.w / 100.0f ) * ( float ) config.menu_width : config.menu_width; } + // Use theme configured width, if set. + Distance width = rofi_theme_get_distance ( WIDGET ( state->main_window ), "width", state->width ); + state->width = distance_get_pixel ( width, ORIENTATION_HORIZONTAL ); } /** |