summaryrefslogtreecommitdiff
path: root/src/app-window.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-09-05 17:20:51 +0200
committerJörg Frings-Fürst <debian@jff.email>2018-09-05 17:20:51 +0200
commit70e9dfc97f5a3c3bde70547a0a7d586d187f7245 (patch)
tree7bc1feeb2c3fe963185697c4c8eec4b717318938 /src/app-window.vala
parent3fbb9230e021593a66363b97e9da4fd3f3c64c62 (diff)
parentcceb61b6d24cf8e9f915247c2a09ead260c6834b (diff)
Merge branch 'release/debian/3.30.0-1'debian/3.30.0-1
Diffstat (limited to 'src/app-window.vala')
-rw-r--r--src/app-window.vala53
1 files changed, 27 insertions, 26 deletions
diff --git a/src/app-window.vala b/src/app-window.vala
index 1475e0a..153b975 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;
@@ -814,9 +818,9 @@ public class AppWindow : Gtk.ApplicationWindow
}
}
- private void show_page_menu_cb (BookView view)
+ private void show_page_menu_cb (BookView view, Gdk.Event event)
{
- page_menu.popup (null, null, null, 3, Gtk.get_current_event_time ());
+ page_menu.popup_at_pointer (event);
}
[GtkCallback]
@@ -925,6 +929,13 @@ public class AppWindow : Gtk.ApplicationWindow
}
[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)
{
var page = book_view.selected_page;
@@ -1068,7 +1079,7 @@ public class AppWindow : Gtk.ApplicationWindow
{
if (items[i] == '-')
{
- var a = new Gtk.Arrow (Gtk.ArrowType.RIGHT, Gtk.ShadowType.NONE);
+ var a = new Gtk.Label ("➤");
a.visible = true;
box.pack_start (a, false, false, 0);
page_box = null;
@@ -1561,34 +1572,24 @@ public class AppWindow : Gtk.ApplicationWindow
app.add_action_entries (action_entries, this);
- var appmenu = new Menu ();
-
- var section = new Menu ();
- appmenu.append_section (null, section);
- section.append (_("Preferences"), "app.preferences");
-
- section = new Menu ();
- appmenu.append_section (null, section);
- section.append (_("Keyboard Shortcuts"), "win.show-help-overlay");
- section.append (_("Help"), "app.help");
- section.append (_("About"), "app.about");
- section.append (_("Quit"), "app.quit");
-
- app.app_menu = appmenu;
-
- app.add_accelerator ("<Ctrl>N", "app.new_document", null);
- app.add_accelerator ("<Ctrl>S", "app.save", null);
- app.add_accelerator ("<Ctrl>E", "app.email", null);
- app.add_accelerator ("<Ctrl>P", "app.print", null);
- app.add_accelerator ("F1", "app.help", null);
- app.add_accelerator ("<Ctrl>Q", "app.quit", null);
+ app.set_accels_for_action ("app.new_document", { "<Ctrl>N" });
+ app.set_accels_for_action ("app.save", { "<Ctrl>S" });
+ app.set_accels_for_action ("app.email", { "<Ctrl>E" });
+ app.set_accels_for_action ("app.print", { "<Ctrl>P" });
+ app.set_accels_for_action ("app.help", { "F1" });
+ app.set_accels_for_action ("app.quit", { "<Ctrl>Q" });
var gear_menu = new Menu ();
- section = new Menu ();
+ var section = new Menu ();
gear_menu.append_section (null, section);
section.append (_("Email"), "app.email");
section.append (_("Reorder Pages"), "app.reorder");
+ section = new Menu ();
+ gear_menu.append_section (null, section);
section.append (_("Preferences"), "app.preferences");
+ section.append (_("Keyboard Shortcuts"), "win.show-help-overlay");
+ section.append (_("Help"), "app.help");
+ section.append (_("About"), "app.about");
menu_button.set_menu_model (gear_menu);
}
app.add_window (this);