Bug 433158 - Different menu item height between breeze and breeze-gtk
Summary: Different menu item height between breeze and breeze-gtk
Status: RESOLVED FIXED
Alias: None
Product: Breeze
Classification: Plasma
Component: gtk theme (show other bugs)
Version: 5.21.0
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Janet Blackquill
URL:
Keywords: regression
: 433687 435126 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-18 11:35 UTC by Yannick
Modified: 2022-02-28 16:13 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.25


Attachments
Menu item height comparison (115.23 KB, image/png)
2021-02-18 11:35 UTC, Yannick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yannick 2021-02-18 11:35:42 UTC
Created attachment 135836 [details]
Menu item height comparison

SUMMARY

On Plasma 5.21.0, the menu items seem larger in GTK3 applications using the breeze-gtk theme compared to the menu items of Qt applications using the breeze theme.
It doesn't seem to affect Firefox and Thunderbird for some reason, but it's visible on Shotwell and Handbrake for example.

On GTK2 applications (tested with Gimp) the menu item height seems smaller.

SOFTWARE/OS VERSIONS
OS: Archlinux
KDE Plasma Version: 5.21.0
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Comment 1 ConteZero 2021-02-18 19:59:38 UTC
I can confirm the bug on openSUSE Tumbleweed and Plasma 5.21.0
It affect all gtk3 applications that I've tested: Firefox, Thunderbird, Eclipse, Libreoffice, Handbrake.
Comment 2 Nate Graham 2021-03-02 18:23:23 UTC
*** Bug 433687 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2021-03-02 18:23:56 UTC
Jan, can you please take a look? Thanks!
Comment 4 ConteZero 2021-03-02 19:23:10 UTC
I think it's related to changes referenced on
https://bugs.kde.org/show_bug.cgi?id=431819

As a temporary workaround I've added these lines on ~/.config/gtk-3.0/gtk.css

menubar > menuitem, .menubar > menuitem {
  padding: 5px 6px; }
menu menuitem, .menu menuitem {
  padding: 5px 4px; }
modelbutton.flat, popover.background checkbutton.flat,
popover.background radiobutton.flat,
.menuitem.button.flat,
button.button.sidebar-button,
notebook > header > tabs > arrow.button,
popover.background checkbutton.button,
popover.background radiobutton.button {
  padding: 5px 8px; }


With this config the gtk3 menu items are only slightly taller (1 pixel), if I use a 4px vertical padding then the menu items are slightly shorter (1 pixel).
Comment 5 Nate Graham 2021-03-03 01:11:07 UTC
Would you like to submit a merge request to fix it? Seems like you've already done most of the work.

https://invent.kde.org/plasma/breeze-gtk/-/merge_requests/
Comment 6 ConteZero 2021-03-04 08:06:14 UTC
I've done some changes to the gtk.css code:

menubar > menuitem, .menubar > menuitem {
    padding: 4px 6px 5px 6px; }
menu menuitem, .menu menuitem {
    padding: 4px 4px 5px 4px; }
modelbutton.flat, popover.background checkbutton.flat,
popover.background radiobutton.flat,
.menuitem.button.flat,
button.button.sidebar-button,
notebook > header > tabs > arrow.button,
popover.background checkbutton.button,
popover.background radiobutton.button {
  padding: 4px 8px 5px 8px; }


Now it uses asymmetric vertical padding and with this config I have a perfect match between gtk3 and QT menu items height.
It might be useful if someone else could give it a try.
Comment 7 Nate Graham 2021-03-04 14:39:29 UTC
Can you submit those changes in a merge request so everyone else can benefit from them?
Comment 8 Bug Janitor Service 2021-03-04 22:20:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/breeze-gtk/-/merge_requests/16
Comment 9 Nate Graham 2021-03-05 16:20:17 UTC
Git commit 538055e9f560b85e4a9aaac1242442b492d2a339 by Nate Graham, on behalf of Jan Blackquill.
Committed on 05/03/2021 at 16:13.
Pushed by ngraham into branch 'master'.

Adjust menu heights to properly match Breeze QStyle, second time

Looks like the menu height got adjusted again.

M  +1    -1    src/gtk3/widgets/_menus.scss
M  +1    -1    src/gtk4/widgets/_menus.scss

https://invent.kde.org/plasma/breeze-gtk/commit/538055e9f560b85e4a9aaac1242442b492d2a339
Comment 10 Nate Graham 2021-03-05 16:20:46 UTC
Git commit 7be4c04e4dca2ba61b5822d8d50b7d3ee3a87702 by Nate Graham, on behalf of Jan Blackquill.
Committed on 05/03/2021 at 16:20.
Pushed by ngraham into branch 'Plasma/5.21'.

Adjust menu heights to properly match Breeze QStyle, second time

Looks like the menu height got adjusted again.


(cherry picked from commit 538055e9f560b85e4a9aaac1242442b492d2a339)

M  +1    -1    src/gtk3/widgets/_menus.scss
M  +1    -1    src/gtk4/widgets/_menus.scss

https://invent.kde.org/plasma/breeze-gtk/commit/7be4c04e4dca2ba61b5822d8d50b7d3ee3a87702
Comment 11 ConteZero 2021-03-05 16:47:38 UTC
Maybe I'm wrong, but it seems to me that the merge request changes the horizontal padding and not the vertical one.
Comment 12 ConteZero 2021-03-21 13:25:48 UTC
The bug is not fixed, I've tested on openSUSE Tumbleweed and Plasma 5.21.3 and menu items in gtk3 applications have greater heights than QT ones.
Comment 13 Nate Graham 2021-03-31 17:43:25 UTC
*** Bug 435126 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2021-03-31 17:43:51 UTC
Re-opening since apparently they are still not the same height.
Comment 15 gsbhasin84 2021-04-01 01:11:31 UTC
Sorry for creating a duplicate bug, I was not able to find it previously reported. I'm happy to play around and attempt to create a PR, but I'm not sure how the Breeze GTK build system works. If I get the time, I'll try taking a look over the weekend
Comment 16 Nate Graham 2021-04-01 03:13:57 UTC
You can check out the last commit that attempted to fix it: https://invent.kde.org/plasma/breeze-gtk/commit/7be4c04e4dca2ba61b5822d8d50b7d3ee3a87702
Comment 17 Bug Janitor Service 2022-02-24 19:44:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/breeze-gtk/-/merge_requests/45
Comment 18 Nate Graham 2022-02-28 16:13:42 UTC
Git commit dcd699bcd994acf6cda8f741850d0fed3d37cffb by Nate Graham, on behalf of Janet Blackquill.
Committed on 28/02/2022 at 16:13.
Pushed by ngraham into branch 'master'.

gtk3, gtk4: shrink padding of menus by 1px
FIXED-IN: 5.25

M  +1    -1    src/gtk3/widgets/_menus.scss
M  +1    -1    src/gtk4/widgets/_menus.scss

https://invent.kde.org/plasma/breeze-gtk/commit/dcd699bcd994acf6cda8f741850d0fed3d37cffb