changeset 36097:64282f0366c6

Redesign on_FileSelect_key_release_event(). This will ease adding further key_release_event signals.
author ib
date Tue, 30 Apr 2013 11:52:15 +0000
parents 2edbcc85bf5a
children b643292a330a
files gui/dialog/fileselect.c
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gui/dialog/fileselect.c	Tue Apr 30 10:46:11 2013 +0000
+++ b/gui/dialog/fileselect.c	Tue Apr 30 11:52:15 2013 +0000
@@ -532,24 +532,31 @@
 {
     (void)user_data;
 
-    if (GTK_WIDGET_TYPE(widget) == GTK_TYPE_BUTTON) {
-        if (event->key.keyval == GDK_Return)
-            gtk_button_released(GTK_BUTTON(widget));
-    } else {
         switch (event->key.keyval) {
         case GDK_Escape:
+
+        if (GTK_IS_SCROLLED_WINDOW(widget))
             gtk_button_released(GTK_BUTTON(fsCancel));
+
             break;
 
         case GDK_Return:
+
+        if (GTK_IS_SCROLLED_WINDOW(widget))
             gtk_button_released(GTK_BUTTON(fsOk));
+        else if (GTK_IS_BUTTON(widget))
+            gtk_button_released(GTK_BUTTON(widget));
+
             break;
 
         case GDK_BackSpace:
+
+        if (GTK_IS_SCROLLED_WINDOW(widget)) {
             gtk_button_released(GTK_BUTTON(fsUp));
             gtk_widget_grab_focus(fsFNameList);
+        }
+
             break;
-        }
     }
 
     return FALSE;