From 8ed7ac8b746dbc27671adc991ec000a767482277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20S=C3=A1nchez?= Date: Sat, 22 Apr 2017 14:17:56 +0200 Subject: Printing paper orientation should default based on image dimensions Now, the default paper orientation in print settings is based on image dimensions. https://bugzilla.gnome.org/show_bug.cgi?id=531898 taken from: https://git.gnome.org/browse/eog/commit/?id=5aebb88 --- src/eom-print.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/eom-print.c b/src/eom-print.c index 54db68e..4d20a29 100644 --- a/src/eom-print.c +++ b/src/eom-print.c @@ -317,6 +317,7 @@ eom_print_operation_new (EomImage *image, { GtkPrintOperation *print; EomPrintData *data; + gint width, height; eom_debug (DEBUG_PRINTING); @@ -330,6 +331,19 @@ eom_print_operation_new (EomImage *image, data->image = g_object_ref (image); data->unit = GTK_UNIT_INCH; + eom_image_get_size (image, &width, &height); + + if (page_setup == NULL) + page_setup = gtk_page_setup_new (); + + if (height >= width) { + gtk_page_setup_set_orientation (page_setup, + GTK_PAGE_ORIENTATION_PORTRAIT); + } else { + gtk_page_setup_set_orientation (page_setup, + GTK_PAGE_ORIENTATION_LANDSCAPE); + } + gtk_print_operation_set_print_settings (print, print_settings); gtk_print_operation_set_default_page_setup (print, page_setup); -- cgit v1.2.1