summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2016-02-22 19:08:09 -0800
committerCosimo Cecchi <cosimoc@gnome.org>2016-02-29 10:45:12 -0800
commit1a116b9a95aac9e55e858a4614b888f06a8c156d (patch)
tree5153b94e1bfb5377cf8efb43bc877b175f13e2bc
parent8b87eca11eae37a1e3357982b4ea7b6204b3d10d (diff)
downloadgtk+-1a116b9a95aac9e55e858a4614b888f06a8c156d.tar.gz
colorscale: don't use style properties to determine slider size
-rw-r--r--gtk/gtkcolorscale.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gtk/gtkcolorscale.c b/gtk/gtkcolorscale.c
index 5509c9c9ea..fd03029c2b 100644
--- a/gtk/gtkcolorscale.c
+++ b/gtk/gtkcolorscale.c
@@ -23,6 +23,7 @@
#include "gtkgesturelongpress.h"
#include "gtkcolorutils.h"
#include "gtkorientable.h"
+#include "gtkrangeprivate.h"
#include "gtkstylecontext.h"
#include "gtkaccessible.h"
#include "gtkprivate.h"
@@ -62,14 +63,20 @@ gtk_color_scale_get_trough_size (GtkColorScale *scale,
gint *height_out)
{
GtkWidget *widget = GTK_WIDGET (scale);
+ GtkCssGadget *slider_gadget;
gint width, height;
gint x_offset, y_offset;
gint slider_width, slider_height;
- gtk_widget_style_get (widget,
- "slider-width", &slider_width,
- "slider-length", &slider_height,
- NULL);
+ slider_gadget = gtk_range_get_slider_gadget (GTK_RANGE (scale));
+ gtk_css_gadget_get_preferred_size (slider_gadget,
+ GTK_ORIENTATION_HORIZONTAL, -1,
+ &slider_width, NULL,
+ NULL, NULL);
+ gtk_css_gadget_get_preferred_size (slider_gadget,
+ GTK_ORIENTATION_VERTICAL, -1,
+ &slider_height, NULL,
+ NULL, NULL);
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);