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

Fully hide song editor scrollbar when not needed #5101

Closed
wants to merge 3 commits into from

Conversation

Spekular
Copy link
Member

Previously, the scrollbar's background area would still be displayed.
To work around this, resize the scrollbar area to 0px when it's not needed.

Spekular added 3 commits July 28, 2019 16:49
Previously, the scrollbar's background area would still be displayed.
To work around this, resize the scrollbar area to 0px when it's not needed.
@BaraMGB
Copy link
Contributor

BaraMGB commented Jul 28, 2019

I found a simpler solution:

setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );

becomes to:
setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
and:
content->setFixedWidth( width()
- m_scrollArea->verticalScrollBar()->width() );

becomes to:
content->setFixedWidth(width());

@Spekular
Copy link
Member Author

setVerticalScrollBarPolicy is set to ScrollBarAsNeeded by default, and I saw no difference by calling m_scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded ) in TrackContainerView::TrackContainerView. But if your version works then that is indeed a whole lot simpler. I guess you tested it @BaraMGB ?

@BaraMGB
Copy link
Contributor

BaraMGB commented Jul 28, 2019

Sorry I reformated the comment above.

@BaraMGB
Copy link
Contributor

BaraMGB commented Jul 28, 2019

Yes I've tested it.

@Spekular
Copy link
Member Author

Spekular commented Jul 28, 2019

Also, I believe there will be a slight visual difference between my solution and always having the full width. The timeline drew above (vertically, not depthwise) the scrollbar when I did that. It doesn't look very buggy though so I suppose that behavior is fine.

Got a build running to test it, no difference.

@BaraMGB
Copy link
Contributor

BaraMGB commented Jul 28, 2019

It looks exactly the same.

@Spekular
Copy link
Member Author

It does indeed.

@Spekular
Copy link
Member Author

Spekular commented Jul 28, 2019

@BaraMGB You may as well commit this yourself, if you don't mind. You can remove this line entirely instead of explicitly setting it to AsNeeded, I just tested:

setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants