-
Notifications
You must be signed in to change notification settings - Fork 275
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
Improve dock layout for lower resolution #1840
Conversation
b7a3d9f
to
915c29a
Compare
Would you be able to change the margins of the flowlayout in the toolbox as well?
|
915c29a
to
8e12fc4
Compare
yea, title bar is to blame. |
83c7a60
to
f8edeff
Compare
f8edeff
to
d336801
Compare
Hmm not sure what's up but the font looks larger on some of the widgets on my windows machine. https://forum.qt.io/topic/125993/font-point-size-weird-behaviour-on-windows I found this and some other threads mentioning similar problems... what a can of worms. Sure we could just go back to the old font but seriously... Qt, you had one job. |
The overall direction of this PR looks fine to me, but there’s something weird going on with the font size. On Windows, it looks practically unchanged except for the title bars, whereas on Linux the text is painfully tiny for me, much smaller than the default font size (note the status bar for comparison): Also, on Qt 6, I now get a new warning in the console:
And lastly, your most recent commit seems to have broken the colour inspector preview somehow, it now defaults to the standard widget background on startup. Not sure what exactly is going on there… |
Thanks for testing it out. 👍
I've reverted the font change again.
I'll fix that. |
“Scaling the font with some arbitrary number” is pretty standard on the web and generally recommended for accessibility, I’m not sure what’s the problem with it. E.g. the main font size on our forum is 0.938em, and I haven’t changed it. If you have something else in mind, sure. But please consider taking the system default as a base in one way or another since we mainly use native styling. |
- Font size: 11 - Minimum width: 140 px or less - Padding adjusted to be 3 px. The size has to be set specifically, otherwise the designer will adjust to what it thinks is best.
The reason is that we add the margins to the outer layout instead of inside the scroll area.
instead use qstylesheet and it might work better.
c8b51ab
to
30df82d
Compare
Alright fair enough, I'm used to mobile development where it's not like this but if that's how it's done, then we'll do it like that.
This was caused by a style override which has been reverted. Would you mind reviewing again @J5lx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still get the warning that I mentioned above. Other than that it looks good to me though.
Hmm strange, it's not something i'm seeing in my build anymore. Also, is this with the default layout or have you moved the docks around? |
I’m on 6.7.2 and seeing that warning with the default layout although, upon closer inspection, only some of the time. I did some debugging and I found there’s at least two issues at play here. The first one is only indirectly related to the warning, but could very well be the reason why you’re not seeing it. That’s because at its very end, initUI calls getMinHeightForWidth which reads mDockArea. However, mDockArea is only written in the dockLocationChanged signal handler which was only connected earlier in initUI. Therefore the mDockArea value is uninitialized at that time and reading it in getMinHeightForWidth results in undefined behaviour – sometimes the if branch executes, other times the “else branch”. Only in the latter case does the second issue occur which is what actually causes the warning. That’s because at this point in time, BaseDockWidget::getMinHeightForWidth always returns -1, which is then directly passed directly into setMinimumHeight in initUI, resulting in the warning “QWidget::setMinimumSize: (scrollArea/QScrollArea) Negative sizes (0,-1) are not possible”. |
Initially we'll also set a default dock value but as soon as the dock is added, it will be updated with the new dock location.
Ah... good point regarding I've made a few changes, though i'm unsure about whether we should simply change -1 to 1 in BaseDockWidget rather than me simply not calling the base class at all, if it always gives a warning. What do you think? |
Since you brought up BaseDockWidget, I had a closer look at it and realised that the entire min height handling in there is actually entirely Toolbox-specific and it can be simplified a bit by consolidating that in Toolbox itself. Please take a look: MrStevns#23 |
Consolidate BaseDockWidget/Toolbox minimum size handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With that taken care of, everything looks good to me now. Feel free to merge if you’re happy with it as well.
Thanks Jakob! 🙏 |
A follow up PR from #1824
I've adjusted the margin as well as the min width for all the dock widgets so they are aligned.
In addition the font has also been adjusted from 13 pt to 11 pt.
The result looks like this:
Front: new layout
Back: old layout
The widgets that had the greatest impact adjusting this was the tool options widget as well as the onion skin widget.
Side by side:
Adjusting the font also helped quite a bit.
I've also added extra QLayout around certain elements, which is not a mistake. Doing so fixes some problems where Qt added extra margins around checkboxes and labels.