mirror of
https://github.com/davatorium/rofi.git
synced 2025-07-31 21:59:25 -04:00
Return to default border when nothing set after state update
This commit is contained in:
parent
8f4a4d51c6
commit
2fe22cb7e2
2 changed files with 10 additions and 7 deletions
|
@ -16,6 +16,9 @@ struct _widget
|
||||||
/** Height of the widget */
|
/** Height of the widget */
|
||||||
short h;
|
short h;
|
||||||
/** Padding */
|
/** Padding */
|
||||||
|
Padding def_margin;
|
||||||
|
Padding def_padding;
|
||||||
|
Padding def_border;
|
||||||
Padding margin;
|
Padding margin;
|
||||||
Padding padding;
|
Padding padding;
|
||||||
Padding border;
|
Padding border;
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
void widget_init ( widget *widget, const char *name )
|
void widget_init ( widget *widget, const char *name )
|
||||||
{
|
{
|
||||||
widget->name = g_strdup ( name );
|
widget->name = g_strdup ( name );
|
||||||
widget->padding = (Padding){ { WIDGET_DEFAULT_PADDING, PW_PX, SOLID }, { WIDGET_DEFAULT_PADDING, PW_PX, SOLID }, { WIDGET_DEFAULT_PADDING, PW_PX, SOLID }, { WIDGET_DEFAULT_PADDING, PW_PX, SOLID } };
|
widget->def_padding = (Padding){ { WIDGET_DEFAULT_PADDING, PW_PX, SOLID }, { WIDGET_DEFAULT_PADDING, PW_PX, SOLID }, { WIDGET_DEFAULT_PADDING, PW_PX, SOLID }, { WIDGET_DEFAULT_PADDING, PW_PX, SOLID } };
|
||||||
widget->border = (Padding){ { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID } };
|
widget->def_border = (Padding){ { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID } };
|
||||||
widget->margin = (Padding){ { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID } };
|
widget->def_margin = (Padding){ { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID }, { 0, PW_PX, SOLID } };
|
||||||
|
|
||||||
widget->padding = rofi_theme_get_padding ( widget, "padding", widget->padding );
|
widget->padding = rofi_theme_get_padding ( widget, "padding", widget->def_padding );
|
||||||
widget->border = rofi_theme_get_padding ( widget, "border", widget->border );
|
widget->border = rofi_theme_get_padding ( widget, "border", widget->def_border );
|
||||||
widget->margin = rofi_theme_get_padding ( widget, "margin", widget->margin );
|
widget->margin = rofi_theme_get_padding ( widget, "margin", widget->def_margin );
|
||||||
}
|
}
|
||||||
|
|
||||||
void widget_set_state ( widget *widget, const char *state )
|
void widget_set_state ( widget *widget, const char *state )
|
||||||
|
@ -23,7 +23,7 @@ void widget_set_state ( widget *widget, const char *state )
|
||||||
if ( g_strcmp0 ( widget->state, state ) ) {
|
if ( g_strcmp0 ( widget->state, state ) ) {
|
||||||
widget->state = state;
|
widget->state = state;
|
||||||
// Update border.
|
// Update border.
|
||||||
widget->border = rofi_theme_get_padding ( widget, "border", widget->border );
|
widget->border = rofi_theme_get_padding ( widget, "border", widget->def_border );
|
||||||
|
|
||||||
widget_queue_redraw ( widget );
|
widget_queue_redraw ( widget );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue