Bug 1439834 - Draw titlebar with some extent, r=dao
authorMartin Stransky <stransky@redhat.com>
Wed, 28 Feb 2018 14:28:40 +0100
changeset 407930 759df5effae385509afc3ba9ebe964553cea1e88
parent 407929 cd1ec0216879d6d3f070c1694cc8476d5435b3e7
child 407931 422c2b84ac8cdba7d003f82dd477e6727f8c35af
push id33623
push userrgurzau@mozilla.com
push dateTue, 13 Mar 2018 22:39:30 +0000
treeherdermozilla-central@1bd1d50b1f3f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1439834
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1439834 - Draw titlebar with some extent, r=dao 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)