[gnote] Go to all notes on escape in note



commit 382ee5ae8338d1e7b6a5f34208525fed4b5987c7
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Sat Oct 27 18:55:46 2012 +0300

    Go to all notes on escape in note
    
    When note is shown and escape is pressed, go to All Notes.

 src/notewindow.cpp    |    1 -
 src/recentchanges.cpp |   11 ++++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index 320a45b..06e4277 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -266,7 +266,6 @@ namespace gnote {
       if (m_find_bar && m_find_bar->get_visible()) {
         m_find_bar->hide();
       }
-      return true;
     }
     return false;
   }
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index 01065f1..e694f5d 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -182,7 +182,16 @@ namespace gnote {
     switch (ev->keyval) {
     case GDK_KEY_Escape:
       // Allow Escape to close the window
-      on_close_window ();
+      if(&m_search_notes_widget == dynamic_cast<SearchNotesWidget*>(currently_embeded())) {
+        on_close_window();
+      }
+      else {
+        utils::EmbedableWidget *current_item = currently_embeded();
+        if(current_item) {
+          background_embeded(*current_item);
+        }
+        foreground_embeded(m_search_notes_widget);
+      }
       break;
     default:
       break;



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