[gnome-boxes] collection-view: Show context menu on menu key
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] collection-view: Show context menu on menu key
- Date: Fri, 14 Nov 2014 17:42:35 +0000 (UTC)
commit 67de3436b18b0e7e8c53c24102e9b553606c982b
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Fri Nov 14 14:15:20 2014 +0000
collection-view: Show context menu on menu key
Show ActionsPopover when user presses menu key when keyboard cursor is
on an item.
https://bugzilla.gnome.org/show_bug.cgi?id=738761
src/collection-view.vala | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/collection-view.vala b/src/collection-view.vala
index a49fa01..b610ff6 100644
--- a/src/collection-view.vala
+++ b/src/collection-view.vala
@@ -53,6 +53,7 @@ private class Boxes.CollectionView: Gd.MainView, Boxes.UI {
var icon_view = get_generic_view () as Gtk.IconView;
icon_view.button_release_event.connect (on_button_press_event);
+ icon_view.key_press_event.connect (on_key_press_event);
context_popover = new Boxes.ActionsPopover (window);
context_popover.relative_to = icon_view;
}
@@ -379,6 +380,19 @@ private class Boxes.CollectionView: Gd.MainView, Boxes.UI {
return launch_context_popover_for_path (path);
}
+ private bool on_key_press_event (Gdk.EventKey event) {
+ if (event.keyval != Gdk.Key.Menu)
+ return false;
+
+ var icon_view = get_generic_view () as Gtk.IconView;
+ Gtk.TreePath path;
+ Gtk.CellRenderer cell;
+ if (!icon_view.get_cursor (out path, out cell))
+ return false;
+
+ return launch_context_popover_for_path (path);
+ }
+
private bool launch_context_popover_for_path (Gtk.TreePath path) {
var item = get_item_for_path (path);
if (item == null)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]