Fullscreen exit keys



Hello everyone,

I've been using F-Spot for a little while now and finally decided to
start proposing patches.  I'll start with a small one - still getting
used to the code :-).

First of all let me describe quickly what I am mainly looking for in a
photo management software:
1 - Adding metadata
2 - Quick search (visual, time, metadata)
3 - Enjoy photos in fullscreen (easy navigation and zoom to see the details :-))

I previously used GQview and loved it for its simplicity: easy folder
navigation (neatly arranged by date as you can guess), thumbnails,
easy Exif data access and clean fullscreen.  F-Spot offers a better
way of doing 1 and 2 and I love it for that.

Attached is a patch changing the behavior of the fullscreen mode when
a key is pressed.  I was sort of getting irritated by the fullscreen
exiting each time I was pressing the wrong key :-(  Since I cannot fix
the guy, I am trying to fix the software...

Here is what it does:
- Ignore some tools that screw up everything (sharpen and loupe)
- Handle events as it used to do
- Exit _only_ if one of those key is pressed: f, F, F11 and Escape.

Simple stuff.  If it's worthy of attention, I'll had it to bugzilla.

Cheers,

Cosme
Index: src/FullScreenView.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/FullScreenView.cs,v
retrieving revision 1.16
diff -u -p -r1.16 FullScreenView.cs
--- src/FullScreenView.cs	24 May 2006 06:59:15 -0000	1.16
+++ src/FullScreenView.cs	14 Jul 2006 17:44:20 -0000
@@ -145,13 +145,32 @@ namespace FSpot {
 				System.Console.WriteLine ("view == null", key);
 				return false;
 			}
+			
+			bool event_handled = false;
+			
+			switch (key.Key) {
+			case Gdk.Key.s: // Sharpen
+			case Gdk.Key.v: // Loupe
+				break; // Ignoring those keys
+			default:
+				event_handled = base.OnKeyPressEvent (key);
+				break;
+			}
 
-			bool retval = base.OnKeyPressEvent (key);
-			if (!retval)
-				this.Destroy ();
-			else 
+			if (!event_handled) {
+				switch (key.Key) {
+				case Gdk.Key.F:
+				case Gdk.Key.f:
+				case Gdk.Key.F11:
+				case Gdk.Key.Escape:
+					this.Destroy (); // Exit fullscreen only for those keys
+					break;
+				default:
+					break;
+				}
+			} else 
 				view.Fit = false;
-			return retval;
+			return event_handled;
 		}
 	}
 }


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