[simple-scan] Support A3 paper size
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [simple-scan] Support A3 paper size
- Date: Mon, 25 Jun 2018 22:01:36 +0000 (UTC)
commit 314e779faa128af76eead56a0dbfd887d9f91f41
Author: Robert Ancell <robert ancell canonical com>
Date: Tue Jun 26 09:50:17 2018 +1200
Support A3 paper size
src/app-window.ui | 11 +++++++++++
src/app-window.vala | 13 ++++++++++++-
src/page.vala | 4 ++++
src/preferences-dialog.vala | 2 ++
4 files changed, 29 insertions(+), 1 deletion(-)
---
diff --git a/src/app-window.ui b/src/app-window.ui
index bbdf1c7..6e13088 100644
--- a/src/app-window.ui
+++ b/src/app-window.ui
@@ -390,6 +390,17 @@
<signal name="toggled" handler="four_by_six_menuitem_toggled_cb"
swapped="no"/>
</object>
</child>
+ <child>
+ <object class="GtkRadioMenuItem" id="a3_menuitem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" comments="Radio button for
cropping page to A3">A_3</property>
+ <property name="use_underline">True</property>
+ <property name="draw_as_radio">True</property>
+ <property name="group">no_crop_menuitem</property>
+ <signal name="toggled" handler="a3_menuitem_toggled_cb" swapped="no"/>
+ </object>
+ </child>
<child>
<object class="GtkRadioMenuItem" id="custom_crop_menuitem">
<property name="visible">True</property>
diff --git a/src/app-window.vala b/src/app-window.vala
index d956c08..b5d405d 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -52,6 +52,8 @@ public class AppWindow : Gtk.ApplicationWindow
[GtkChild]
private Gtk.RadioMenuItem custom_crop_menuitem;
[GtkChild]
+ private Gtk.RadioMenuItem a3_menuitem;
+ [GtkChild]
private Gtk.RadioMenuItem a4_menuitem;
[GtkChild]
private Gtk.RadioMenuItem a5_menuitem;
@@ -762,7 +764,9 @@ public class AppWindow : Gtk.ApplicationWindow
var crop_name = page.crop_name;
if (crop_name != null)
{
- if (crop_name == "A4")
+ if (crop_name == "A3")
+ menuitem = a3_menuitem;
+ else if (crop_name == "A4")
menuitem = a4_menuitem;
else if (crop_name == "A5")
menuitem = a5_menuitem;
@@ -924,6 +928,13 @@ public class AppWindow : Gtk.ApplicationWindow
set_crop ("A4");
}
+ [GtkCallback]
+ private void a3_menuitem_toggled_cb (Gtk.CheckMenuItem widget)
+ {
+ if (widget.active)
+ set_crop ("A3");
+ }
+
[GtkCallback]
private void crop_rotate_menuitem_activate_cb (Gtk.Widget widget)
{
diff --git a/src/page.vala b/src/page.vala
index c859df9..13de4d2 100644
--- a/src/page.vala
+++ b/src/page.vala
@@ -399,6 +399,10 @@ public class Page
double w, h;
switch (name)
{
+ case "A3":
+ w = 11.7;
+ h = 16.5;
+ break;
case "A4":
w = 8.3;
h = 11.7;
diff --git a/src/preferences-dialog.vala b/src/preferences-dialog.vala
index 962fa79..d58c066 100644
--- a/src/preferences-dialog.vala
+++ b/src/preferences-dialog.vala
@@ -82,6 +82,8 @@ private class PreferencesDialog : Gtk.Dialog
paper_size_model.append (out iter);
paper_size_model.set (iter, 0, 2100, 1, 2970, 2, "A4", -1);
paper_size_model.append (out iter);
+ paper_size_model.set (iter, 0, 2970, 1, 4200, 2, "A3", -1);
+ paper_size_model.append (out iter);
paper_size_model.set (iter, 0, 2159, 1, 2794, 2, "Letter", -1);
paper_size_model.append (out iter);
paper_size_model.set (iter, 0, 2159, 1, 3556, 2, "Legal", -1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]