f-spot r4248 - in trunk: . src src/Editors src/Widgets



Author: rubenv
Date: Tue Aug 12 18:52:27 2008
New Revision: 4248
URL: http://svn.gnome.org/viewvc/f-spot?rev=4248&view=rev

Log:
2008-08-12  Ruben Vermeersch  <ruben savanne be>

	* src/Editors/Editor.cs: Properly update the histogram on preview.

	* src/MainWindow.cs: Make the InfoBox accessible.

	* src/Widgets/InfoBox.cs: Allow passing a histogram hint.


Modified:
   trunk/ChangeLog
   trunk/src/Editors/Editor.cs
   trunk/src/MainWindow.cs
   trunk/src/Widgets/InfoBox.cs

Modified: trunk/src/Editors/Editor.cs
==============================================================================
--- trunk/src/Editors/Editor.cs	(original)
+++ trunk/src/Editors/Editor.cs	Tue Aug 12 18:52:27 2008
@@ -178,6 +178,7 @@
 			Pixbuf previewed = ProcessFast (preview, null);
 			State.PhotoImageView.Pixbuf = previewed;
 			State.PhotoImageView.ZoomFit (false);
+			MainWindow.Toplevel.InfoBox.UpdateHistogram (previewed);
 		}
 
 		private void CalcPreviewSize (Pixbuf input, out int width, out int height) {
@@ -205,6 +206,8 @@
 			if (original != null && State.PhotoImageView != null) {
 				State.PhotoImageView.Pixbuf = original;
 				State.PhotoImageView.ZoomFit (false);
+
+				MainWindow.Toplevel.InfoBox.UpdateHistogram (original);
 			}
 
 			Reset ();

Modified: trunk/src/MainWindow.cs
==============================================================================
--- trunk/src/MainWindow.cs	(original)
+++ trunk/src/MainWindow.cs	Tue Aug 12 18:52:27 2008
@@ -233,6 +233,10 @@
         get { return find_by_tag; }
     }
 
+	public InfoBox InfoBox {
+		get { return info_box; }
+	}
+
 	//
 	// Constructor
 	//

Modified: trunk/src/Widgets/InfoBox.cs
==============================================================================
--- trunk/src/Widgets/InfoBox.cs	(original)
+++ trunk/src/Widgets/InfoBox.cs	Tue Aug 12 18:52:27 2008
@@ -438,6 +438,8 @@
 			size_value_label.Visible = false;
 		}
 
+		private Gdk.Pixbuf histogram_hint;
+
 		private void UpdateHistogram ()
 		{
 			if (histogram_expander.Expanded && histogram_delay == null) {
@@ -446,6 +448,11 @@
 			}
 		}
 
+		public void UpdateHistogram (Gdk.Pixbuf pixbuf) {
+			histogram_hint = pixbuf;
+			UpdateHistogram ();
+		}
+
 		private bool DelayedUpdateHistogram () {
 			histogram_delay = null;
 
@@ -455,12 +462,17 @@
 			Photo photo = Photos[0];
 
 			try {
-				using (ImageFile img = ImageFile.Create (photo.DefaultVersionUri))
-				{
-					histogram.FillValues (img.Load (256, 256));
-					int max = histogram_expander.Allocation.Width;
-					histogram_image.Pixbuf = histogram.GeneratePixbuf (max);
-				}
+				if (histogram_hint == null)
+					using (ImageFile img = ImageFile.Create (photo.DefaultVersionUri))
+						histogram_hint = img.Load (256, 256);
+
+
+				histogram.FillValues (histogram_hint);
+				int max = histogram_expander.Allocation.Width;
+				histogram_image.Pixbuf = histogram.GeneratePixbuf (max);
+
+				histogram_hint.Dispose ();
+				histogram_hint = null;
 			} catch (System.Exception e) {
 				Log.Debug (e.StackTrace);
 			}



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