diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/eom-print-image-setup.c | 4 | ||||
-rw-r--r-- | src/eom-print-preview.c | 30 | ||||
-rw-r--r-- | src/eom-scroll-view.c | 10 | ||||
-rw-r--r-- | src/eom-sidebar.c | 4 |
4 files changed, 42 insertions, 6 deletions
diff --git a/src/eom-print-image-setup.c b/src/eom-print-image-setup.c index f639b01..ee258b5 100644 --- a/src/eom-print-image-setup.c +++ b/src/eom-print-image-setup.c @@ -976,7 +976,11 @@ eom_print_image_setup_init (EomPrintImageSetup *setup) #endif label = gtk_label_new_with_mnemonic (_("_Scaling:")); +#if GTK_CHECK_VERSION (3, 0, 0) + hscale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 1, 100, 1); +#else hscale = gtk_hscale_new_with_range (1, 100, 1); +#endif gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_RIGHT); gtk_range_set_value (GTK_RANGE (hscale), 100); #if GTK_CHECK_VERSION (3, 4, 0) diff --git a/src/eom-print-preview.c b/src/eom-print-preview.c index ba45f8a..a8049b3 100644 --- a/src/eom-print-preview.c +++ b/src/eom-print-preview.c @@ -1017,7 +1017,11 @@ eom_print_preview_draw (EomPrintPreview *preview, cairo_t *cr) GtkWidget *area; GtkAllocation allocation; gint x0, y0; +#if GTK_CHECK_VERSION (3, 4, 0) + GdkRGBA color; +#else GtkStyle *style; +#endif gboolean has_focus; priv = preview->priv; @@ -1025,17 +1029,29 @@ eom_print_preview_draw (EomPrintPreview *preview, cairo_t *cr) has_focus = gtk_widget_has_focus (area); +#if !GTK_CHECK_VERSION (3, 4, 0) style = gtk_widget_get_style (area); +#endif gtk_widget_get_allocation (area, &allocation); /* draw the page */ +#if GTK_CHECK_VERSION (3, 4, 0) + gdk_rgba_parse (&color, "white"); + gdk_cairo_set_source_rgba (cr, &color); +#else gdk_cairo_set_source_color (cr, &style->white); +#endif cairo_rectangle (cr, 0, 0, allocation.width, allocation.height); cairo_fill (cr); /* draw the page margins */ +#if GTK_CHECK_VERSION (3, 4, 0) + gdk_rgba_parse (&color, "black"); + gdk_cairo_set_source_rgba (cr, &color); +#else gdk_cairo_set_source_color (cr, &style->black); +#endif cairo_set_line_width (cr, 0.1); cairo_rectangle (cr, priv->l_rmargin, priv->t_rmargin, @@ -1077,15 +1093,17 @@ eom_print_preview_draw (EomPrintPreview *preview, cairo_t *cr) } if (has_focus) { - #if GTK_CHECK_VERSION(3, 0, 0) - gtk_paint_focus (style, cr, - GTK_STATE_NORMAL, NULL, NULL, - 0, 0, allocation.width, allocation.height); - #else +#if GTK_CHECK_VERSION(3, 0, 0) + GtkStyleContext *ctx; + + ctx = gtk_widget_get_style_context (area); + gtk_render_focus (ctx, cr, 0, 0, + allocation.width, allocation.height); +#else gtk_paint_focus (style, gtk_widget_get_window (area), GTK_STATE_NORMAL, NULL, NULL, NULL, 0, 0, allocation.width, allocation.height); - #endif +#endif } } diff --git a/src/eom-scroll-view.c b/src/eom-scroll-view.c index fc87b5a..81d9d70 100644 --- a/src/eom-scroll-view.c +++ b/src/eom-scroll-view.c @@ -448,9 +448,15 @@ check_scrollbar_visibility (EomScrollView *view, GtkAllocation *alloc) compute_scaled_size (view, priv->zoom, &img_width, &img_height); /* this should work fairly well in this special case for scrollbars */ +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_get_preferred_size (priv->hbar, &req, NULL); + bar_height = req.height; + gtk_widget_get_preferred_size (priv->vbar, &req, NULL); +#else gtk_widget_size_request (priv->hbar, &req); bar_height = req.height; gtk_widget_size_request (priv->vbar, &req); +#endif bar_width = req.width; eom_debug_message (DEBUG_WINDOW, "Widget Size allocate: %i, %i Bar: %i, %i\n", @@ -2481,7 +2487,11 @@ eom_scroll_view_init (EomScrollView *view) G_CALLBACK (adjustment_changed_cb), view); +#if GTK_CHECK_VERSION (3, 0, 0) + priv->hbar = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, priv->hadj); +#else priv->hbar = gtk_hscrollbar_new (priv->hadj); +#endif priv->vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0, 100, 0, 10, 10, 100)); g_signal_connect (priv->vadj, "value_changed", G_CALLBACK (adjustment_changed_cb), diff --git a/src/eom-sidebar.c b/src/eom-sidebar.c index 85a1b2f..0b031f2 100644 --- a/src/eom-sidebar.c +++ b/src/eom-sidebar.c @@ -285,7 +285,11 @@ eom_sidebar_select_button_press_cb (GtkWidget *widget, gtk_widget_get_allocation (widget, &allocation); gtk_widget_set_size_request (eom_sidebar->priv->menu, -1, -1); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_get_preferred_size (eom_sidebar->priv->menu, &requisition, NULL); +#else gtk_widget_size_request (eom_sidebar->priv->menu, &requisition); +#endif gtk_widget_set_size_request (eom_sidebar->priv->menu, MAX (allocation.width, requisition.width), -1); |