[gnote] Fix some shortcuts, that are added by context menu



commit b937ed5a70f6ff09050a579a6b23bcc2eb56fc56
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Feb 18 18:41:39 2018 +0200

    Fix some shortcuts, that are added by context menu
    
    Thanks zhengqiang
    Fixes Bug 792859

 src/searchnoteswidget.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/searchnoteswidget.cpp b/src/searchnoteswidget.cpp
index 9aa7bed..0153509 100644
--- a/src/searchnoteswidget.cpp
+++ b/src/searchnoteswidget.cpp
@@ -946,6 +946,9 @@ bool SearchNotesWidget::on_treeview_button_released(GdkEventButton *ev)
 
 bool SearchNotesWidget::on_treeview_key_pressed(GdkEventKey * ev)
 {
+  // create context menu here, so that we have shortcuts and they work
+  Gtk::Menu *menu = get_note_list_context_menu();
+
   switch(ev->keyval) {
   case GDK_KEY_Delete:
     delete_selected_notes();
@@ -955,7 +958,6 @@ bool SearchNotesWidget::on_treeview_key_pressed(GdkEventKey * ev)
     // Pop up the context menu if a note is selected
     Note::List selected_notes = get_selected_notes();
     if(!selected_notes.empty()) {
-      Gtk::Menu *menu = get_note_list_context_menu();
       popup_context_menu_at_location(menu, 0, 0);
     }
     break;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]