GNOME Bugzilla – Bug 763798
No border in combobox menu
Last modified: 2017-07-25 08:05:46 UTC
Created attachment 324161 [details] comparsion Is it possible to add a border in combobox menu like in Adwaita GTK3?
It's set for 3.22. Although as you can see there is a border, created by the small shadow, while not perfect, it's made to simulate the gtk3 effect (for now). The problem is all the solutions require patching mutter. We can either: - change the menu shadow made by mutter to create just a 1px border around it (best way, but also trickiest afaik, not sure if possible, may require adding logic to mutter) - stop mutter from rendering the shadow and make it with gtk2 (not as good, no transparency, breaks non-gtk2 apps) - make a border with gtk2 without disabling the mutter shadow (ugh)
Also, your padding is messed up. Did the font change do that? Don't tell me it's broken, I worked really hard to get it pixel-perfect.
(In reply to Juraj Fiala from comment #2) > Also, your padding is messed up. Did the font change do that? Don't tell me > it's broken, I worked really hard to get it pixel-perfect. I do not know what kind of padding in question.
> I do not know what kind of padding in question. The buttons! They're much smaller than in gtk3!
(In reply to Juraj Fiala from comment #4) > > I do not know what kind of padding in question. > > The buttons! They're much smaller than in gtk3! Yes. It is changed by font. I'm using Roboto 9 and Adwaita GTK3 can not adapt to the font size smaller than 11pt.
GTK3 or 2? Cause that looks like a problem of 2, especially since the arrow is offset. Also, please disregard the exclamation marks. I'm just a teeny bit enthusiastic.
(In reply to Juraj Fiala from comment #6) > GTK3 or 2? Cause that looks like a problem of 2, especially since the arrow > is offset. > > Also, please disregard the exclamation marks. I'm just a teeny bit > enthusiastic. I think the problem in Adwaita gtk3. gtk2 theme looks good for me. https://bugzilla.gnome.org/show_bug.cgi?id=761435 The buttons look the same if you choose a 11pt fonthttp://storage2.static.itmages.ru/i/16/0323/h_1458768837_3366204_e661772ddc.png
http://storage2.static.itmages.ru/i/16/0323/h_1458768837_3366204_e661772ddc.png
*wipes cold sweat from forehead* Hm, also the sad thing is that I can't make the combobox look like the gtk3 one. There are like four or five different types of them, I can make most of them look great (https://www.dropbox.com/s/f8k5ujahguqqo5q/Sn%C3%ADmka%20obrazovky%20z%202016-03-24%2007-30-54.png?dl=0), I can't make that one look the same because it breaks another one.
OK unfortunately this didn't make it into 3.22. I'm going to have a look at it again soonish but again it relies on changes to mutter.
Also please look at bug #744667, which would be the first step to fix this.
Created attachment 338390 [details] [review] add 1px border to menu How about this patch?
Created attachment 338391 [details] patch comparsion Comparsion borders vs no border
Also, I saw this bug https://bugzilla.gnome.org/show_bug.cgi?id=772796 and tested patch with disabled composing/shadow. Looks good with XFCE http://storage6.static.itmages.ru/i/16/1027/h_1477571479_5361182_be6f635871.png
I did actually think of doing it like this but this is the job for the adwaita engine, which can detect whether or not the current session has compositing and applies the border only as a fallback. The best way would be for mutter to make the border as a 1px shadow, like gtk3 does, but I have no idea what is happening in bug #744667.
OK so I had a talk with Lapo and he said it's better to do it this way. However this is the first patch I'm going to merge so please ignore the weird stuff I might do.
Review of attachment 338390 [details] [review]: The patch looks good, but really it should just go into "menu". Also the drawing sections from the adwaita engine need to be removed or it'll get drawn twice for no reason. Keep in mind both main.rc's should be identical, they are just this way because I didn't figure out a better way to make the theme install. ::: themes/Adwaita/gtk-2.0/main.rc @@ +1538,3 @@ + bg[NORMAL] = @base_color + bg[INSENSITIVE] = @base_color + bg[PRELIGHT] = @base_color This should point to @menu_color instead. You also forgot [SELECTED] which some apps read. But since you've overridden "menu" and set [PRELIGHT] to @base_color it would break menu item highlight in some apps that just read the format (like Firefox or Deadbeef). @@ +1541,3 @@ + + engine "pixmap" + { Please follow the style of the surrounding file. @@ +1546,3 @@ + function = BOX + file = "assets/menu-border.png" + border = { 1, 1, 1, 1 } Same here, too many aligning spaces and extra ones inside the braces, they aren't used like that anywhere else. @@ +2522,2 @@ # Menu and menubar items +widget_class "*<GtkMenu>" style "menu_framed_box" We already catch GtkMenu above, why not use that? The less style matches the better (and faster).
Can you fix it? I'm not a developer and doesn't understand the code. Many googled before writing this patch. I most wanted to draw attention to a problem that can not be solved for a long time, and show that it can be solved. For me, the problem is temporarily resolved, but for a more elegant solution, please correct it yourself.
With https://bugzilla.gnome.org/show_bug.cgi?id=744667#c39 my patch for 1px border not working. I see only shadow.
Created attachment 350953 [details] [review] Add border back to menus I have fixed it here with this change.
And now as of 3.24 thanks to the progress in bug #744667 combo menus finally have a shadow border.
Created attachment 356337 [details] combo menus in 3.24
See bug #772796 regarding disfunctioning borders when no compositing is present.