From adb2151187f3ce389feca24c34d2c5581a8fe417 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 12 Apr 2016 12:20:09 +0100 Subject: Latest gtk3 cleanup (bzr r14791) --- src/widgets/ruler.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/widgets/ruler.cpp') diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp index 0b473f173..fe851d592 100644 --- a/src/widgets/ruler.cpp +++ b/src/widgets/ruler.cpp @@ -286,7 +286,7 @@ sp_ruler_init (SPRuler *ruler) #if GTK_CHECK_VERSION(3,0,0) const gchar *str = "SPRuler {\n" - " background-color: @theme_bg_color;\n" + " background-color: @bg_color;\n" "}\n"; GtkCssProvider *css = gtk_css_provider_new (); gtk_css_provider_load_from_data (css, str, -1, NULL); @@ -1418,7 +1418,6 @@ sp_ruler_get_pos_rect (SPRuler *ruler, gdouble position) { GtkWidget *widget = GTK_WIDGET (ruler); - GtkStyle *style = gtk_widget_get_style (widget); SPRulerPrivate *priv = SP_RULER_GET_PRIVATE (ruler); GtkAllocation allocation; gint width, height; @@ -1433,8 +1432,19 @@ sp_ruler_get_pos_rect (SPRuler *ruler, gtk_widget_get_allocation (widget, &allocation); +#if GTK_CHECK_VERSION(3,0,0) + GtkStyleContext *context = gtk_widget_get_style_context (widget); + GtkBorder padding; + + gtk_style_context_get_border(context, static_cast(0), &padding); + + xthickness = padding.left + padding.right; + ythickness = padding.top + padding.bottom; +#else + GtkStyle *style = gtk_widget_get_style (widget); xthickness = style->xthickness; ythickness = style->ythickness; +#endif if (priv->orientation == GTK_ORIENTATION_HORIZONTAL) { -- cgit v1.2.3