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
--- 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)