-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
HiDPI Skin Scaling #1204
HiDPI Skin Scaling #1204
Conversation
Modifies legacyskinparser.cpp to double the scale of all widgets, following tips found here: http://mixxx.org/forums/viewtopic.php?f=8&t=7098&sid=0f5a2a95eb716ebcd9664dbd76623620#p24281
Introduce a new Interface config option that doubles the expected sizes of all widgets. NOTE: this only renders properly if the widget graphics (PNG files) are actually 2x the expected size. However, it is not loading the "@2x" files properly, so this is not working yet.
@devananda: I have removed the upscaled @2x versions, because the on-the-fly generated version are quite similar. To improve the @2x quality some @2x images with removed aliasing would be nice. |
@@ -489,6 +489,23 @@ | |||
</property> | |||
</widget> | |||
</item> | |||
<item row="12" column="1" colspan="2"> | |||
<widget class="QCheckBox" name="checkBoxDoubleWidgetSize"> |
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.
Maybe this should be a QDoubleSpinBox?
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.
For now this is a checkbox by design, because we "only" have the request for double the size.
And I want to avoid to have to much degrees of freedom for now.
If you thing it is useful to allow free scaling, we can consider to go for it. Today almost all is calculated on pixel base so that 1x and 2x works nice and fractional scaling is kind of blurry.
It now supports @2x suffix to avoid this issue.
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 know other ratios are common on smartphone screens, but Mixxx does not run on those. I am not sure about laptops.
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.
The desired scale factor may vary depending on screen resolution, physical screen size, and personal taste, so I think it would be good to make it more flexible.
Build error with gcc-6.3.1-1.fc25.x86_64:
|
I tried this on my 1366 x 768 laptop screen and it seems to work as advertised. Setting ScaleFactor to 2.0 made the GUI very laggy for me. I'm guessing that's because of my old integrated GPU, so I'm guessing it wouldn't be an issue on a newer computer that has a screen resolution high enough to need this feature. Scaling down to 0.5 did not make the GUI lag. Thanks for taking up this bug! |
Unfortunately the QDoubleSpinBox subclass introduced in #1187 suffers the same problem. :/ |
I noticed this too on GNU/Linux (X11).
SGTM
I don't think we should have skins that only work on HiDPI displays. |
Why not, doesn't have to be the default... |
I think I have discovered the rule: The style @2x hack could be used to tweak for example margin and the combobox handle. There is still an issue with the Track table header. It seams that this is a pixel size font, because it is not OS scaled. Do you know where it is define? This has to be a point size font. We can also enable the Auto feature for Windows by query the widget DPI. |
In Deere: https://github.com/mixxxdj/mixxx/blob/master/res/skins/Deere/style.qss#L178 |
Ups .. that easy :-) Thank you! |
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.
Originally, we had all font sizes given in pt, but switched to px sizes. I can not remember the details, but there was possible a cross-platform issue.
So we need to test if this change does not have unwanted consequences.
Edit: Found 98eec1e
It's not just the table headers; it's also the text in the table cells that is not scaled. |
We have to distinguish between the skin and the library region. In the skin region, we have to use pixel size fonds in our custom widgets, to not have cross platform issues and to make the new scaling option from this PR work. The text on buttons should not resize with the OSs font setting. In the library area, we have the "Library Font" preference option to scale this area separate. This is a point size font, which is scaled by the OSs DPI setting. The same is true for other dialogs like preferences. If we now look at the header bar of the track table we have two options: |
Conflicts: src/widget/weffectselector.cpp
now with auto HiDpi for windows as well |
Ready for merge ?! |
How does this behave with Qt5? Should the scale factor be hardcoded as 1.0 with Qt5 and the option hidden from the preferences? |
Conflicts: src/preferences/dialog/dlgprefcontrols.h src/preferences/dialog/dlgprefcontrolsdlg.ui
I have not tested it with QT5 and I would like to avoid the work on QT5 for now since my last effort produces a crashing Mixxx. So it would be OK for me to hide the option for now. |
Done. |
LGTM! Thank you for making Mixxx usable on newer computers. After this is merged I will adopt the font scaling strategy used for WEffectSelector in this PR for WBeatSpinBox in #1187. |
How do I test this? I'm using a surface device (3000x2000 resolution). I downloaded the latest build from http://downloads.mixxx.org/builds/master/release/mixxx-2.1.0-alpha-pre-master-git6233-release-x64.msi, but I can't find any option for high dpi displays in the preferences. |
You should try this: Please check if Mixxx scales with Windows when changing from 100 to 200 % in the windows preferences and Auto Scaling enabled (default) in Mixxx preferences. Could you provide a screen shot? This was developed on a SD screen. |
Thank you! For testing and review and @devananda for a solid start! This is finally even better than I had hoped initially. |
This is the PR original started by @devananda to allow to build skins using @2x suffixed images for HiDpi screens.
I have picked it up, because we have an increasing amount of reports complaining about missing HiDPI support on Win and Linux. Mac has already "some" HiDpi support by the OS, for font rendering, and upscaling. so there seams to be less pressure.
I have now completed his work with floating point scaling for almost all skin widgets.
For now, I have kept the checkbox in preferences for double only. I consider fractional scaling as an experimental option, that can be enabled by editing the cfg file.
ScaleFactor 0.5
This is usefull for example to test big skins on small displays.
It is fun to test exotic scaling values B-)
I have failed to scale the combobox which is heavy styled by a style sheet.
Qt4 has no nice interface to hock between style sheet ans widget painting.
So other styled elements are effected as well.
I think a complete solution for this requires Qt5.
I have no HiDPI screen, so I cannot decide if this is already usable.
Assuming this does not break 1x scaling, this is a candidate to include it into 2.1 marked as experimental.
In any case this is a step in a right direction, because it allows high resolution cover arts and waveforms.