[banshee/gtk3] DateButton: Update size calculation to use GetPreferredHeight



commit 952cf823ad1124168f669d27ebc856e99334e9ca
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Thu Jul 21 21:46:02 2011 +0200

    DateButton: Update size calculation to use GetPreferredHeight

 .../Banshee.Widgets/Banshee.Widgets/DateButton.cs  |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/Core/Banshee.Widgets/Banshee.Widgets/DateButton.cs b/src/Core/Banshee.Widgets/Banshee.Widgets/DateButton.cs
index f56f1ef..ba5d031 100644
--- a/src/Core/Banshee.Widgets/Banshee.Widgets/DateButton.cs
+++ b/src/Core/Banshee.Widgets/Banshee.Widgets/DateButton.cs
@@ -81,23 +81,24 @@ namespace Banshee.Widgets
 			calAlignment.Add(cal);
 		
 			box.PackStart(calAlignment, false, false, 0);
-				
-			Requisition req = SizeRequest();
+
+			int minimum_height, natural_height;
+			GetPreferredHeight (out minimum_height, out natural_height);
 			int x = 0, y = 0;
-			GdkWindow.GetOrigin(out x, out y);
-			popup.Move(x + Allocation.X, y + Allocation.Y + req.Height + 3);
+			Window.GetOrigin(out x, out y);
+			popup.Move(x + Allocation.X, y + Allocation.Y + natural_height + 3);
 			popup.Show();
 			popup.GrabFocus();
 				
 			Grab.Add(popup);
 
-			Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.GdkWindow, true,
+			Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.Window, true,
 				Gdk.EventMask.ButtonPressMask
 				| Gdk.EventMask.ButtonReleaseMask
 				| Gdk.EventMask.PointerMotionMask, null, null, CURRENT_TIME);
 
 			if(grabbed == Gdk.GrabStatus.Success) {
-				grabbed = Gdk.Keyboard.Grab(popup.GdkWindow,
+				grabbed = Gdk.Keyboard.Grab(popup.Window,
 					true, CURRENT_TIME);
 
 				if(grabbed != Gdk.GrabStatus.Success) {



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