-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix for the font of truncated sidebar items (#5714). #5777
Conversation
For windows platforms, retrieve the system font and set it for the FileBrowserTreeWidget. This makes sure that truncated items will use the font as non-truncated items.
It looks like there is a shortcoming/bug in QT. When it truncates the text of an item because the sidebar is made smaller, it uses another font (in particular MS Shell Dlg 2 vs. Segoe UI for non-truncated items on my Win10 box). The issue is flagged here: https://bugreports.qt.io/browse/QTBUG-29232. Both bugreports do a suggestion to fix it or workaround it.
Taking it further I implemented the second proposal and apply the retrieved font only on the FileBrowserTreeWidget. Resizing the sidebar now looks clean when text items get truncated (at least on my Win10). @Spekular, unfortunately it's adding logic instead of removing logic. |
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Linux
Windows
macOS🤖{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://10375-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.5%2Bg8cc03c9-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/10375?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://10379-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.5%2Bg8cc03c958-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/10379?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://10377-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.5%2Bg8cc03c958-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/10377?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/miy8htycx4ixkm2a/artifacts/build/lmms-1.3.0-alpha-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/36303461"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/bdhxbhcst6g2i5dy/artifacts/build/lmms-1.3.0-alpha-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/36303461"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://10376-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.5%2Bg8cc03c958-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/10376?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "b3e9da21395bb26f7a437253d652642727ef4c25"} |
Tested and working for me. I don't see any issues with the code itself but I'd love to hear from someone else, especially regarding this:
As for this:
That is a bit unfortunate, but worth it IMO. That being said, I would add a link to the qt bug report and a searchable keyword to the comments. That should make it easier to remove this code when it becomes obsolete. Something like
|
It works perfect. Tested on both 32 and 64bits, on Windows10. |
Thanks! |
Merging ~24h from now if there are no objections. Shouldn't be hard to move the font function if it does belong elsewhere :P |
How about adding the condition
As for where to put |
Thanks. Good suggestion! I added the check and commited again. |
Good suggestion indeed, I'll have to remember that for the future. My approving review stands, @DomClark if the newly added check is to your satisfaction I'm still in favor of a merge. |
🎉 |
* Fix for the font of truncated sidebar items (LMMS#5714). For windows platforms, retrieve the system font and set it for the FileBrowserTreeWidget. This makes sure that truncated items will use the font as non-truncated items. * Add TODO to remove the fix when all builds use a recent enough version of qt. * Add check on QT version and conditionally include the fix.
* Fix for the font of truncated sidebar items (LMMS#5714). For windows platforms, retrieve the system font and set it for the FileBrowserTreeWidget. This makes sure that truncated items will use the font as non-truncated items. * Add TODO to remove the fix when all builds use a recent enough version of qt. * Add check on QT version and conditionally include the fix.
For windows platforms, retrieve the system font and set it for the FileBrowserTreeWidget. This makes sure that truncated items will use the font as non-truncated items.