Make escape close current view in gtk
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 3 Dec 2009 15:43:44 +0000 (16:43 +0100)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 3 Dec 2009 15:43:45 +0000 (16:43 +0100)
src/widgets/modest-window.c

index 9c7e64c..dd7d9db 100644 (file)
@@ -610,12 +610,20 @@ on_key_pressed (GtkWidget *self,
                return TRUE;
 #endif
        case GDK_Escape: 
-               if (modest_window_mgr_get_fullscreen_mode (mgr))
+               if (modest_window_mgr_get_fullscreen_mode (mgr)) {
                        modest_ui_actions_on_change_fullscreen (NULL, MODEST_WINDOW(self));
-               else if (MODEST_IS_MSG_VIEW_WINDOW (self))
+                       return TRUE;
+               } else {
+#ifdef MODEST_TOOLKIT_HILDON2
+                       if (MODEST_IS_MSG_VIEW_WINDOW (self)) {
+                               modest_ui_actions_on_close_window (NULL, MODEST_WINDOW (self));
+                               return TRUE;
+                       }
+#else
                        modest_ui_actions_on_close_window (NULL, MODEST_WINDOW (self));
-               else
-                       return FALSE;
+                       return TRUE;
+#endif
+               }
                break;
        }