Open Crylia opened 1 year ago
handle_shape = function(cr, width, height) gshape.partially_rounded_rect(cr, width, dpi(5) --[[ here ]] , false, true, true, false) end,
This is not how you use shape. You only clipped what is drawn and the handle is still there in its full size, you didn't magically changed its height.
You mentioned wibox.container.constraint
. I'm also having trouble getting it to work, I almost think there must be some bugs or the doc is not clear and I'm missing something.
However you can use other layouts. I tried wibox.layout.align
and it works:
{
widget = wibox.layout.align.vertical,
expand = "outside",
nil,
{
bar_shape = function(cr, width, height)
gshape.rounded_rect(cr, width, height, dpi(5))
end,
bar_height = dpi(5),
bar_color = "#000044",
bar_active_color = "#0000cc",
handle_color = "#cc0000",
handle_shape = function(cr, width, height)
gshape.partially_rounded_rect(cr, width, height, false, true, true, false)
end,
handle_border_color = "#00cc00",
handle_width = dpi(5),
handle_cursor = 'left_ptr',
maximum = 100,
forced_height = dpi(5),
value = 50,
widget = wibox.widget.slider,
},
nil,
}
Edit: I just noticed this is not the best solution as it kind of hard to grab the slider.
Output of
awesome --version
:awesome v4.3-1581-gc8016f0c (Too long)
How to reproduce the issue:
When I create a slider with the code above the handle is placed above the slider.
The problem "goes away" when I just use the provided height but then I can't limit the height.
I can see this getting fixed in two ways, maybe both would be good.
It looks like the widget uses all its *available space for the shape, even when wrapping the slider in a
wibox.container.constraint
or usingforced_height = dpi(5)
*The space that the entire widget and its partent(a constraint with
height = dpi(5)
andstrategy = 'exact'
) have in this layout