Bug 1498356 - Remove padding/border from -moz-window-titlebar*, r=dao
authorMartin Stransky <stransky@redhat.com>
Fri, 12 Oct 2018 16:16:57 +0000
changeset 489395 3df978f11b6d4017d88295335458283c38d697cd
parent 489394 a0d97137f1d6686476466a57e0fcba6451663a09
child 489396 d2b32aa2055fecc143a03013b06afbac1ad91836
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersdao
bugs1498356
milestone64.0a1
Bug 1498356 - Remove padding/border from -moz-window-titlebar*, r=dao Differential Revision: https://phabricator.services.mozilla.com/D8529
widget/gtk/gtk3drawing.cpp
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -2330,18 +2330,16 @@ moz_gtk_info_bar_paint(cairo_t *cr, GdkR
 static gint
 moz_gtk_header_bar_paint(WidgetNodeType widgetType,
                          cairo_t *cr, GdkRectangle* rect, GtkWidgetState* state)
 {
     GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
     GtkStyleContext *style =
         GetStyleContext(widgetType, GTK_TEXT_DIR_NONE, state_flags);
 
-    InsetByMargin(rect, style);
-
     // Some themes (Adwaita for instance) draws bold dark line at
     // titlebar bottom. It does not fit well with Firefox tabs so
     // draw with some extent to make the titlebar bottom part invisible.
     #define TITLEBAR_EXTENT 4
 
     // We don't need to draw window decoration for MOZ_GTK_HEADER_BAR_MAXIMIZED,
     // i.e. when main window is maximized.
     if (widgetType == MOZ_GTK_HEADER_BAR) {
@@ -2568,24 +2566,16 @@ moz_gtk_get_widget_border(WidgetNodeType
                                               left, top, right, bottom);
 
             GtkStyleContext* labelStyle = GetStyleContext(MOZ_GTK_TOOLTIP_BOX_LABEL);
             moz_gtk_add_margin_border_padding(labelStyle,
                                               left, top, right, bottom);
 
             return MOZ_GTK_SUCCESS;
         }
-    case MOZ_GTK_HEADER_BAR:
-    case MOZ_GTK_HEADER_BAR_MAXIMIZED:
-        {
-            style = GetStyleContext(widget);
-            moz_gtk_add_border_padding(style, left, top, right, bottom);
-            *top = *bottom = 0;
-            return MOZ_GTK_SUCCESS;
-        }
     /* These widgets have no borders, since they are not containers. */
     case MOZ_GTK_CHECKBUTTON_LABEL:
     case MOZ_GTK_RADIOBUTTON_LABEL:
     case MOZ_GTK_SPLITTER_HORIZONTAL:
     case MOZ_GTK_SPLITTER_VERTICAL:
     case MOZ_GTK_CHECKBUTTON:
     case MOZ_GTK_RADIOBUTTON:
     case MOZ_GTK_SCROLLBAR_BUTTON:
@@ -2595,16 +2585,18 @@ moz_gtk_get_widget_border(WidgetNodeType
     case MOZ_GTK_SCALE_THUMB_VERTICAL:
     case MOZ_GTK_GRIPPER:
     case MOZ_GTK_PROGRESS_CHUNK:
     case MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE:
     case MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE:
     case MOZ_GTK_TREEVIEW_EXPANDER:
     case MOZ_GTK_TOOLBAR_SEPARATOR:
     case MOZ_GTK_MENUSEPARATOR:
+    case MOZ_GTK_HEADER_BAR:
+    case MOZ_GTK_HEADER_BAR_MAXIMIZED:
     case MOZ_GTK_HEADER_BAR_BUTTON_CLOSE:
     case MOZ_GTK_HEADER_BAR_BUTTON_MINIMIZE:
     case MOZ_GTK_HEADER_BAR_BUTTON_MAXIMIZE:
     case MOZ_GTK_HEADER_BAR_BUTTON_MAXIMIZE_RESTORE:
     /* These widgets have no borders.*/
     case MOZ_GTK_INNER_SPIN_BUTTON:
     case MOZ_GTK_SPINBUTTON:
     case MOZ_GTK_WINDOW: