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

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sun Jan 25 13:19:17 EST 2004


Author: benm
Date: 2004-01-25 13:19:17 -0500 (Sun, 25 Jan 2004)
New Revision: 653

Modified:
   trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/GutterMargin.cs
Log:
right align line numbers

Modified: trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/GutterMargin.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/GutterMargin.cs	2004-01-25 18:04:47 UTC (rev 652)
+++ trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/GutterMargin.cs	2004-01-25 18:19:17 UTC (rev 653)
@@ -60,9 +60,13 @@
 		
 		public override void Paint(Gdk.Drawable wnd, System.Drawing.Rectangle rect)
 		{
+			int one_width = (int) textArea.TextView.GetWidth ('w');
+			
 			using (Gdk.GC gc = new Gdk.GC (wnd)) {
 			using (Pango.Layout ly = new Pango.Layout (TextArea.PangoContext)) {
 				ly.FontDescription = FontContainer.DefaultFont;
+				ly.Width = drawingPosition.Width;
+				ly.Alignment = Pango.Alignment.Right;
 				
 				HighlightColor lineNumberPainterColor = textArea.Document.HighlightingStrategy.GetColorFor("LineNumbers");
 				
@@ -85,7 +89,7 @@
 					int curLine = y + textArea.TextView.FirstVisibleLine;
 					if (curLine < textArea.Document.TotalNumberOfLines) {
 						ly.SetText ((curLine + 1).ToString ());
-						wnd.DrawLayout (gc, drawingPosition.X, ypos, ly);
+						wnd.DrawLayout (gc, drawingPosition.X + drawingPosition.Width - one_width, ypos, ly);
 					}
 				}
 			}}




More information about the Monodevelop-patches-list mailing list