Summary: | QMenuBar doesn't render icons properly | ||
---|---|---|---|
Product: | [Plasma] Breeze | Reporter: | arsenarsentmc |
Component: | QStyle | Assignee: | Hugo Pereira Da Costa <hugo.pereira.da.costa> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hugo.pereira.da.costa |
Priority: | NOR | ||
Version: | 5.10.5 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/breeze/3fcebd4e627a0255631ec81d39ed9eac158ac374 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | POC code |
Description
arsenarsentmc
2017-12-02 21:04:13 UTC
yep. Breeze never attempted to render icons in menubar items. (I didn't know this was possible/needed). For my understanding: what happens (with eg fusion), if you set both text and icon to the qaction ? With both Fusion and GTK2 the icon gets rendered and while the action is being held pressed the text is rendered. (In reply to arsenarsentmc from comment #2) > With both Fusion and GTK2 the icon gets rendered and while the action is > being held pressed the text is rendered. Thanks for the input. Interesting. Feels like a bug to me ... I guess I'll try to implement rendering both text and icon in all cases as soon as both are set, in a way that is similar to what is done in menus ... Running your test program here with Qt 5.9.2, I can indeed see the red icon with widget styles gtk and windows, but not with fusion. What is the Qt version you are using ? In any case it seems that the feature you are trying to use is quite fragile and buggy. Anyway, I'll go ahead with the implementation which I think is the most rational. (In reply to Hugo Pereira Da Costa from comment #4) > Running your test program here with Qt 5.9.2, I can indeed see the red icon > with widget styles gtk and windows, but not with fusion. What is the Qt > version you are using ? > In any case it seems that the feature you are trying to use is quite fragile > and buggy. > Anyway, I'll go ahead with the implementation which I think is the most > rational. Forget about it. I can reproduce the behavior you describe for fusion too. I'm about to submit a patch to breeze and oxygen for rendering the icon (and only the icon) as soon as it is set. After checking the qmenubar code, text, if present, should be ignored in such cases (in both pressed and unpressed mode), as this is what qmenubar expects Git commit be09a708f5759792607aee45e553406d5a9024e5 by Hugo Pereira Da Costa. Committed on 08/12/2017 at 13:41. Pushed by hpereiradacosta into branch 'master'. When an icon is set to a QMenuBar Item, render the icon only, and ignore the text, when set, as this is what qmenubar expects. M +67 -16 kstyle/breezestyle.cpp https://commits.kde.org/breeze/be09a708f5759792607aee45e553406d5a9024e5 Git commit 8a38d240cf7fbf34902edf99db1c880c4ee5eb1b by Hugo Pereira Da Costa. Committed on 08/12/2017 at 13:53. Pushed by hpereiradacosta into branch 'master'. When an icon is set to a QMenuBar Item, render the icon only, and ignore the text, when set, as this is what qmenubar expects. M +48 -9 kstyle/oxygenstyle.cpp https://commits.kde.org/oxygen/8a38d240cf7fbf34902edf99db1c880c4ee5eb1b Git commit 9f4fd9f43638527b719578f546d700d2f17b68bc by Hugo Pereira Da Costa. Committed on 08/12/2017 at 13:53. Pushed by hpereiradacosta into branch 'Plasma/5.11'. When an icon is set to a QMenuBar Item, render the icon only, and ignore the text, when set, as this is what qmenubar expects. M +48 -9 kstyle/oxygenstyle.cpp https://commits.kde.org/oxygen/9f4fd9f43638527b719578f546d700d2f17b68bc Git commit 3fcebd4e627a0255631ec81d39ed9eac158ac374 by Hugo Pereira Da Costa. Committed on 08/12/2017 at 13:54. Pushed by hpereiradacosta into branch 'Plasma/5.11'. When an icon is set to a QMenuBar Item, render the icon only, and ignore the text, when set, as this is what qmenubar expects. M +67 -16 kstyle/breezestyle.cpp https://commits.kde.org/breeze/3fcebd4e627a0255631ec81d39ed9eac158ac374 |