Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to disable the scrollbox containing the scrollbar #988

Closed
jrmoulton opened this issue Feb 26, 2022 · 11 comments
Closed

Add an option to disable the scrollbox containing the scrollbar #988

jrmoulton opened this issue Feb 26, 2022 · 11 comments
Labels
a:backend-qt The Qt backend - including the qt style (mO,bS) a:platform-macos Issues specific to macOS (mS,bF)

Comments

@jrmoulton
Copy link
Contributor

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
Screen Shot 2022-02-25 at 5 49 19 PM

vs without
Screen Shot 2022-02-25 at 5 49 32 PM

I got this workign in Qt but it feels pretty hacky. On this line

option.rect = QRect(QPoint(), r.size());

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?

@jrmoulton
Copy link
Contributor Author

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?

@ogoffart
Copy link
Member

ogoffart commented Mar 1, 2022

What Style and what platform are you on?
How does Qt application looks otherwise?

@jrmoulton
Copy link
Contributor Author

Fluent Style on macOS with Qt 6.
Do you know of an option inside of Qt to draw the slider without the box?

@ogoffart ogoffart added the a:platform-macos Issues specific to macOS (mS,bF) label Mar 2, 2022
@ogoffart
Copy link
Member

ogoffart commented Mar 2, 2022

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

@jrmoulton
Copy link
Contributor Author

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.

@tronical
Copy link
Member

tronical commented Mar 3, 2022

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?

@tronical
Copy link
Member

tronical commented Mar 3, 2022

@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?

@tronical
Copy link
Member

tronical commented Mar 3, 2022

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.

@jrmoulton
Copy link
Contributor Author

@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.
Screen Shot 2022-03-03 at 4 35 03 PM

I'll keep looking and see if I can find how to do that with Qt.

@ogoffart ogoffart added the a:backend-qt The Qt backend - including the qt style (mO,bS) label Oct 26, 2022
@ogoffart
Copy link
Member

Relates to #824 ?

@ogoffart
Copy link
Member

The cupertino style is now the recommended style on mac, and we don't really support the qt style on mac anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:backend-qt The Qt backend - including the qt style (mO,bS) a:platform-macos Issues specific to macOS (mS,bF)
Projects
None yet
Development

No branches or pull requests

3 participants