Created attachment 1006304 [details] an example Description of problem: GTK styles returns large padding values for GtkEntry box. It looks weird when it's rendered by Firefox in UI. Version-Release number of selected component (if applicable): gtk3-3.15.12-1.fc22.x86_64
The code looks like: gEntryWidget = gtk_entry_new(); style = gtk_widget_get_style_context(gEntryWidget); gtk_style_context_get_border(style, 0, &border); gtk_style_context_get_padding(style, 0, &padding); and it returns: (gdb) p border $1 = {left = 1, right = 1, top = 1, bottom = 1} (gdb) p padding $2 = {left = 8, right = 8, top = 5, bottom = 6}
It's specified like this in https://git.gnome.org/browse/gtk+/tree/gtk/theme/Adwaita/_common.scss?h=3.16.0#n221 so I guess this is by design. Adwaita uses a bunch of inset shadows to get the bevel effect on the border, maybe that's what takes up the pixels?
Created attachment 1008659 [details] GtkEntry in gtk3-widget-factory As you can see on the attached example, gtk3-widget-factory renders GtkEntry widget with: {left = 8,right = 8,top = 5,bottom = 6} but GtkStyle returns sizes (border+padding): {left = 9,right = 9,top = 6,bottom = 7} Or is the widget size narrowed with any attribute?
There's also a "bug" in Firefox when 2 extra pixels are added to the form size. That's defined in Firefox css styles. It can be fixed in FF but the values returned from GTK3 still don't match.
NOTE: I don't count the shadows - it's measured from font border to element border (the blue focus line).
Actually a Firefox bug when extra padding is added by Firefox css styles. Sorry for the confusion.