[Monodevelop-patches-list] r466 - trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sun Jan 11 21:59:38 EST 2004
Author: benm
Date: 2004-01-11 21:59:38 -0500 (Sun, 11 Jan 2004)
New Revision: 466
Modified:
trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/GutterMargin.cs
Log:
throw away yer trash; make less of it
Modified: trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/GutterMargin.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/GutterMargin.cs 2004-01-12 02:44:40 UTC (rev 465)
+++ trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/GutterMargin.cs 2004-01-12 02:59:38 UTC (rev 466)
@@ -63,8 +63,16 @@
public override void Paint(Gdk.Drawable wnd, System.Drawing.Rectangle rect)
{
- using (Gdk.GC gc = new Gdk.GC (wnd)) {
- HighlightColor lineNumberPainterColor = textArea.Document.HighlightingStrategy.GetColorFor("LineNumbers");
+ using (Gdk.GC gc = new Gdk.GC (wnd)) {
+ using (Pango.Layout ly = new Pango.Layout (TextArea.PangoContext)) {
+ ly.FontDescription = FontContainer.DefaultFont;
+
+ HighlightColor lineNumberPainterColor = textArea.Document.HighlightingStrategy.GetColorFor("LineNumbers");
+ Gdk.Color bg = new Gdk.Color (lineNumberPainterColor.BackgroundColor);
+ Gdk.Color fg_text = new Gdk.Color (lineNumberPainterColor.Color);
+ Gdk.Color fg_rect = TextArea.Style.White;
+
+
//FIXME: This doesnt allow different fonts and what not
int fontHeight = TextArea.TextView.FontHeight;
@@ -73,20 +81,18 @@
System.Drawing.Rectangle backgroundRectangle = new System.Drawing.Rectangle(drawingPosition.X, ypos, drawingPosition.Width, fontHeight);
//if (rect.IntersectsWith(backgroundRectangle)) {
- gc.RgbBgColor = new Gdk.Color (lineNumberPainterColor.BackgroundColor);
- gc.RgbFgColor = TextArea.Style.White;
+ gc.RgbBgColor = bg;
+ gc.RgbFgColor = fg_rect;
wnd.DrawRectangle (gc, true, backgroundRectangle);
int curLine = y + textArea.TextView.FirstVisibleLine;
if (curLine < textArea.Document.TotalNumberOfLines) {
- gc.RgbFgColor = new Gdk.Color (lineNumberPainterColor.Color);
- Pango.Layout ly = new Pango.Layout (TextArea.PangoContext);
- ly.FontDescription = FontContainer.DefaultFont;
+ gc.RgbFgColor = fg_text;
ly.SetText ((curLine + 1).ToString ());
wnd.DrawLayout (gc, drawingPosition.X, ypos, ly);
}
//}
}
- }
+ }}
}
}
}
More information about the Monodevelop-patches-list
mailing list