summaryrefslogtreecommitdiffstats
path: root/lexer/theme-parser.y
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2021-06-15 17:18:34 +0200
committerDave Davenport <qball@blame.services>2021-06-15 17:18:34 +0200
commit4c1a74e15ed3fe35538a00d5351cebfd7ab574af (patch)
treeb96f16aff80f9d40445199987ce3a5f102fa33ce /lexer/theme-parser.y
parentf72bae02bb846af0091ff083e34325314907ea52 (diff)
[Widget] Add scaling option to background-image.
Diffstat (limited to 'lexer/theme-parser.y')
-rw-r--r--lexer/theme-parser.y16
1 files changed, 16 insertions, 0 deletions
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y
index a7031161..729101d9 100644
--- a/lexer/theme-parser.y
+++ b/lexer/theme-parser.y
@@ -210,6 +210,9 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%token T_COL_CMYK "cmyk colorscheme"
%token T_URL "an URL"
+%token T_WIDTH "an WIDTH"
+%token T_HEIGHT "an HEIGHT"
+%token T_BOTH "an BOTH"
%token T_TO "an TO"
%token T_LEFT "an LEFT"
%token T_RIGHT "an RIGHT"
@@ -217,6 +220,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%token T_BOTTOM "an BOTTOM"
%type <ival> t_property_direction
+%type <ival> t_property_scale_type
%token T_LINEAR_GRADIENT "a linear gradient"
%token T_PARENT_LEFT "Parent left ('(')"
@@ -561,6 +565,12 @@ t_property_element
$$->value.image.type = ROFI_IMAGE_URL;
$$->value.image.url = $3;
}
+| T_URL T_PARENT_LEFT T_STRING T_COMMA t_property_scale_type T_PARENT_RIGHT {
+ $$ = rofi_theme_property_create ( P_IMAGE );
+ $$->value.image.type = ROFI_IMAGE_URL;
+ $$->value.image.url = $3;
+ $$->value.image.scaling = $5;
+}
| T_LINEAR_GRADIENT T_PARENT_LEFT t_color_list T_PARENT_RIGHT {
$$ = rofi_theme_property_create ( P_IMAGE );
$$->value.image.type = ROFI_IMAGE_LINEAR_GRADIENT;
@@ -589,6 +599,12 @@ t_property_direction
| T_TOP { $$ = ROFI_DIRECTION_TOP; }
| T_BOTTOM { $$ = ROFI_DIRECTION_BOTTOM; }
;
+t_property_scale_type
+: T_BOTH { $$ = ROFI_SCALE_BOTH; }
+| T_WIDTH { $$ = ROFI_SCALE_WIDTH; }
+| T_HEIGHT { $$ = ROFI_SCALE_HEIGHT; }
+| T_NONE { $$ = ROFI_SCALE_NONE; }
+;
t_color_list
: t_property_color {