diff options
author | Dave Davenport <qball@blame.services> | 2021-11-30 18:52:37 +0100 |
---|---|---|
committer | Dave Davenport <qball@blame.services> | 2021-11-30 18:52:37 +0100 |
commit | 9b219afc5b029a9bcd246b01a0c9030823722901 (patch) | |
tree | 61b0d9d868cd23bc14bca2d45e16f52e8bcb893d | |
parent | 92dae73bc11b2538b874ffb820c159ab97f42599 (diff) |
[Config] Allow configuration block again in theme.
Avoid confusion/breakage.
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | lexer/theme-parser.y | 29 |
2 files changed, 14 insertions, 16 deletions
@@ -2,6 +2,7 @@ v1.7.2: - [Build] Fix building without window mode enabled. - [Config] Do not print out the 'theme' field in configuration on dump. - [CI] test window mode less build. + - Allow configuration block in theme again. v1.7.1: Turtley amazing! - [Theme] Fix highlight with only theme. diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 3a2db9e8..d149f05b 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -313,31 +313,21 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b ) * First have the configuration blocks, then the theme. */ t_main -: t_configuration_list t_entry_list_included { +: t_entry_list_included { // Dummy at this point. if ( rofi_theme == NULL ) { rofi_theme_reset(); } - rofi_theme_widget_add_properties ( rofi_theme, $2->properties ); - for ( unsigned int i = 0; i < $2->num_widgets; i++ ) { - ThemeWidget *d = $2->widgets[i]; + rofi_theme_widget_add_properties ( rofi_theme, $1->properties ); + for ( unsigned int i = 0; i < $1->num_widgets; i++ ) { + ThemeWidget *d = $1->widgets[i]; rofi_theme_parse_merge_widgets(rofi_theme, d); } - rofi_theme_free ( $2 ); + rofi_theme_free ( $1 ); } ; -t_configuration_list: - %empty { - if ( rofi_configuration == NULL ) { - rofi_configuration = g_slice_new0 ( ThemeWidget ); - rofi_configuration->name = g_strdup ( "Root" ); - } -} -| t_configuration_list T_CONFIGURATION T_BOPEN t_config_property_list_optional T_BCLOSE {}; - - /** * Small dummy object to make the prefix optional. */ @@ -359,8 +349,15 @@ t_entry_list { t_entry_list: - %empty { +t_entry_list T_CONFIGURATION T_BOPEN t_config_property_list_optional T_BCLOSE { + $$ = $1; +} +|%empty { $$ = g_slice_new0 ( ThemeWidget ); + if ( rofi_configuration == NULL ) { + rofi_configuration = g_slice_new0 ( ThemeWidget ); + rofi_configuration->name = g_strdup ( "Root" ); + } } | t_entry_list t_name_prefix_optional t_entry_name_path_selectors T_BOPEN t_property_list_optional T_BCLOSE { |