bug 1343802 remove have_arrow_scaling, which was always true r=jhorak+328198
authorKarl Tomlinson <karlt+@karlt.net>
Mon, 27 Mar 2017 20:32:33 +0200
changeset 552113 5f31d05b6a70476e439f7f390d17a05c06c1db82
parent 552112 9181b8953b4689a6c1c0b66acb8099f75a5ff10c
child 552114 0c9392847e7fb5b163af8a3accc1e9c865f90313
push id51252
push userhikezoe@mozilla.com
push dateTue, 28 Mar 2017 02:10:27 +0000
reviewersjhorak
bugs1343802, 328198
milestone55.0a1
bug 1343802 remove have_arrow_scaling, which was always true r=jhorak+328198 MozReview-Commit-ID: AeM2oKoPCTs
widget/gtk/gtk3drawing.cpp
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -13,17 +13,16 @@
 #include <string.h>
 #include "gtkdrawing.h"
 #include "mozilla/Assertions.h"
 #include "prinrval.h"
 #include "WidgetStyleCache.h"
 
 #include <math.h>
 
-static gboolean have_arrow_scaling;
 static gboolean checkbox_check_state;
 static gboolean notebook_has_tab_gap;
 
 static ScrollbarGTKMetrics sScrollbarMetrics[2];
 
 #define ARROW_UP      0
 #define ARROW_DOWN    G_PI
 #define ARROW_RIGHT   G_PI_2
@@ -75,18 +74,16 @@ GetStateFlagsFromGtkTabFlags(GtkTabFlags
 {
     return ((flags & MOZ_GTK_TAB_SELECTED) == 0) ?
             GTK_STATE_FLAG_NORMAL : GTK_STATE_FLAG_ACTIVE;
 }
 
 gint
 moz_gtk_init()
 {
-    have_arrow_scaling = (gtk_major_version > 2 ||
-                          (gtk_major_version == 2 && gtk_minor_version >= 12));
     if (gtk_major_version > 3 ||
        (gtk_major_version == 3 && gtk_minor_version >= 14))
         checkbox_check_state = GTK_STATE_FLAG_CHECKED;
     else
         checkbox_check_state = GTK_STATE_FLAG_ACTIVE;
 
     if (gtk_check_version(3, 12, 0) == nullptr &&
         gtk_check_version(3, 20, 0) != nullptr)
@@ -404,19 +401,18 @@ calculate_arrow_rect(GtkWidget* arrow, G
     /* defined in gtkarrow.c */
     gfloat arrow_scaling = 0.7;
     gfloat xalign, xpad;
     gint extent;
     gint mxpad, mypad;
     gfloat mxalign, myalign;
     GtkMisc* misc = GTK_MISC(arrow);
 
-    if (have_arrow_scaling)
-        gtk_style_context_get_style(gtk_widget_get_style_context(arrow),
-                                    "arrow_scaling", &arrow_scaling, NULL);
+    gtk_style_context_get_style(gtk_widget_get_style_context(arrow),
+                                "arrow_scaling", &arrow_scaling, NULL);
 
     gtk_misc_get_padding(misc, &mxpad, &mypad); 
     extent = MIN((rect->width - mxpad * 2),
                  (rect->height - mypad * 2)) * arrow_scaling;
 
     gtk_misc_get_alignment(misc, &mxalign, &myalign);
     
     xalign = direction == GTK_TEXT_DIR_LTR ? mxalign : 1.0 - mxalign;