diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-12-10 18:34:30 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-12-10 18:34:30 +0100 |
commit | db248ea7659c0eeaaaf46d58fb14bd9522d02223 (patch) | |
tree | f623f52998e2b0d35ed60da85aab57d0c4087580 | |
parent | 2d01d1566af91502dee35a132e6957a1f9e9c939 (diff) | |
parent | 18793612505ebc38da0116176746bff569d52257 (diff) |
Merge remote-tracking branch 'origin/master' into themer
-rw-r--r-- | source/view.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/source/view.c b/source/view.c index feec10da..162f080c 100644 --- a/source/view.c +++ b/source/view.c @@ -1435,8 +1435,29 @@ RofiViewState *rofi_view_create ( Mode *sw, rofi_view_calculate_window_and_element_width ( state ); state->input_bar = box_create ( BOX_HORIZONTAL, 0, 0, state->width - state->border, line_height ); + //box_set_padding ( state->input_bar, config.line_margin ); state->input_bar_separator = separator_create ( S_HORIZONTAL, 2 ); - separator_set_line_style_from_string ( state->input_bar_separator, rofi_theme_get_string ( "separator.input_bar", "style", config.separator_style )); + separator_set_line_style_from_string ( state->input_bar_separator, config.separator_style ); + + + // Only enable widget when sidebar is enabled. + if ( config.sidebar_mode ) { + state->sidebar_bar = box_create ( BOX_HORIZONTAL, 0, 0, state->width - 2 * state->border, line_height ); + box_set_padding ( state->sidebar_bar, rofi_theme_get_integer ( "box.sidebar", "padding",config.line_margin ) ); + separator *sep = separator_create ( S_HORIZONTAL, 2 ); + separator_set_line_style_from_string ( sep, config.separator_style ); + box_add ( state->main_box, WIDGET ( state->sidebar_bar ), FALSE, TRUE ); + box_add ( state->main_box, WIDGET ( sep ), FALSE, TRUE ); + state->num_modi = rofi_get_num_enabled_modi (); + state->modi = g_malloc0 ( state->num_modi * sizeof ( textbox * ) ); + for ( unsigned int j = 0; j < state->num_modi; j++ ) { + const Mode * mode = rofi_get_mode ( j ); + state->modi[j] = textbox_create ( TB_CENTER, 0, 0, 0, 0, ( mode == state->sw ) ? HIGHLIGHT : NORMAL, + mode_get_display_name ( mode ) ); + box_add ( state->sidebar_bar, WIDGET ( state->modi[j] ), TRUE, FALSE ); + widget_set_clicked_handler ( WIDGET ( state->modi[j] ), rofi_view_modi_clicked_cb, state ); + } + } int end = ( config.location == WL_EAST_SOUTH || config.location == WL_SOUTH || config.location == WL_SOUTH_WEST ); box_add ( state->main_box, WIDGET ( state->input_bar ), FALSE, end ); @@ -1486,24 +1507,7 @@ RofiViewState *rofi_view_create ( Mode *sw, box_add ( state->main_box, WIDGET ( state->list_view ), TRUE, FALSE ); - // Only enable widget when sidebar is enabled. - if ( config.sidebar_mode ) { - state->sidebar_bar = box_create ( BOX_HORIZONTAL, 0, 0, state->width - 2 * state->border, line_height ); - box_set_padding ( state->sidebar_bar, rofi_theme_get_integer ( "box.sidebar", "padding",config.line_margin ) ); - separator *sep = separator_create ( S_HORIZONTAL, 2 ); - box_add ( state->main_box, WIDGET ( sep ), FALSE, TRUE ); - separator_set_line_style_from_string ( sep, config.separator_style ); - box_add ( state->main_box, WIDGET ( state->sidebar_bar ), FALSE, TRUE ); - state->num_modi = rofi_get_num_enabled_modi (); - state->modi = g_malloc0 ( state->num_modi * sizeof ( textbox * ) ); - for ( unsigned int j = 0; j < state->num_modi; j++ ) { - const Mode * mode = rofi_get_mode ( j ); - state->modi[j] = textbox_create ( TB_CENTER, 0, 0, 0, 0, ( mode == state->sw ) ? HIGHLIGHT : NORMAL, - mode_get_display_name ( mode ) ); - box_add ( state->sidebar_bar, WIDGET ( state->modi[j] ), TRUE, FALSE ); - widget_set_clicked_handler ( WIDGET ( state->modi[j] ), rofi_view_modi_clicked_cb, state ); - } - } + // Height of a row. if ( config.menu_lines == 0 || config.fullscreen ) { |