Bug 1439834 - Draw titlebar with some extent. r=dao, a=jcristau
authorMartin Stransky <stransky@redhat.com>
Wed, 28 Feb 2018 14:28:40 +0100
changeset 460356 48151778db661b967db3f8e6ebca118752e0b203
parent 460355 270b317fe5c319adc9ed3ab24ed8e0e0cb15d73f
child 460357 115138a61e50a81f19982f0d5c3e33a555bdbcb0
push id8921
push userryanvm@gmail.com
push dateMon, 26 Mar 2018 14:40:36 +0000
treeherdermozilla-beta@a15c367a272e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, jcristau
bugs1439834
milestone60.0
Bug 1439834 - Draw titlebar with some extent. r=dao, a=jcristau Some themes (Adwaita for instance) draws bold dark line at titlebar bottom. It does not fit well with Firefox tabbar UI so draw themed titlebar with some extent to make the titlebar bottom part invisible (it's clipped by cairo). MozReview-Commit-ID: 3rs4UzFJdPa
widget/gtk/gtk3drawing.cpp
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -2280,19 +2280,25 @@ 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_LTR,
                                              state_flags);
     InsetByMargin(rect, style);
-    gtk_render_background(style, cr, rect->x, rect->y, rect->width,
-                          rect->height);
-    gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
+
+    // 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
+    gtk_render_background(style, cr, rect->x, rect->y,
+                          rect->width, rect->height + TITLEBAR_EXTENT);
+    gtk_render_frame(style, cr, rect->x, rect->y,
+                     rect->width, rect->height + TITLEBAR_EXTENT);
 
     return MOZ_GTK_SUCCESS;
 }
 
 
 
 static GtkBorder
 GetMarginBorderPadding(GtkStyleContext* aStyle)