0

I noticed that when setting a color pattern the coordinates seem relative to the widget. I'm trying to set a color pattern for the handle of a slider (the red ball in the screenshots).

I want the gradient to be relative to the position of the handle but it appears to be relative to the slider.

The current result is that the gradient is only visible when the handler scrolls past it, here are some screenshots that hopefully clarify this.

enter image description here

enter image description here

Is there any way I can set the gradient to move along with the handle?

I'm setting the gradient using the theme:

theme.slider_handle_color = gears.color.create_pattern({
    type='radial',
    from={180, 7, 3},
    to={180, 7, 25},
    stops={
        {0, '#ffffff'},
        {0.5, '#aa0000'}
    }
})
siebz0r
  • 18,867
  • 14
  • 64
  • 107
  • Do ugly hacks count as a solution? You could connect to the widget's property::value signal and set a new handle color (but only if you actually know the size of the widget...). – Uli Schlachter Nov 09 '17 at 10:51
  • @UliSchlachter oh wow, that's a.. creative solution. I do think it would introduce a small graphic delay, possibly not being noticeable all the time. I do hope there is a more straight forward solution as I would like to apply it to multiple elements, like progress bars and graphs. – siebz0r Nov 10 '17 at 09:04

0 Answers0