Bug 447288 - Assigning a menu to an action gives it excessive left padding
Summary: Assigning a menu to an action gives it excessive left padding
Status: RESOLVED FIXED
Alias: None
Product: Breeze
Classification: Plasma
Component: QStyle (show other bugs)
Version: 5.23.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-12-20 14:35 UTC by Raghavendra kamath
Modified: 2022-01-18 20:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24
Sentry Crash Report:


Attachments
screenshot showing the space before open with menu marked with red XX (22.31 KB, image/png)
2021-12-20 14:35 UTC, Raghavendra kamath
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raghavendra kamath 2021-12-20 14:35:52 UTC
Created attachment 144716 [details]
screenshot showing the space before open with menu marked with red XX

SUMMARY
When you open an image in gwenview the sidebar has a file operation section in it. There is a open with menu in this list. Currently there is some weird empty space before the text. This could be the space reserved for icons as all other texts have corresponding icons except this entry, but it is also miss aligned to the other texts.

I am attaching a screenshot to show this space for your reference.
Comment 1 Nate Graham 2021-12-20 15:01:34 UTC
Can reproduce.
Comment 2 Nate Graham 2021-12-20 15:07:39 UTC
This seems to be a bug in the Breeze style. Somehow giving this action a menu causes it to be indented too much on the left. Removing the `mOpenWithAction->setMenu(menu);` line gets rid of the extra margin.

See https://invent.kde.org/graphics/gwenview/-/blob/master/app/fileopscontextmanageritem.cpp#L192
Comment 3 Fushan Wen 2021-12-20 16:53:06 UTC
I tried to fix the big by reading Breeze code, but found nothing and I should say the coding style is weird (maybe ancient). Setting subcontrol-position: right center; will fix the alignment issue, but the arrow position becomes incorrect.
Comment 4 Bug Janitor Service 2022-01-15 04:56:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/breeze/-/merge_requests/169
Comment 5 Fushan Wen 2022-01-15 05:54:32 UTC
Git commit 47a015cde2951af65fe17c20bdbe0034cb48359d by Fushan Wen.
Committed on 15/01/2022 at 05:12.
Pushed by fusionfuture into branch 'master'.

breezestyle: Remove extra margin for InstantPopup

Assigning a menu with instant popup mode to an action gives it
excessive left padding. Removing the extra margin fixes it.

M  +0    -6    kstyle/breezestyle.cpp

https://invent.kde.org/plasma/breeze/commit/47a015cde2951af65fe17c20bdbe0034cb48359d
Comment 6 Nate Graham 2022-01-18 20:30:23 UTC
Git commit 7519dec9b55fd58662a7f79c157ec032acca6a2f by Nate Graham, on behalf of Fushan Wen.
Committed on 18/01/2022 at 20:30.
Pushed by ngraham into branch 'Plasma/5.24'.

breezestyle: Remove extra margin for InstantPopup

Assigning a menu with instant popup mode to an action gives it
excessive left padding. Removing the extra margin fixes it.


(cherry picked from commit 47a015cde2951af65fe17c20bdbe0034cb48359d)

M  +0    -6    kstyle/breezestyle.cpp

https://invent.kde.org/plasma/breeze/commit/7519dec9b55fd58662a7f79c157ec032acca6a2f