diff options
author | Dave Davenport <qball@blame.services> | 2021-06-14 16:04:15 +0200 |
---|---|---|
committer | Dave Davenport <qball@blame.services> | 2021-06-14 16:04:15 +0200 |
commit | 828aaa231a84f9ad23cf836a71b58290b5e217e8 (patch) | |
tree | ea06ac8d677f59a36a162ae4ecf2bd605cc39296 /source | |
parent | 5c5428bd11b87a336174398194062f7d3901daf6 (diff) |
[Theme] Add angle support to linear-gradient.
Diffstat (limited to 'source')
-rw-r--r-- | source/theme.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/theme.c b/source/theme.c index 219daf4f..f70f0c45 100644 --- a/source/theme.c +++ b/source/theme.c @@ -1015,6 +1015,15 @@ gboolean rofi_theme_get_image ( const widget *widget, const char *property, cair case ROFI_DIRECTION_TOP: pat = cairo_pattern_create_linear (0.0,widget->h, 0.0, 0.0); break; + case ROFI_DIRECTION_ANGLE: + { + double offsety1 = sin(G_PI*2*p->value.image.angle)*(widget->h/2.0); + double offsetx1 = cos(G_PI*2*p->value.image.angle)*(widget->w/2.0); + pat = cairo_pattern_create_linear ( + widget->w/2.0 - offsetx1, widget->h/2.0 - offsety1, + widget->w/2.0 + offsetx1, widget->h/2.0 + offsety1 ); + break; + } }; guint length = g_list_length ( p->value.image.colors ); if ( length > 1 ){ |