Skip to content

Commit

Permalink
[Config] Allow configuration block again in theme.
Browse files Browse the repository at this point in the history
Avoid confusion/breakage.
  • Loading branch information
DaveDavenport committed Nov 30, 2021
1 parent 92dae73 commit 9b219af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
29 changes: 13 additions & 16 deletions lexer/theme-parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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
{
Expand Down

0 comments on commit 9b219af

Please sign in to comment.