Closed jrmoulton closed 8 months ago
The way I listed above isn't a great way to not draw the scrollbox. I haven't used Qt much but it looks like the option should be in the QStyleOptionSlider but I can't find a way to manipulate the drawing of the box. I've tried setting the painter to fill transparent and tried to set the painter pen to have no width but that didn't have any effect on the box.
How could I go about hiding the scrollbox?
What Style and what platform are you on? How does Qt application looks otherwise?
Fluent Style on macOS with Qt 6. Do you know of an option inside of Qt to draw the slider without the box?
I'm a bit confused, because the Fluent style is not having a dark mode like on your screenshot. So i guess this is the native style using Qt, and there might be a bug drawing the scrollbar
Oh your right I got confused. It is the native style. And I don't think this is a bug I'm just trying to add a style option to the native style because it is common on macOS to have a scrollslider but without the scrollbox. So I've found a way to color it differently using the QPainter but I haven't found a way to just hide it.
Hm, now that you mention it - I see the scroll box on macOS, for example in Safari and TextEdit. Where in macOS would it be absent?
Or do you mean transparent overlay scrollbars like on iOS/iPadOS?
Maybe @n-raine has an idea as well?
@lukas-jung kindly helped me "see" - when disconnecting my "real" mouse and just use the touchpad I get overlay scrollbars.
@jrmoulton are you looking for rendering overlay scrollbars basically?
Qt seems to be capable of overlay (transient) scrollbars. But I don't know (yet) how to use QStyle to draw them that way. And we also need to do the logic for showing/hiding ourselves, as well as run a timer for the animation.
@tronical Yep. I didn't know the name of what I was looking for but after a google search it seems like overlay scrollbars are what I was looking for. Another example would be in the mattermost app on macOS it has a scrollslider but no scollbox around that slider.
I'll keep looking and see if I can find how to do that with Qt.
Relates to https://github.com/slint-ui/slint/issues/824 ?
The cupertino style is now the recommended style on mac, and we don't really support the qt style on mac anymore.
Currently Slint has no way to disable the boxes around a scrollbar in a scrollview. It would be nice to have the option to be able to disable them.
with
vs without
I got this workign in Qt but it feels pretty hacky. On this line https://github.com/slint-ui/slint/blob/55fb9c13aaec5a011951b0aa8a9b1d814d2395bb/internal/backends/qt/qt_widgets/scrollview.rs#L356 I initialized QRect with
(0,0,0, r.size().height())
What would be the best way to go about adding this feature? Do similar changes need to be made in all backends?