summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-12-13 00:09:51 +0100
committerDave Davenport <qball@gmpclient.org>2016-12-13 00:09:51 +0100
commit38035568f375c701d49658adbe9c7d632d584b31 (patch)
tree61462ff62f804fe4744c2aaf66d0f62fa78fe6b1
parentfd64bb7a41bf72ad19df772a2cae336ded484b87 (diff)
Fix separator class and tweak parser inheritance.
-rw-r--r--lexer/theme-parser.y2
-rw-r--r--source/theme.c15
-rw-r--r--source/widgets/separator.c2
3 files changed, 18 insertions, 1 deletions
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y
index 468691ac..94a3691c 100644
--- a/lexer/theme-parser.y
+++ b/lexer/theme-parser.y
@@ -89,6 +89,7 @@ CLASS_PREFIX class_name state_path BOPEN optional_properties BCLOSE
gchar *classn = g_strconcat ( "@", $2, NULL);
Widget *widget = rofi_theme_find_or_create_class ( rofi_theme , classn );
g_free(classn);
+ widget->set = TRUE;
for ( GList *iter = g_list_first ( $3 ); iter ; iter = g_list_next ( iter ) ) {
widget = rofi_theme_find_or_create_class ( widget, iter->data );
}
@@ -109,6 +110,7 @@ CLASS_PREFIX class_name state_path BOPEN optional_properties BCLOSE
}
g_list_foreach ( $2, (GFunc)g_free , NULL );
g_list_free ( $2 );
+ widget->set = TRUE;
for ( GList *iter = g_list_first ( $3 ); iter ; iter = g_list_next ( iter ) ) {
widget = rofi_theme_find_or_create_class ( widget, iter->data );
}
diff --git a/source/theme.c b/source/theme.c
index e15016a8..3f11edf8 100644
--- a/source/theme.c
+++ b/source/theme.c
@@ -177,6 +177,9 @@ int rofi_theme_get_integer ( const char *wclass, const char *name, const char *
return def;
}
Widget *widget = rofi_theme_find ( rofi_theme, name );
+ if ( widget != rofi_theme ){
+ widget = rofi_theme_find ( widget, state );
+ }
if ( widget == rofi_theme || widget->set == FALSE ){
// Fall back to class
widget = rofi_theme_find ( rofi_theme, wclass);
@@ -195,6 +198,9 @@ int rofi_theme_get_boolean ( const char *wclass, const char *name, const char *
return def;
}
Widget *widget = rofi_theme_find ( rofi_theme, name );
+ if ( widget != rofi_theme ){
+ widget = rofi_theme_find ( widget, state );
+ }
if ( widget == rofi_theme || widget->set == FALSE ){
// Fall back to class
widget = rofi_theme_find ( rofi_theme, wclass);
@@ -213,6 +219,9 @@ char *rofi_theme_get_string ( const char *wclass, const char *name, const char
return def;
}
Widget *widget = rofi_theme_find ( rofi_theme, name );
+ if ( widget != rofi_theme ){
+ widget = rofi_theme_find ( widget, state );
+ }
if ( widget == rofi_theme || widget->set == FALSE ){
// Fall back to class
widget = rofi_theme_find ( rofi_theme, wclass);
@@ -230,6 +239,9 @@ double rofi_theme_get_double ( const char *wclass, const char *name, const char
return def;
}
Widget *widget = rofi_theme_find ( rofi_theme, name );
+ if ( widget != rofi_theme ){
+ widget = rofi_theme_find ( widget, state );
+ }
if ( widget == rofi_theme || widget->set == FALSE ){
// Fall back to class
widget = rofi_theme_find ( rofi_theme, wclass);
@@ -247,6 +259,9 @@ void rofi_theme_get_color ( const char *wclass, const char *name, const char *s
return ;
}
Widget *widget = rofi_theme_find ( rofi_theme, name );
+ if ( widget != rofi_theme ){
+ widget = rofi_theme_find ( widget, state );
+ }
if ( widget == rofi_theme || widget->set == FALSE ){
// Fall back to class
widget = rofi_theme_find ( rofi_theme, wclass);
diff --git a/source/widgets/separator.c b/source/widgets/separator.c
index 295ba95f..c04cecec 100644
--- a/source/widgets/separator.c
+++ b/source/widgets/separator.c
@@ -88,7 +88,7 @@ separator *separator_create ( const char *name, separator_type type, short sw )
// Enabled by default
sb->widget.enabled = TRUE;
- const char *line_style = rofi_theme_get_string ( "@scrollbar", sb->widget.name, NULL, "line-style", "solid");
+ const char *line_style = rofi_theme_get_string ( "@separator", sb->widget.name, NULL, "line-style", "solid");
separator_set_line_style_from_string ( sb, line_style );
return sb;
}