[Monodevelop-patches-list] r507 - trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Fri Jan 16 21:58:10 EST 2004


Author: tberman
Date: 2004-01-16 21:58:10 -0500 (Fri, 16 Jan 2004)
New Revision: 507

Modified:
   trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/CompletionWindow.cs
Log:
fixing the tooltip vert and horiz position
now to fix the right vs left stuff.


Modified: trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/CompletionWindow.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/CompletionWindow.cs	2004-01-17 02:13:26 UTC (rev 506)
+++ trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/CompletionWindow.cs	2004-01-17 02:58:10 UTC (rev 507)
@@ -296,10 +296,20 @@
 				Gtk.TreePath path = store.GetPath (iter);
 				Gdk.Rectangle rect;
 				rect = listView.GetCellArea (path, (Gtk.TreeViewColumn)listView.Columns[0]);
+
+				int x, y;
+				listView.TreeToWidgetCoords (rect.x, rect.y, out x, out y);
+				
 				int listpos_x, listpos_y;
 				listView.GdkWindow.GetOrigin (out listpos_x, out listpos_y);
 				int vert = listpos_y + rect.y;
 
+				if (vert > listpos_y + listView.GdkWindow.Size.Height) {
+					vert = listpos_y + listView.GdkWindow.Size.Height - rect.height;
+				} else if (vert < listpos_y) {
+					vert = listpos_y;
+				}
+
 				//FIXME: This is a bad calc, its always on the right, it needs to test if thats too big, and if so, place on the left;
 				int horiz = listpos_x + listView.GdkWindow.Size.Width + 30;
 				ICompletionDataWithMarkup wMarkup = data as ICompletionDataWithMarkup;
@@ -311,6 +321,6 @@
 				declarationviewwindow.ShowAll ();
 				declarationviewwindow.Move (horiz, vert);
 			}
-		}
-	}
-}
+		}
+	}
+}




More information about the Monodevelop-patches-list mailing list