mirror of https://github.com/davatorium/rofi.git
[Theme] Make 'sidebar' settable by theme.
Now it needs a configuration option to enable, this should be just part of the theme now. Sidebar is the "sidebar" widget. If not set by theme, old behaviour is still followed.
This commit is contained in:
parent
ee0d3d828e
commit
2728e4ad23
|
@ -503,10 +503,8 @@ void rofi_view_free ( RofiViewState *state )
|
|||
g_free ( state->distance );
|
||||
// Free the switcher boxes.
|
||||
// When state is free'ed we should no longer need these.
|
||||
if ( config.sidebar_mode == TRUE ) {
|
||||
g_free ( state->modi );
|
||||
state->num_modi = 0;
|
||||
}
|
||||
g_free ( state );
|
||||
}
|
||||
|
||||
|
@ -1557,7 +1555,11 @@ static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget,
|
|||
if ( strcmp ( name, "mainbox" ) == 0 ) {
|
||||
wid = (widget *) box_create ( parent_widget, name, ROFI_ORIENTATION_VERTICAL );
|
||||
box_add ( (box *) parent_widget, WIDGET ( wid ), TRUE );
|
||||
if ( config.sidebar_mode ) {
|
||||
defaults = "inputbar,message,listview,sidebar";
|
||||
} else {
|
||||
defaults = "inputbar,message,listview";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* INPUTBAR
|
||||
|
@ -1649,7 +1651,6 @@ static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget,
|
|||
g_error ( "Sidebar widget can only be added once to the layout." );
|
||||
return;
|
||||
}
|
||||
if ( config.sidebar_mode ) {
|
||||
state->sidebar_bar = box_create ( parent_widget, name, ROFI_ORIENTATION_HORIZONTAL );
|
||||
box_add ( (box *) parent_widget, WIDGET ( state->sidebar_bar ), FALSE );
|
||||
state->num_modi = rofi_get_num_enabled_modi ();
|
||||
|
@ -1662,7 +1663,6 @@ static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget,
|
|||
widget_set_trigger_action_handler ( WIDGET ( state->modi[j] ), textbox_sidebar_modi_trigger_action, state );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( g_ascii_strncasecmp ( name, "textbox", 7 ) == 0 ) {
|
||||
textbox *t = textbox_create ( parent_widget, WIDGET_TYPE_TEXTBOX_TEXT, name, TB_AUTOHEIGHT | TB_WRAP, NORMAL, "", 0, 0 );
|
||||
box_add ( (box *) parent_widget, WIDGET ( t ), TRUE );
|
||||
|
@ -1922,7 +1922,7 @@ void rofi_view_switch_mode ( RofiViewState *state, Mode *mode )
|
|||
if ( state->prompt ) {
|
||||
rofi_view_update_prompt ( state );
|
||||
}
|
||||
if ( config.sidebar_mode && state->sidebar_bar ) {
|
||||
if ( state->sidebar_bar ) {
|
||||
for ( unsigned int j = 0; j < state->num_modi; j++ ) {
|
||||
const Mode * mode = rofi_get_mode ( j );
|
||||
textbox_font ( state->modi[j], ( mode == state->sw ) ? HIGHLIGHT : NORMAL );
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
color: @magenta;
|
||||
background-color: @transparent;
|
||||
spacing: 0;
|
||||
children: [vertb, mainbox];
|
||||
children: [mainbox];
|
||||
orientation: horizontal;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue