Bug 1218008 - Fix progress bar rendering on the Ambiance GTK3 theme. r=karlt a=lizzard
authorAndrew Comminos <acomminos@mozilla.com>
Fri, 23 Oct 2015 22:14:09 -0700
changeset 296742 51585d9e70eb
parent 296741 94c40ce2d93b
child 296743 f6fa2e5fb632
push id5316
push userkwierso@gmail.com
push date2015-11-16 20:42 +0000
treeherdermozilla-beta@c66289e84c50 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt, lizzard
bugs1218008
milestone43.0
Bug 1218008 - Fix progress bar rendering on the Ambiance GTK3 theme. r=karlt a=lizzard
widget/gtk/gtk3drawing.c
widget/gtk/mozgtk/mozgtk.c
--- a/widget/gtk/gtk3drawing.c
+++ b/widget/gtk/gtk3drawing.c
@@ -2029,16 +2029,17 @@ moz_gtk_progress_chunk_paint(cairo_t *cr
 {
     GtkStyleContext* style;
 
     ensure_progress_widget();
     gtk_widget_set_direction(gProgressWidget, direction);
 
     style = gtk_widget_get_style_context(gProgressWidget);
     gtk_style_context_save(style);
+    gtk_style_context_remove_class(style, GTK_STYLE_CLASS_TROUGH);
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_PROGRESSBAR);
 
     if (widget == MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE ||
         widget == MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE) {
       /**
        * The bar's size and the bar speed are set depending of the progress'
        * size. These could also be constant for all progress bars easily.
        */
@@ -2064,22 +2065,25 @@ moz_gtk_progress_chunk_paint(cairo_t *cr
       if (vertical) {
         rect->y += (dx < travel / 2) ? dx : travel - dx;
         rect->height = barSize;
       } else {
         rect->x += (dx < travel / 2) ? dx : travel - dx;
         rect->width = barSize;
       }
     }
-  
-    gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
+
     // gtk_render_activity was used to render progress chunks on GTK versions
     // before 3.13.7, see bug 1173907.
-    if (gtk_check_version(3, 13, 7))
+    if (!gtk_check_version(3, 13, 7)) {
+      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);
+    } else {
       gtk_render_activity(style, cr, rect->x, rect->y, rect->width, rect->height);
+    }
     gtk_style_context_restore(style);
 
     return MOZ_GTK_SUCCESS;
 }
 
 gint
 moz_gtk_get_tab_thickness(void)
 {
--- a/widget/gtk/mozgtk/mozgtk.c
+++ b/widget/gtk/mozgtk/mozgtk.c
@@ -544,16 +544,17 @@ STUB(gtk_style_context_get)
 STUB(gtk_style_context_get_background_color)
 STUB(gtk_style_context_get_border)
 STUB(gtk_style_context_get_border_color)
 STUB(gtk_style_context_get_color)
 STUB(gtk_style_context_get_margin)
 STUB(gtk_style_context_get_padding)
 STUB(gtk_style_context_has_class)
 STUB(gtk_style_context_new)
+STUB(gtk_style_context_remove_class)
 STUB(gtk_style_context_remove_region)
 STUB(gtk_style_context_restore)
 STUB(gtk_style_context_save)
 STUB(gtk_style_context_set_path)
 STUB(gtk_style_context_set_state)
 STUB(gtk_tree_view_column_get_button)
 STUB(gtk_widget_get_preferred_size)
 STUB(gtk_widget_get_state_flags)