Re: [Muine] minor annoyance with tray icon menu



On Sun, 2004-02-29 at 13:36 +0100, Vaclav Slavik wrote:

> There's a little annoyance 
> with the menu, though: I have the panel positioned on bottom of the 
> screen instead of top as is GNOME's default and the menu pops up 
> empty with an arrow on the bottom that I must hover over to scroll 
> the menu into being fully visible (see a small screenshot that 
> captures the menu in process of scrolling:

Spooky - I noticed this morning and was discussing it with Jorn. 

Can you try the attached patch and see if that helps?

> BTW, it would be nice to be able to drag cover images over to Play 
> Album dialog as well, it would ease things when you're trying to add 
> covers for several albums that don't have them...

Hmm - I thought that too - and did try to make it work, unfortunately it
requires some fairly crazy GTK voodoo (Overriding CellRenderers) and it
was a bit beyond me - Jorn can probably work it out though!

Lee
Index: src/NotificationAreaIcon.cs
===================================================================
RCS file: /cvs/gnome/muine/src/NotificationAreaIcon.cs,v
retrieving revision 1.13
diff -u -r1.13 NotificationAreaIcon.cs
--- src/NotificationAreaIcon.cs	27 Feb 2004 21:38:11 -0000	1.13
+++ src/NotificationAreaIcon.cs	29 Feb 2004 14:48:58 -0000
@@ -190,6 +190,23 @@
 
 	private void PositionMenu (Menu menu, out int x, out int y, out bool push_in)
 	{
+		// Get menu size
+		Requisition menu_size = new Requisition();
+		menu.SizeRequest (ref menu_size);
+
+		// Get screen size
+		Screen screen = Gdk.Screen.Default;
+		int screen_x = screen.Width;
+		int screen_y = screen.Height;
+
+		// Now we know how big the menu is, make sure it fits on screen
+		if (menu_x + menu_size.Width > screen_x) {
+			menu_x = screen_x - menu_size.Width - ebox.Allocation.Width;
+		}
+		if (menu_y + menu_size.Height > screen_y) {
+			menu_y = screen_y - menu_size.Height - ebox.Allocation.Height;
+		}
+
 		x = menu_x;
 		y = menu_y;
 


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