summaryrefslogtreecommitdiff
path: root/libview/ev-print-operation.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-23 00:22:11 +0200
committerraveit65 <[email protected]>2016-06-24 20:48:20 +0200
commitf320383369c4105e8076a0a5248a728fac76a0c0 (patch)
tree6197bb42e94e0a7e06a19489b2e301edbee45729 /libview/ev-print-operation.c
parentf87c11ab0472e8a105c2aaab8ba97886960c141f (diff)
downloadatril-f320383369c4105e8076a0a5248a728fac76a0c0.tar.bz2
atril-f320383369c4105e8076a0a5248a728fac76a0c0.tar.xz
GTK+-3: Use GtkGrid instead of GtkTable
taken from: https://git.gnome.org/browse/evince/commit/?id=da8f31e
Diffstat (limited to 'libview/ev-print-operation.c')
-rw-r--r--libview/ev-print-operation.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/libview/ev-print-operation.c b/libview/ev-print-operation.c
index 6b972f4e..bd6ef328 100644
--- a/libview/ev-print-operation.c
+++ b/libview/ev-print-operation.c
@@ -1872,7 +1872,11 @@ ev_print_operation_print_create_custom_widget (EvPrintOperationPrint *print,
{
GtkPrintSettings *settings;
GtkWidget *label;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkWidget *grid;
+#else
GtkWidget *table;
+#endif
EvPrintScale page_scale;
gboolean autorotate;
gboolean use_source_size;
@@ -1884,6 +1888,15 @@ ev_print_operation_print_create_custom_widget (EvPrintOperationPrint *print,
TRUE;
use_source_size = gtk_print_settings_get_bool (settings, EV_PRINT_SETTING_PAGE_SIZE);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ grid = gtk_grid_new ();
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
+ gtk_container_set_border_width (GTK_CONTAINER (grid), 12);
+
+ label = gtk_label_new (_("Page Scaling:"));
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
+#else
table = gtk_table_new (3, 2, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
@@ -1891,6 +1904,7 @@ ev_print_operation_print_create_custom_widget (EvPrintOperationPrint *print,
label = gtk_label_new (_("Page Scaling:"));
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
+#endif
gtk_widget_show (label);
print->scale_combo = gtk_combo_box_text_new ();
@@ -1908,7 +1922,11 @@ ev_print_operation_print_create_custom_widget (EvPrintOperationPrint *print,
"\n"
"• \"Fit to Printable Area\": Document pages are enlarged or reduced as"
" required to fit the printable area of the printer page.\n"));
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_grid_attach (GTK_GRID (grid), print->scale_combo, 1, 0, 1, 1);
+#else
gtk_table_attach (GTK_TABLE (table), print->scale_combo, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
+#endif
gtk_widget_show (print->scale_combo);
print->autorotate_button = gtk_check_button_new_with_label (_("Auto Rotate and Center"));
@@ -1916,17 +1934,28 @@ ev_print_operation_print_create_custom_widget (EvPrintOperationPrint *print,
gtk_widget_set_tooltip_text (print->autorotate_button,
_("Rotate printer page orientation of each page to match orientation of each document page. "
"Document pages will be centered within the printer page."));
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_grid_attach (GTK_GRID (grid), print->autorotate_button, 0, 1, 2, 1);
+#else
gtk_table_attach (GTK_TABLE (table), print->autorotate_button, 0, 2, 1, 2, GTK_FILL, 0, 0, 0);
+#endif
gtk_widget_show (print->autorotate_button);
print->source_button = gtk_check_button_new_with_label (_("Select page size using document page size"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (print->source_button), use_source_size);
gtk_widget_set_tooltip_text (print->source_button, _("When enabled, each page will be printed on "
"the same size paper as the document page."));
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_grid_attach (GTK_GRID (grid), print->source_button, 0, 2, 2, 1);
+ gtk_widget_show (print->source_button);
+
+ return G_OBJECT (grid);
+#else
gtk_table_attach (GTK_TABLE (table), print->source_button, 0, 2, 2, 3, GTK_FILL, 0, 0, 0);
gtk_widget_show (print->source_button);
return G_OBJECT (table);
+#endif
}
static void