diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-05-08 10:19:13 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-05-08 10:19:13 +0000 |
| commit | 1556c1a3619c415b3a7abacfdabd89398e411a91 (patch) | |
| tree | d7718e5873db4b2c25cb3bed94fcc4c3ba87fea4 /src/widgets/ruler.cpp | |
| parent | remove a waring on compile (diff) | |
| parent | add missing POTFILES.in line in mirror symmetry LPE (diff) | |
| download | inkscape-1556c1a3619c415b3a7abacfdabd89398e411a91.tar.gz inkscape-1556c1a3619c415b3a7abacfdabd89398e411a91.zip | |
update to trunk
(bzr r13645.1.127)
Diffstat (limited to 'src/widgets/ruler.cpp')
| -rw-r--r-- | src/widgets/ruler.cpp | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp index 3a5e76277..bcab535f9 100644 --- a/src/widgets/ruler.cpp +++ b/src/widgets/ruler.cpp @@ -282,26 +282,6 @@ sp_ruler_init (SPRuler *ruler) priv->pos_redraw_idle_id = 0; priv->font_scale = DEFAULT_RULER_FONT_SCALE; - -#if GTK_CHECK_VERSION(3,0,0) - #if GTK_CHECK_VERSION(3,8,0) - const gchar *str = - "SPRuler {\n" - " background-color: @theme_bg_color;\n" - "}\n"; - #else - const gchar *str = - "SPRuler {\n" - " background-color: @bg_color;\n" - "}\n"; - #endif - GtkCssProvider *css = gtk_css_provider_new (); - gtk_css_provider_load_from_data (css, str, -1, NULL); - gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (ruler)), - GTK_STYLE_PROVIDER (css), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); - g_object_unref (css); -#endif } static void @@ -1425,7 +1405,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; @@ -1440,8 +1419,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<GtkStateFlags>(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) { |
