diff options
author | trav90 <travawine@protonmail.ch> | 2018-04-06 10:25:03 -0500 |
---|---|---|
committer | trav90 <travawine@protonmail.ch> | 2018-04-06 10:25:03 -0500 |
commit | b0af6c9827bc40681c3e9509b55c54d4df089d3d (patch) | |
tree | 970ad6d862a24aacbce8f0d8fda3a0bca076673f | |
parent | 3c30002e00b5bcd613012e49021b451761686dfe (diff) | |
download | UXP-b0af6c9827bc40681c3e9509b55c54d4df089d3d.tar UXP-b0af6c9827bc40681c3e9509b55c54d4df089d3d.tar.gz UXP-b0af6c9827bc40681c3e9509b55c54d4df089d3d.tar.lz UXP-b0af6c9827bc40681c3e9509b55c54d4df089d3d.tar.xz UXP-b0af6c9827bc40681c3e9509b55c54d4df089d3d.zip |
[GTK3] Implement pre-3.20 MOZ_GTK_PROGRESS_CHUNK in WidgetStyleCache
-rw-r--r-- | widget/gtk/WidgetStyleCache.cpp | 7 | ||||
-rw-r--r-- | widget/gtk/gtk3drawing.cpp | 13 |
2 files changed, 9 insertions, 11 deletions
diff --git a/widget/gtk/WidgetStyleCache.cpp b/widget/gtk/WidgetStyleCache.cpp index aea657f51..916d7c4db 100644 --- a/widget/gtk/WidgetStyleCache.cpp +++ b/widget/gtk/WidgetStyleCache.cpp @@ -1007,6 +1007,13 @@ GetWidgetStyleInternal(WidgetNodeType aNodeType) case MOZ_GTK_PROGRESS_TROUGH: return GetWidgetStyleWithClass(MOZ_GTK_PROGRESSBAR, GTK_STYLE_CLASS_TROUGH); + case MOZ_GTK_PROGRESS_CHUNK: { + GtkStyleContext* style = + GetWidgetStyleWithClass(MOZ_GTK_PROGRESSBAR, + GTK_STYLE_CLASS_PROGRESSBAR); + gtk_style_context_remove_class(style, GTK_STYLE_CLASS_TROUGH); + return style; + } case MOZ_GTK_GRIPPER: return GetWidgetStyleWithClass(MOZ_GTK_GRIPPER, GTK_STYLE_CLASS_GRIP); diff --git a/widget/gtk/gtk3drawing.cpp b/widget/gtk/gtk3drawing.cpp index 1db55dda1..baf73c859 100644 --- a/widget/gtk/gtk3drawing.cpp +++ b/widget/gtk/gtk3drawing.cpp @@ -1386,17 +1386,8 @@ moz_gtk_progress_chunk_paint(cairo_t *cr, GdkRectangle* rect, GtkTextDirection direction, WidgetNodeType widget) { - GtkStyleContext* style; - - if (gtk_check_version(3, 20, 0) != nullptr) { - /* Ask for MOZ_GTK_PROGRESS_TROUGH instead of MOZ_GTK_PROGRESSBAR - * because ClaimStyleContext() saves/restores that style */ - style = ClaimStyleContext(MOZ_GTK_PROGRESS_TROUGH, direction); - gtk_style_context_remove_class(style, GTK_STYLE_CLASS_TROUGH); - gtk_style_context_add_class(style, GTK_STYLE_CLASS_PROGRESSBAR); - } else { - style = ClaimStyleContext(MOZ_GTK_PROGRESS_CHUNK, direction); - } + GtkStyleContext* style = + ClaimStyleContext(MOZ_GTK_PROGRESS_CHUNK, direction); if (widget == MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE || widget == MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE) { |