From 3ef5665ebe66539ab01fd1b070446e8ef4432ae9 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 30 Nov 2015 05:26:00 +0100 Subject: [PATCH] Bug 1228281 - [GTK3] add padding to buttons. r=karlt --- widget/gtk/gtk3drawing.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/widget/gtk/gtk3drawing.c b/widget/gtk/gtk3drawing.c index 1179ce15fdc..a716b8ddb4c 100644 --- a/widget/gtk/gtk3drawing.c +++ b/widget/gtk/gtk3drawing.c @@ -2698,20 +2698,19 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top, *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gButtonWidget)); - /* Don't add this padding in HTML, otherwise the buttons will - become too big and stuff the layout. */ - if (!inhtml) { - if (widget == MOZ_GTK_TOOLBAR_BUTTON) { - gtk_style_context_save(style); - gtk_style_context_add_class(style, "image-button"); - } - - moz_gtk_add_style_padding(style, left, top, right, bottom); - - if (widget == MOZ_GTK_TOOLBAR_BUTTON) - gtk_style_context_restore(style); + if (widget == MOZ_GTK_TOOLBAR_BUTTON) { + gtk_style_context_save(style); + gtk_style_context_add_class(style, "image-button"); } + + moz_gtk_add_style_padding(style, left, top, right, bottom); + + if (widget == MOZ_GTK_TOOLBAR_BUTTON) + gtk_style_context_restore(style); + // XXX: Subtract 1 pixel from the border to account for the added + // -moz-focus-inner border (Bug 1228281). + *left -= 1; *top -= 1; *right -= 1; *bottom -= 1; moz_gtk_add_style_border(style, left, top, right, bottom); return MOZ_GTK_SUCCESS; }