[MPlayer-cvslog] r36191 - trunk/gui/dialog/fileselect.c

ib subversion at mplayerhq.hu
Tue Apr 30 13:52:15 CEST 2013


Author: ib
Date: Tue Apr 30 13:52:15 2013
New Revision: 36191

Log:
Redesign on_FileSelect_key_release_event().

This will ease adding further key_release_event signals.

Modified:
   trunk/gui/dialog/fileselect.c

Modified: trunk/gui/dialog/fileselect.c
==============================================================================
--- trunk/gui/dialog/fileselect.c	Tue Apr 30 12:46:11 2013	(r36190)
+++ trunk/gui/dialog/fileselect.c	Tue Apr 30 13:52:15 2013	(r36191)
@@ -532,24 +532,31 @@ static gboolean on_FileSelect_key_releas
 {
     (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;
         }
+
+            break;
     }
 
     return FALSE;


More information about the MPlayer-cvslog mailing list