[Monodevelop-patches-list] r2617 - in trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor: . CodeCompletion
Jacob Ilsø Christensen <jacobilsoe@gmail.com>
jacobilsoe at mono-cvs.ximian.com
Fri Jul 1 09:48:29 EDT 2005
Author: jacobilsoe
Date: 2005-07-01 09:48:29 -0400 (Fri, 01 Jul 2005)
New Revision: 2617
Modified:
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ListWindow.cs
Log:
Make sure the list window is no larger than necessary
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2005-06-30 18:30:47 UTC (rev 2616)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2005-07-01 13:48:29 UTC (rev 2617)
@@ -1,3 +1,8 @@
+2005-07-01 Jacob Ilsø Christensen <jacobilsoe at gmail.com>
+
+ * CodeCompletion/ListWindow.cs: Make sure the list
+ window is no larger than necessary.
+
2005-06-28 Raja R Harinath <rharinath at novell.com>
* Makefile.am (FILES): Move AssemblyInfo.cs ...
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ListWindow.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ListWindow.cs 2005-06-30 18:30:47 UTC (rev 2616)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ListWindow.cs 2005-07-01 13:48:29 UTC (rev 2617)
@@ -45,11 +45,19 @@
{
word = new StringBuilder ();
curPos = 0;
- scrollbar.Adjustment.Lower = 0;
- scrollbar.Adjustment.Upper = provider.ItemCount - list.VisibleRows;
- scrollbar.Adjustment.PageIncrement = list.VisibleRows - 1;
- scrollbar.Adjustment.StepIncrement = 1;
list.Reset ();
+
+ if (list.VisibleRows >= provider.ItemCount) {
+ this.scrollbar.Hide();
+ }
+ else {
+ scrollbar.Adjustment.Lower = 0;
+ scrollbar.Adjustment.Upper = provider.ItemCount - list.VisibleRows;
+ scrollbar.Adjustment.PageIncrement = list.VisibleRows - 1;
+ scrollbar.Adjustment.StepIncrement = 1;
+ }
+
+ this.Resize(this.list.WidthRequest, this.list.HeightRequest);
}
public IListDataProvider DataProvider
@@ -421,7 +429,12 @@
rowHeight += padding;
visibleRows = (winHeight + padding - margin * 2) / rowHeight;
- int newHeight = (rowHeight * visibleRows) + margin * 2;
+ int newHeight;
+
+ if (this.win.DataProvider.ItemCount > this.visibleRows)
+ newHeight = (rowHeight * visibleRows) + margin * 2;
+ else
+ newHeight = (rowHeight * this.win.DataProvider.ItemCount) + margin * 2;
if (lvWidth != listWidth || lvHeight != newHeight)
this.SetSizeRequest (listWidth, newHeight);
More information about the Monodevelop-patches-list
mailing list