mirror of https://github.com/davatorium/rofi.git
[Parser] Set ordering correctly when loading theme with reset.
This commit is contained in:
parent
b96646d9e6
commit
f1272e4af3
|
@ -362,7 +362,6 @@ if ( queue == NULL ) {
|
||||||
BEGIN(INCLUDE);
|
BEGIN(INCLUDE);
|
||||||
}
|
}
|
||||||
<INITIAL>{THEME} {
|
<INITIAL>{THEME} {
|
||||||
//rofi_theme_reset();
|
|
||||||
g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) );
|
g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) );
|
||||||
BEGIN(INCLUDE);
|
BEGIN(INCLUDE);
|
||||||
return T_RESET_THEME;
|
return T_RESET_THEME;
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
%locations
|
%locations
|
||||||
%glr-parser
|
%glr-parser
|
||||||
%skeleton "glr.c"
|
%skeleton "glr.c"
|
||||||
%debug
|
|
||||||
%parse-param {const char *what}
|
%parse-param {const char *what}
|
||||||
%code requires {
|
%code requires {
|
||||||
#include "theme.h"
|
#include "theme.h"
|
||||||
|
@ -267,6 +266,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b )
|
||||||
%token T_MEDIA_SEP "-"
|
%token T_MEDIA_SEP "-"
|
||||||
|
|
||||||
%type <theme> t_entry_list
|
%type <theme> t_entry_list
|
||||||
|
%type <theme> t_entry_list_included
|
||||||
%type <list> t_entry_name_path
|
%type <list> t_entry_name_path
|
||||||
%type <list> t_entry_name_path_selectors
|
%type <list> t_entry_name_path_selectors
|
||||||
%type <list> t_color_list
|
%type <list> t_color_list
|
||||||
|
@ -307,13 +307,12 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b )
|
||||||
* First have the configuration blocks, then the theme.
|
* First have the configuration blocks, then the theme.
|
||||||
*/
|
*/
|
||||||
t_main
|
t_main
|
||||||
: t_configuration_list t_entry_list {
|
: t_configuration_list t_entry_list_included {
|
||||||
// Dummy at this point.
|
// Dummy at this point.
|
||||||
if ( rofi_theme == NULL ) {
|
if ( rofi_theme == NULL ) {
|
||||||
rofi_theme_reset();
|
rofi_theme_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rofi_theme_widget_add_properties ( rofi_theme, $2->properties );
|
rofi_theme_widget_add_properties ( rofi_theme, $2->properties );
|
||||||
for ( unsigned int i = 0; i < $2->num_widgets; i++ ) {
|
for ( unsigned int i = 0; i < $2->num_widgets; i++ ) {
|
||||||
ThemeWidget *d = $2->widgets[i];
|
ThemeWidget *d = $2->widgets[i];
|
||||||
|
@ -340,16 +339,21 @@ t_name_prefix_optional
|
||||||
| %empty {}
|
| %empty {}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
t_entry_list_included:
|
||||||
|
t_entry_list {
|
||||||
|
$$ =$1;
|
||||||
|
}
|
||||||
|
| t_entry_list_included T_RESET_THEME t_entry_list {
|
||||||
|
rofi_theme_reset();
|
||||||
|
rofi_theme_free($1);
|
||||||
|
$$ = $3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
t_entry_list:
|
t_entry_list:
|
||||||
%empty {
|
%empty {
|
||||||
$$ = g_slice_new0 ( ThemeWidget );
|
$$ = g_slice_new0 ( ThemeWidget );
|
||||||
}
|
}
|
||||||
| t_entry_list T_RESET_THEME {
|
|
||||||
rofi_theme_reset();
|
|
||||||
rofi_theme_free($1);
|
|
||||||
$$ = g_slice_new0 ( ThemeWidget );
|
|
||||||
}
|
|
||||||
|
|
||||||
| t_entry_list t_name_prefix_optional t_entry_name_path_selectors T_BOPEN t_property_list_optional T_BCLOSE
|
| t_entry_list t_name_prefix_optional t_entry_name_path_selectors T_BOPEN t_property_list_optional T_BCLOSE
|
||||||
{
|
{
|
||||||
for ( GList *liter = g_list_first ( $3); liter; liter = g_list_next ( liter ) ) {
|
for ( GList *liter = g_list_first ( $3); liter; liter = g_list_next ( liter ) ) {
|
||||||
|
|
Loading…
Reference in New Issue