f-spot r3805 - in trunk: . src src/Widgets



Author: sdelcroix
Date: Wed Apr  2 14:24:14 2008
New Revision: 3805
URL: http://svn.gnome.org/viewvc/f-spot?rev=3805&view=rev

Log:
2008-04-02  Lorenzo Milesi <maxxer yetopen it>

	* src/PixbufUtils.cs: 
	* src/Widgets/FilmStrip.cs: optional default squared thumbs for 
	filmstrip. Speed up scroll.	


Modified:
   trunk/ChangeLog
   trunk/src/PixbufUtils.cs
   trunk/src/Widgets/Filmstrip.cs

Modified: trunk/src/PixbufUtils.cs
==============================================================================
--- trunk/src/PixbufUtils.cs	(original)
+++ trunk/src/PixbufUtils.cs	Wed Apr  2 14:24:14 2008
@@ -350,7 +350,11 @@
 	
 	public static Pixbuf TagIconFromPixbuf (Pixbuf source)
 	{
-		int size = (int) Tag.IconSize.Large;
+		return IconFromPixbuf (source, (int) Tag.IconSize.Large);
+	}
+
+	public static Pixbuf IconFromPixbuf (Pixbuf source, int size)
+	{
 		Pixbuf tmp = null;
 		Pixbuf icon = null;
 

Modified: trunk/src/Widgets/Filmstrip.cs
==============================================================================
--- trunk/src/Widgets/Filmstrip.cs	(original)
+++ trunk/src/Widgets/Filmstrip.cs	Wed Apr  2 14:24:14 2008
@@ -78,6 +78,12 @@
 			}
 		}
 
+		bool squared_thumbs = false;
+		public bool SquaredThumbs {
+			get { return squared_thumbs; }
+			set { squared_thumbs = value; }
+		}
+
 		static string [] film_100_xpm = {
 		"14 100 2 1",
 		" 	c None",
@@ -292,13 +298,16 @@
 		FSpot.BrowsablePointer selection;
 		ThumbnailCache thumb_cache;
 
-		public Filmstrip (FSpot.BrowsablePointer selection) : base ()
+		public Filmstrip (FSpot.BrowsablePointer selection) : this (selection, true) { }
+
+		public Filmstrip (FSpot.BrowsablePointer selection, bool squared_thumbs) : base ()
 		{
 			CanFocus = true;
 			this.selection = selection;
 			this.selection.Changed += HandlePointerChanged;
 			this.selection.Collection.Changed += HandleCollectionChanged;
 			this.selection.Collection.ItemsChanged += HandleCollectionItemsChanged;
+			this.squared_thumbs = squared_thumbs;
 			thumb_cache = new ThumbnailCache (30);
 		}
 	
@@ -405,9 +414,9 @@
 
 		protected override bool OnScrollEvent (EventScroll args)
 		{
-			float shift = .5f;
+			float shift = 1.0f;
 			if ((args.State & Gdk.ModifierType.ShiftMask) > 0)
-				shift = 5f;
+				shift = 6f;
 
 			switch (args.Direction) {
 			case ScrollDirection.Up:
@@ -487,7 +496,11 @@
 
 			if (current == null) {
 				try {
-					current = new Pixbuf (thumb_path, -1, ThumbSize);
+					if (SquaredThumbs) {
+						current = new Pixbuf (thumb_path);
+						current = PixbufUtils.IconFromPixbuf (current, ThumbSize);
+					} else 
+						current = new Pixbuf (thumb_path, -1, ThumbSize);
 					thumb_cache.AddThumbnail (thumb_path, current);
 				} catch {
 					try {



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