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



Author: sdelcroix
Date: Fri Apr 11 15:43:38 2008
New Revision: 3815
URL: http://svn.gnome.org/viewvc/f-spot?rev=3815&view=rev

Log:
2008-04-11  Stephane Delcroix  <sdelcroix novell com>

	* src/Widgets/ComplexMenuItem.cs:
	* src/Widgets/Rating.cs:
	* src/Widgets/RatingMenuItem.cs: Patch from Benjamin Berg to fix
	the issues on the RatingMenuItem. Patch fro Miguel Aguero to 
	display the actual rating in the menu. Fix bgo #510160.



Modified:
   trunk/ChangeLog
   trunk/src/Widgets/ComplexMenuItem.cs
   trunk/src/Widgets/Rating.cs
   trunk/src/Widgets/RatingMenuItem.cs

Modified: trunk/src/Widgets/ComplexMenuItem.cs
==============================================================================
--- trunk/src/Widgets/ComplexMenuItem.cs	(original)
+++ trunk/src/Widgets/ComplexMenuItem.cs	Fri Apr 11 15:43:38 2008
@@ -63,52 +63,6 @@
 		{
 		}
 
-		protected void ConnectChildExpose(Widget widget)
-		{
-			widget.ExposeEvent += OnChildExposeEvent;
-		}
-
-		[GLib.ConnectBefore]
-		private void OnChildExposeEvent(object o, ExposeEventArgs args)
-		{
-			// NOTE: This is a little insane, but it allows packing of EventBox based widgets
-			// into a GtkMenuItem without breaking the theme (leaving an unstyled void in the item).
-			// This method is called before the EventBox child does its drawing and the background
-			// is filled in with the proper style.
-
-			int x, y, width, height;
-			Widget widget = (Widget)o;
-
-			if(IsSelected) {
-				x = Allocation.X - widget.Allocation.X;
-				y = Allocation.Y - widget.Allocation.Y;
-				width = Allocation.Width;
-				height = Allocation.Height;
-
-				ShadowType shadow_type = (ShadowType)StyleGetProperty("selected-shadow-type");
-				Gtk.Style.PaintBox(Style, widget.GdkWindow, StateType.Prelight, shadow_type,
-						args.Event.Area, widget, "menuitem", x, y, width, height);
-			} else {
-				// Fill only the visible area in solid color, to be most efficient
-				widget.GdkWindow.DrawRectangle(Parent.Style.BackgroundGC(StateType.Normal),
-				true, 0, 0, widget.Allocation.Width, widget.Allocation.Height);
-
-				// FIXME: The above should not be necessary, but Clearlooks-based themes apparently
-				// don't provide any style for the menu background so we have to fill it first with
-				// the correct theme color. Weak.
-				//
-				// Do a complete style paint based on the size of the entire menu to be compatible with
-				// themes that provide a real style for "menu"
-				x = Parent.Allocation.X - widget.Allocation.X;
-				y = Parent.Allocation.Y - widget.Allocation.Y;
-				width = Parent.Allocation.Width;
-				height = Parent.Allocation.Height;
-
-				Gtk.Style.PaintBox(Style, widget.GdkWindow, StateType.Normal, ShadowType.Out,
-						args.Event.Area, widget, "menu", x, y, width, height);
-			}
-		}
-
 		protected override void OnSelected()
 		{
 			base.OnSelected();

Modified: trunk/src/Widgets/Rating.cs
==============================================================================
--- trunk/src/Widgets/Rating.cs	(original)
+++ trunk/src/Widgets/Rating.cs	Fri Apr 11 15:43:38 2008
@@ -54,6 +54,7 @@
 			EnterNotifyEvent += HandleMouseEnter;
 			LeaveNotifyEvent += HandleMouseLeave;
 			
+			VisibleWindow = false;
 			CanFocus = true;
 			
 			display_pixbuf = new Pixbuf (Gdk.Colorspace.Rgb, true, 8, Width, Height);

Modified: trunk/src/Widgets/RatingMenuItem.cs
==============================================================================
--- trunk/src/Widgets/RatingMenuItem.cs	(original)
+++ trunk/src/Widgets/RatingMenuItem.cs	Fri Apr 11 15:43:38 2008
@@ -48,14 +48,15 @@
 					GLib.Markup.EscapeText (Catalog.GetString ("Rating:")));
 			box.PackStart (label, false, false, 0);
 
-			entry = new Rating (-1, true);
+			if(MainWindow.Toplevel.Selection.Count==1)
+				entry = new Rating ((int)MainWindow.Toplevel.Selection[0].Rating, true);
+			else
+				entry = new Rating (-1, true);
 			entry.Changed += OnEntryChanged;
 			box.PackStart (entry, false, false, 0);
 
 			box.ShowAll ();
 			Add (box);
-
-			ConnectChildExpose (entry);
 		}
 
 		protected override void OnRealized ()



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