Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hutchinson <mhutch@xamarin.com>2013-08-13 09:10:20 +0400
committerMichael Hutchinson <mhutch@xamarin.com>2013-08-13 09:10:20 +0400
commita47449b42baa78c5fe1a293629bcec9564ec849c (patch)
tree85a9b14190c18dd4d0bc8b964e9c3ef4a29c1823 /main/src/core/Mono.Texteditor
parenta44f19c645b2014a9548ed6123ca6654630afff4 (diff)
Revert "Revert "Fix hundreds of warnings""
Please use an up to date Mono. This reverts commit 54a64a751b7070237368b7967cc4a6adff6bc468.
Diffstat (limited to 'main/src/core/Mono.Texteditor')
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/HighlightingPartitioner.cs47
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs40
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs6
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs6
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.csproj1
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs4
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentRegion.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs10
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs8
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs4
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs4
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/PangoUtil.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs18
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs34
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs7
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs6
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs8
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs4
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs4
29 files changed, 96 insertions, 139 deletions
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/HighlightingPartitioner.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/HighlightingPartitioner.cs
deleted file mode 100644
index 2b9b8eb581..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/HighlightingPartitioner.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//// HighlightingPartitioner.cs
-////
-//// Author:
-//// Mike Krüger <mkrueger@novell.com>
-////
-//// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-////
-//// Permission is hereby granted, free of charge, to any person obtaining a copy
-//// of this software and associated documentation files (the "Software"), to deal
-//// in the Software without restriction, including without limitation the rights
-//// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-//// copies of the Software, and to permit persons to whom the Software is
-//// furnished to do so, subject to the following conditions:
-////
-//// The above copyright notice and this permission notice shall be included in
-//// all copies or substantial portions of the Software.
-////
-//// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-//// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-//// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-//// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-//// THE SOFTWARE.
-//
-//using System;
-//
-//namespace Mono.TextEditor.Highlighting
-//{
-// public class HighlightingPartitioner : AbstractPartitioner
-// {
-// public override void TextReplaced (ReplaceEventArgs args)
-// {
-///* // TODO: Implement span rule based document partitioner
-// var mode = Document.SyntaxMode;
-// var node = GetTreeNodeAtOffset (args.Offset);
-// base.ChangeLength (node.value, node.value.Length - args.Count);
-// if (args.Value == null)
-// return;
-//
-// for (int i = args.Offset; i < args.Offset + args.Value.Length; i++) {
-//
-// }*/
-// }
-// }
-//}
-//
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs
index 4528b281cd..fe014cdddf 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs
@@ -141,28 +141,28 @@ namespace Mono.TextEditor.PopupWindow
layout.GetPixelSize (out width, out height);
width += xBorder * 2;
FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, false, 0.5, 0.5, height + yBorder * 2 + 1.5, width, height + yBorder * 2);
- g.Color = titleBgColor;
+ g.SetSourceColor (titleBgColor);
g.FillPreserve ();
- g.Color = borderColor;
+ g.SetSourceColor (borderColor);
g.Stroke ();
g.Save ();
- g.Color = textColor;
+ g.SetSourceColor (textColor);
g.Translate (xBorder, yBorder);
g.ShowLayout (layout);
g.Restore ();
FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, 0.5, height * 2 + yBorder * 2 + 0.5, height, Allocation.Width - 1, Allocation.Height - height * 2 - yBorder * 2 - 1);
- g.Color = bgColor;
+ g.SetSourceColor (bgColor);
g.FillPreserve ();
- g.Color = borderColor;
+ g.SetSourceColor (borderColor);
g.Stroke ();
g.MoveTo (xSpacer + 0.5, height * 2 + yBorder * 2);
g.LineTo (xSpacer + 0.5, Allocation.Height - 1);
- g.Color = gridColor;
+ g.SetSourceColor (gridColor);
g.Stroke ();
int y = height + yBorder * 2;
@@ -175,26 +175,26 @@ namespace Mono.TextEditor.PopupWindow
if (i == 0) {
FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, false, false, 0, y + 0.5, height + 1.5, Allocation.Width, height);
- g.Color = categoryBgColor;
+ g.SetSourceColor (categoryBgColor);
g.FillPreserve ();
- g.Color = borderColor;
+ g.SetSourceColor (borderColor);
g.Stroke ();
g.MoveTo (xSpacer + 0.5, height + yBorder * 2 + 1);
g.LineTo (xSpacer + 0.5, height * 2 + yBorder * 2 + 1);
- g.Color = gridColor;
+ g.SetSourceColor (gridColor);
g.Stroke ();
}
gc.RgbFgColor = (HslColor)(i == 0 ? bgColor : textColor);
g.Save ();
- g.Color = textColor;
+ g.SetSourceColor (textColor);
g.Translate (xBorder, y);
g.ShowLayout (layout);
g.Restore ();
g.Save ();
- g.Color = textColor;
+ g.SetSourceColor (textColor);
g.Translate (xSpacer + xBorder, y);
layout.SetMarkup (pair.Value);
g.ShowLayout (layout);
@@ -204,7 +204,7 @@ namespace Mono.TextEditor.PopupWindow
if (i > 0) {
g.MoveTo (1, y + 0.5);
g.LineTo (Allocation.Width - 1, y + 0.5);
- g.Color = gridColor;
+ g.SetSourceColor (gridColor);
g.Stroke ();
}
y += height;
@@ -297,14 +297,14 @@ namespace Mono.TextEditor.PopupWindow
} else {
g.Rectangle (0, 0, Allocation.Width, height + yTitleBorder * 2);
}
- g.Color = titleBgColor;
+ g.SetSourceColor (titleBgColor);
g.FillPreserve ();
- g.Color = borderColor;
+ g.SetSourceColor (borderColor);
g.Stroke ();
g.MoveTo (tw + xDescriptionBorder, yTitleBorder);
- g.Color = titleTextColor;
+ g.SetSourceColor (titleTextColor);
g.ShowLayout (titleLayout);
if (SupportsAlpha) {
@@ -312,9 +312,9 @@ namespace Mono.TextEditor.PopupWindow
} else {
g.Rectangle (0, height + yTitleBorder * 2, Allocation.Width, Allocation.Height - height - yTitleBorder * 2);
}
- g.Color = bgColor;
+ g.SetSourceColor (bgColor);
g.FillPreserve ();
- g.Color = borderColor;
+ g.SetSourceColor (borderColor);
g.Stroke ();
if (SupportsAlpha) {
@@ -325,19 +325,19 @@ namespace Mono.TextEditor.PopupWindow
g.LineTo (tw + 5, Allocation.Height / 2 + th / 2);
g.LineTo (tw + 5, Allocation.Height / 2 - th / 2);
g.ClosePath ();
- g.Color = bgColor;
+ g.SetSourceColor (bgColor);
g.Fill ();
g.MoveTo (tw, Allocation.Height / 2 - th / 2);
g.LineTo (0, Allocation.Height / 2);
g.LineTo (tw, Allocation.Height / 2 + th / 2);
- g.Color = borderColor;
+ g.SetSourceColor (borderColor);
g.Stroke ();
}
int y = height + yTitleBorder * 2 + yDescriptionBorder;
g.MoveTo (tw + xDescriptionBorder, y);
- g.Color = textColor;
+ g.SetSourceColor (textColor);
g.ShowLayout (descriptionLayout);
}
return base.OnExposeEvent (args);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs
index 6b811236fc..bde15cf5fd 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs
@@ -258,7 +258,7 @@ namespace Mono.TextEditor.Theatrics
cr.SharpLineY (alloc.X, alloc.Y, right, alloc.Y);
cr.SharpLineY (alloc.X, bottom, right, bottom);
- cr.Color = (HslColor)Style.Dark (State);
+ cr.SetSourceColor ((HslColor)Style.Dark (State));
cr.Stroke ();
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs
index 2f4b3c1d71..3911ebc364 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/Diff.cs
@@ -211,9 +211,9 @@ namespace Mono.TextEditor.Utils
var dataB = new DiffData<T> (changedArray);
int MAX = dataA.Length + dataB.Length + 1;
- /// vector for the (0,0) to (x,y) search
+ // vector for the (0,0) to (x,y) search
int[] downVector = new int[2 * MAX + 2];
- /// vector for the (u,v) to (N,M) search
+ // vector for the (u,v) to (N,M) search
int[] upVector = new int[2 * MAX + 2];
LCS (dataA, 0, dataA.Length, dataB, 0, dataB.Length, downVector, upVector);
@@ -552,7 +552,7 @@ namespace Mono.TextEditor.Utils
/// <summary>
/// Initialize the Diff-Data buffer.
/// </summary>
- /// <param name="data">reference to the buffer</param>
+ /// <param name="initData">reference to the buffer</param>
public DiffData (T[] initData)
{
Data = initData;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs
index 37fefdfc59..5b9a577a2a 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs
@@ -216,7 +216,7 @@ namespace Mono.TextEditor.Utils
}
/// <summary>
- /// Returns a byte array containing the text encoded by a specified encoding & bom.
+ /// Returns a byte array containing the text encoded by a specified encoding &amp; bom.
/// </summary>
/// <param name="text">The text to encode.</param>
/// <param name="encoding">The encoding.</param>
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs
index a3270a48dd..9e96343302 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs
@@ -109,7 +109,7 @@ namespace Mono.TextEditor.Vi
{
using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) {
cr.Rectangle (evnt.Region.Clipbox.X, evnt.Region.Clipbox.Y, evnt.Region.Clipbox.Width, evnt.Region.Clipbox.Height);
- cr.Color = editor.ColorStyle.PlainText.Background;
+ cr.SetSourceColor (editor.ColorStyle.PlainText.Background);
cr.Fill ();
using (var layout = PangoUtil.CreateLayout (editor)) {
layout.FontDescription = editor.Options.Font;
@@ -135,7 +135,7 @@ namespace Mono.TextEditor.Vi
statusw += 8;
cr.MoveTo (Allocation.Width - statusw, 0);
statusw += 8;
- cr.Color = editor.ColorStyle.PlainText.Foreground;
+ cr.SetSourceColor (editor.ColorStyle.PlainText.Foreground);
cr.ShowLayout (layout);
layout.SetText (statusText ?? "");
@@ -143,7 +143,7 @@ namespace Mono.TextEditor.Vi
layout.GetPixelSize (out w, out h);
var x = System.Math.Min (0, -w + Allocation.Width - editor.TextViewMargin.CharWidth - statusw);
cr.MoveTo (x, 0);
- cr.Color = editor.ColorStyle.PlainText.Foreground;
+ cr.SetSourceColor (editor.ColorStyle.PlainText.Foreground);
cr.ShowLayout (layout);
if (ShowCaret) {
if (editor.TextViewMargin.caretBlink) {
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj b/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj
index 94be179cff..d2f941586d 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj
@@ -132,7 +132,6 @@
<Compile Include="Mono.TextEditor.PopupWindow\ModeHelpWindow.cs" />
<Compile Include="Mono.TextEditor.Highlighting\CloneableStack.cs" />
<Compile Include="Mono.TextEditor.Utils\Diff.cs" />
- <Compile Include="Mono.TextEditor.Highlighting\HighlightingPartitioner.cs" />
<Compile Include="Mono.TextEditor.Vi\ViEditorActions.cs" />
<Compile Include="Mono.TextEditor.Vi\ViBuilderContext.cs" />
<Compile Include="Mono.TextEditor.Vi\ViBuilders.cs" />
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs
index c6aa975d56..b4e2c54cd9 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs
@@ -64,14 +64,14 @@ namespace Mono.TextEditor
using (var pat = new Cairo.LinearGradient (x + width / 4, y, x + width / 2, y + height - 4)) {
pat.AddColorStop (0, color1);
pat.AddColorStop (1, color2);
- cr.Pattern = pat;
+ cr.SetSource (pat);
cr.FillPreserve ();
}
using (var pat = new Cairo.LinearGradient (x, y + height, x + width, y)) {
pat.AddColorStop (0, color2);
//pat.AddColorStop (1, color1);
- cr.Pattern = pat;
+ cr.SetSource (pat);
cr.Stroke ();
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs
index 8ff5bdade3..2f73455320 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs
@@ -225,7 +225,7 @@ namespace Mono.TextEditor
/// This method gets the line indentation.
/// </summary>
/// <param name="doc">
- /// The <see cref="Document"/> the line belongs to.
+ /// The <see cref="TextDocument"/> the line belongs to.
/// </param>
/// <returns>
/// The indentation of the line (all whitespace chars up to the first non ws char).
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentRegion.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentRegion.cs
index 31de8d1692..a301dd5584 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentRegion.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentRegion.cs
@@ -28,7 +28,7 @@ using System;
namespace Mono.TextEditor
{
/// <summary>
- /// An (Begin, End) pair representing a document span. It's a TextSegment working with lines & columns instead of offsets.
+ /// An (Begin, End) pair representing a document span. It's a TextSegment working with lines &amp; columns instead of offsets.
/// </summary>
public struct DocumentRegion : IEquatable<DocumentRegion>
{
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
index 21cdfbf588..e0ac644faf 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
@@ -38,7 +38,7 @@ using System.Threading;
namespace Mono.TextEditor
{
- public class TextDocument : AbstractAnnotatable, ICSharpCode.NRefactory.Editor.IDocument
+ public class TextDocument : ICSharpCode.NRefactory.AbstractAnnotatable, ICSharpCode.NRefactory.Editor.IDocument
{
readonly IBuffer buffer;
readonly ILineSplitter splitter;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs
index 336a2b251f..ba069dfc6e 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs
@@ -64,7 +64,7 @@ namespace Mono.TextEditor
return;
}
cr.Rectangle (x, y, Width, lineHeight);
- cr.Color = editor.ColorStyle.LineNumbers.Background;
+ cr.SetSourceColor (editor.ColorStyle.LineNumbers.Background);
cr.Fill ();
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs
index 52c6a37ac3..154111bc09 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs
@@ -53,7 +53,7 @@ namespace Mono.TextEditor
{
cr.MoveTo (x + 0.5, y);
cr.LineTo (x + 0.5, y + lineHeight);
- cr.Color = color;
+ cr.SetSourceColor (color);
cr.Stroke ();
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs
index 69e0c568be..ec7a80d2ad 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs
@@ -265,9 +265,9 @@ namespace Mono.TextEditor
var drawArea = new Cairo.Rectangle (System.Math.Floor (x + (Width - foldSegmentSize) / 2) + 0.5,
System.Math.Floor (y + (editor.LineHeight - foldSegmentSize) / 2) + 0.5, foldSegmentSize, foldSegmentSize);
ctx.Rectangle (drawArea);
- ctx.Color = isOpen ? foldBgGC : foldToggleMarkerBackground;
+ ctx.SetSourceColor (isOpen ? foldBgGC : foldToggleMarkerBackground);
ctx.FillPreserve ();
- ctx.Color = isSelected ? foldLineHighlightedGC : foldLineGC;
+ ctx.SetSourceColor (isSelected ? foldLineHighlightedGC : foldLineGC);
ctx.Stroke ();
ctx.DrawLine (isSelected ? foldLineHighlightedGC : foldToggleMarkerGC,
@@ -353,18 +353,18 @@ namespace Mono.TextEditor
}
cr.Rectangle (drawArea);
- cr.Color = bgGC;
+ cr.SetSourceColor (bgGC);
cr.Fill ();
}
}
if (editor.Options.EnableQuickDiff) {
if (state == TextDocument.LineState.Changed) {
- cr.Color = lineStateChangedGC;
+ cr.SetSourceColor (lineStateChangedGC);
cr.Rectangle (x + 1, y, marginWidth / 3, lineHeight);
cr.Fill ();
} else if (state == TextDocument.LineState.Dirty) {
- cr.Color = lineStateDirtyGC;
+ cr.SetSourceColor (lineStateDirtyGC);
cr.Rectangle (x + 1, y, marginWidth / 3, lineHeight);
cr.Fill ();
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs
index 81f6d8d535..2a1422565f 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs
@@ -91,7 +91,7 @@ namespace Mono.TextEditor
double brightness = HslColor.Brightness (editor.ColorStyle.PlainText.Background);
int colorCount = foldSegments.Count + 2;
- cr.Color = GetColor (-1, brightness, colorCount);
+ cr.SetSourceColor (GetColor (-1, brightness, colorCount));
cr.Rectangle (area);
cr.Fill ();
var rectangles = new Cairo.Rectangle[foldSegments.Count];
@@ -184,7 +184,7 @@ namespace Mono.TextEditor
}
var bg = editor.ColorStyle.PlainText.Foreground;
- cr.Color = new Cairo.Color (bg.R, bg.G, bg.B, alpha);
+ cr.SetSourceRGBA (bg.R, bg.G, bg.B, alpha);
DrawRoundRectangle (cr, true, true, rect.X - editor.HAdjustment.Value - curPadSize , rect.Y - editor.VAdjustment.Value - curPadSize, editor.LineHeight / 2, rect.Width + curPadSize * 2, rect.Height + curPadSize * 2);
cr.Fill ();
@@ -192,7 +192,7 @@ namespace Mono.TextEditor
var animationState = age / (double)animationLength;
curPadSize = (int)(2 + System.Math.Sin (System.Math.PI * animationState) * 2);
DrawRoundRectangle (cr, true, true, rect.X - editor.HAdjustment.Value - curPadSize, rect.Y - editor.VAdjustment.Value - curPadSize, editor.LineHeight / 2, rect.Width + curPadSize * 2, rect.Height + curPadSize * 2);
- cr.Color = GetColor (i, brightness, colorCount);
+ cr.SetSourceColor (GetColor (i, brightness, colorCount));
cr.Fill ();
continue;
@@ -201,7 +201,7 @@ namespace Mono.TextEditor
DrawRoundRectangle (cr, true, true, rect.X - editor.HAdjustment.Value, rect.Y - editor.VAdjustment.Value, editor.LineHeight / 2, rect.Width, rect.Height);
- cr.Color = GetColor (i, brightness, colorCount);
+ cr.SetSourceColor (GetColor (i, brightness, colorCount));
cr.Fill ();
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs
index ddf817821f..bda3a23761 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs
@@ -549,7 +549,7 @@ namespace Mono.TextEditor
/// <summary>Map raw GTK key input to work around platform bugs and decompose accelerator keys</summary>
/// <param name='evt'>The raw key event</param>
/// <param name='key'>The composed key</param>
- /// <param name='mod'>The composed modifiers</param>
+ /// <param name='state'>The composed modifiers</param>
/// <param name='shortcuts'>All the key/modifier decompositions that can be used as accelerators</param>
public static void MapKeys (Gdk.EventKey evt, out Gdk.Key key, out Gdk.ModifierType state,
out KeyboardShortcut[] shortcuts)
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs
index b660d68967..b4c9d22b1b 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs
@@ -216,7 +216,7 @@ namespace Mono.TextEditor
return;
}
cr.Rectangle (x, y, Width, lineHeight);
- cr.Color = lineNumberBgGC;
+ cr.SetSourceColor (lineNumberBgGC);
cr.Fill ();
}
@@ -246,7 +246,7 @@ namespace Mono.TextEditor
layout.SetText (line.ToString ());
cr.Save ();
cr.Translate (x + (int)Width + (editor.Options.ShowFoldMargin ? 0 : -2), y + (lineHeight - fontHeight) / 2);
- cr.Color = lineNumberGC;
+ cr.SetSourceColor (lineNumberGC);
cr.ShowLayout (layout);
cr.Restore ();
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs
index 21209559c5..3f9e4378b3 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs
@@ -148,12 +148,12 @@ namespace Mono.TextEditor
if (!backgroundIsDrawn) {
ctx.Rectangle (x, y, Width, lineHeight);
- ctx.Color = backgroundColor;
+ ctx.SetSourceColor (backgroundColor);
ctx.Fill ();
ctx.MoveTo (x + Width - 0.5, y);
ctx.LineTo (x + Width - 0.5, y + lineHeight);
- ctx.Color = separatorColor;
+ ctx.SetSourceColor (separatorColor);
ctx.Stroke ();
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/PangoUtil.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/PangoUtil.cs
index f6a74bd258..dfb3c7a5af 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/PangoUtil.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/PangoUtil.cs
@@ -41,7 +41,7 @@ namespace Mono.TextEditor
internal const string LIBPANGOCAIRO = "libpangocairo-1.0-0.dll";
/// <summary>
- /// This doesn't leak Pango layouts, unlike some other ways to create them in GTK# <= 2.12.11
+ /// This doesn't leak Pango layouts, unlike some other ways to create them in GTK# &lt;= 2.12.11
/// </summary>
public static Pango.Layout CreateLayout (Widget widget)
{
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
index 7cafe4a333..eca35400f2 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
@@ -2292,7 +2292,7 @@ namespace Mono.TextEditor
Cairo.Color color = editor.ColorStyle.PlainText.Foreground;
color.A = 0.8;
cr.LineWidth = editor.Options.Zoom;
- cr.Color = color;
+ cr.SetSourceColor (color);
cr.Stroke ();
cr.ResetClip ();
}
@@ -2356,7 +2356,7 @@ namespace Mono.TextEditor
Cairo.Color color = editor.ColorStyle.PlainText.Foreground;
color.A = 0.8;
cr.LineWidth = editor.Options.Zoom;
- cr.Color = color;
+ cr.SetSourceColor (color);
cr.Stroke ();
cr.ResetClip ();
}
@@ -2380,7 +2380,7 @@ namespace Mono.TextEditor
/// <summary>
/// Initiate a pulse at the specified document location
/// </summary>
- /// <param name="pulseLocation">
+ /// <param name="pulseStart">
/// A <see cref="DocumentLocation"/>
/// </param>
public void PulseCharacter (DocumentLocation pulseStart)
@@ -2542,7 +2542,7 @@ namespace Mono.TextEditor
//fill in the highlight rect with solid white to prevent alpha blending artifacts on the corners
FoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, 0, 0, corner, width, height);
- cr.Color = new Cairo.Color (1, 1, 1);
+ cr.SetSourceRGB (1, 1, 1);
cr.Fill ();
//draw the shadow
@@ -2550,7 +2550,7 @@ namespace Mono.TextEditor
shadowOffset, shadowOffset, corner, width, height);
var color = TextViewMargin.DimColor (Editor.ColorStyle.SearchResultMain.Color, 0.3);
color.A = 0.5 * opacity * opacity;
- cr.Color = color;
+ cr.SetSourceColor (color);
cr.Fill ();
//draw the highlight rectangle
@@ -2566,13 +2566,13 @@ namespace Mono.TextEditor
Editor.ColorStyle.SearchResultMain.Color,
1 - opacity);
gradient.AddColorStop (1, color);
- cr.Pattern = gradient;
+ cr.SetSource (gradient);
cr.Fill ();
}
//and finally the text
cr.Translate (area.X, area.Y);
- cr.Color = new Cairo.Color (0, 0, 0);
+ cr.SetSourceRGB (0, 0, 0);
cr.ShowLayout (layout);
}
@@ -3204,8 +3204,8 @@ namespace Mono.TextEditor
var childRectangle = new Gdk.Rectangle (child.X, child.Y, req.Width, req.Height);
if (!child.FixedPosition) {
// double zoom = Options.Zoom;
- childRectangle.X = (int)(child.X /** zoom */- HAdjustment.Value);
- childRectangle.Y = (int)(child.Y /** zoom */- VAdjustment.Value);
+ childRectangle.X = (int)(child.X /* * zoom */- HAdjustment.Value);
+ childRectangle.Y = (int)(child.Y /* * zoom */- VAdjustment.Value);
}
// childRectangle.X += allocation.X;
// childRectangle.Y += allocation.Y;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs
index a031ffde40..dc8db1fbac 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs
@@ -1103,7 +1103,7 @@ namespace Mono.TextEditor
/// <summary>
/// Initiate a pulse at the specified document location
/// </summary>
- /// <param name="pulseLocation">
+ /// <param name="pulseStart">
/// A <see cref="DocumentLocation"/>
/// </param>
public void PulseCharacter (DocumentLocation pulseStart)
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs
index df3a14e617..190a424958 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs
@@ -739,7 +739,7 @@ namespace Mono.TextEditor
caretRectangle.Y + caretRectangle.Height);
break;
case CaretMode.Block:
- cr.Color = color;
+ cr.SetSourceColor (color);
cr.Rectangle (caretRectangle.X + 0.5, caretRectangle.Y + 0.5, caretRectangle.Width, caretRectangle.Height);
cr.Fill ();
char caretChar = GetCaretChar ();
@@ -748,7 +748,7 @@ namespace Mono.TextEditor
layout.FontDescription = textEditor.Options.Font;
layout.SetText (caretChar.ToString ());
cr.MoveTo (caretRectangle.X, caretRectangle.Y);
- cr.Color = textEditor.ColorStyle.PlainText.Background;
+ cr.SetSourceColor (textEditor.ColorStyle.PlainText.Background);
cr.ShowLayout (layout);
}
}
@@ -1404,7 +1404,7 @@ namespace Mono.TextEditor
} else {
col = selected ? SelectionColor.Foreground : col = ColorStyle.PlainText.Foreground;
}
- ctx.Color = new Cairo.Color (col.R, col.G, col.B, whitespaceMarkerAlpha);
+ ctx.SetSourceRGBA (col.R, col.G, col.B, whitespaceMarkerAlpha);
if (ch == '\t') {
DrawTabMarker (ctx, selected, xpos, xpos2, y);
@@ -1423,10 +1423,10 @@ namespace Mono.TextEditor
var bracketMatch = new Cairo.Rectangle (xPos + rect.X / Pango.Scale.PangoScale + 0.5, y + 0.5, (rect.Width / Pango.Scale.PangoScale) - 1, (rect.Height / Pango.Scale.PangoScale) - 1);
if (BackgroundRenderer == null) {
- ctx.Color = this.ColorStyle.BraceMatchingRectangle.Color;
+ ctx.SetSourceColor (ColorStyle.BraceMatchingRectangle.Color);
ctx.Rectangle (bracketMatch);
ctx.FillPreserve ();
- ctx.Color = this.ColorStyle.BraceMatchingRectangle.SecondColor;
+ ctx.SetSourceColor (ColorStyle.BraceMatchingRectangle.SecondColor);
ctx.Stroke ();
}
}
@@ -1445,14 +1445,14 @@ namespace Mono.TextEditor
xPos = System.Math.Floor (xPos);
cr.Rectangle (xPos, y, width, lineHeight);
var color = CurrentLineColor;
- cr.Color = color.Color;
+ cr.SetSourceColor (color.Color);
cr.Fill ();
double halfLine = (cr.LineWidth / 2.0);
cr.MoveTo (xPos, y + halfLine);
cr.LineTo (xPos + width, y + halfLine);
cr.MoveTo (xPos, y + lineHeight - halfLine);
cr.LineTo (xPos + width, y + lineHeight - halfLine);
- cr.Color = color.SecondColor;
+ cr.SetSourceColor (color.SecondColor);
cr.Stroke ();
}
@@ -1483,7 +1483,7 @@ namespace Mono.TextEditor
cr.MoveTo (x + 0.5, top);
cr.LineTo (x + 0.5, bottom);
- cr.Color = ColorStyle.IndentationGuide.Color;
+ cr.SetSourceColor (ColorStyle.IndentationGuide.Color);
cr.Stroke ();
}
cr.Restore ();
@@ -1552,12 +1552,14 @@ namespace Mono.TextEditor
isSelectionDrawn |= (marker.Flags & TextLineMarkerFlags.DrawsSelection) == TextLineMarkerFlags.DrawsSelection;
}
+#pragma warning disable 618
var bgMarker = marker as IBackgroundMarker;
if (bgMarker != null) {
isSelectionDrawn |= (marker.Flags & TextLineMarkerFlags.DrawsSelection) == TextLineMarkerFlags.DrawsSelection;
drawText &= bgMarker.DrawBackground (textEditor, cr, metrics.Layout, metrics.SelectionStart, metrics.SelectionEnd, metrics.TextStartOffset, metrics.TextEndOffset, y, metrics.TextRenderStartPosition, metrics.TextRenderEndPosition, ref drawBg);
continue;
}
+#pragma warning restore 618
}
if (DecorateLineBg != null)
@@ -1605,7 +1607,7 @@ namespace Mono.TextEditor
int s = (int) System.Math.Floor ((x1 + x) / Pango.Scale.PangoScale);
double corner = System.Math.Min (4, width) * textEditor.Options.Zoom;
- cr.Color = MainSearchResult.IsInvalid || MainSearchResult.Offset != firstSearch.Offset ? ColorStyle.SearchResult.Color : ColorStyle.SearchResultMain.Color;
+ cr.SetSourceColor (MainSearchResult.IsInvalid || MainSearchResult.Offset != firstSearch.Offset ? ColorStyle.SearchResult.Color : ColorStyle.SearchResultMain.Color);
FoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, s, y, corner, w + 1, LineHeight);
cr.Fill ();
}
@@ -1796,7 +1798,7 @@ namespace Mono.TextEditor
}
}
- cr.Color = new Cairo.Color (col.R, col.G, col.B, whitespaceMarkerAlpha);
+ cr.SetSourceRGBA (col.R, col.G, col.B, whitespaceMarkerAlpha);
cr.ShowLayout (layout);
cr.Restore ();
}
@@ -2339,7 +2341,7 @@ namespace Mono.TextEditor
bool isDefaultColor = color.R == defaultBgColor.R && color.G == defaultBgColor.G && color.B == defaultBgColor.B;
if (isDefaultColor && !drawDefaultBackground)
return;
- cr.Color = color;
+ cr.SetSourceColor (color);
var left = (int)(area.X);
var width = (int)area.Width + 1;
if (textEditor.Options.ShowRuler) {
@@ -2353,7 +2355,7 @@ namespace Mono.TextEditor
cr.Fill ();
}
cr.Rectangle (divider, area.Y, right - divider, area.Height);
- cr.Color = DimColor (color);
+ cr.SetSourceColor (DimColor (color));
cr.Fill ();
if (beforeDividerWidth > 0) {
@@ -2600,15 +2602,15 @@ namespace Mono.TextEditor
this.LineHeight);
if (BackgroundRenderer == null && isFoldingSelected) {
- cr.Color = SelectionColor.Background;
+ cr.SetSourceColor (SelectionColor.Background);
cr.Rectangle (foldingRectangle);
cr.Fill ();
}
if (isFoldingSelected && SelectionColor.TransparentForeground) {
- cr.Color = ColorStyle.CollapsedText.Foreground;
+ cr.SetSourceColor (ColorStyle.CollapsedText.Foreground);
} else {
- cr.Color = isFoldingSelected ? SelectionColor.Foreground : ColorStyle.CollapsedText.Foreground;
+ cr.SetSourceColor (isFoldingSelected ? SelectionColor.Foreground : ColorStyle.CollapsedText.Foreground);
}
var boundingRectangleHeight = foldingRectangle.Height - 1;
var boundingRectangleY = System.Math.Floor (foldingRectangle.Y + (foldingRectangle.Height - boundingRectangleHeight) / 2);
@@ -2743,7 +2745,7 @@ namespace Mono.TextEditor
if (textEditor.HAdjustment.Value > 0) {
cr.LineWidth = textEditor.Options.Zoom;
for (int i = 0; i < verticalShadowAlphaTable.Length; i++) {
- cr.Color = new Cairo.Color (0, 0, 0, 1 - verticalShadowAlphaTable[i]);
+ cr.SetSourceRGBA (0, 0, 0, 1 - verticalShadowAlphaTable[i]);
cr.MoveTo (x + i * cr.LineWidth + 0.5, y);
cr.LineTo (x + i * cr.LineWidth + 0.5, y + 1 + _lineHeight);
cr.Stroke ();
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs
index c1b47ad06c..7fb89406fb 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs
@@ -34,7 +34,7 @@ using Gtk;
namespace Mono.TextEditor
{
/// <summary>
- /// The height tree stores the heights of lines and provides a performant y <--> lineNumber conversion.
+ /// The height tree stores the heights of lines and provides a performant conversion between y and lineNumber.
/// It takes care of message bubble heights and the height of folded sections.
/// </summary>
public class HeightTree : IDisposable
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs
index a43f25ee44..b44906209e 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs
@@ -118,7 +118,7 @@ namespace Mono.TextEditor
public static void DrawLine (this Cairo.Context cr, Cairo.Color color, double x1, double y1, double x2, double y2)
{
- cr.Color = color;
+ cr.SetSourceColor (color);
cr.MoveTo (x1, y1);
cr.LineTo (x2, y2);
cr.Stroke ();
@@ -142,6 +142,9 @@ namespace Mono.TextEditor
cr.LineTo (x2, y2 + 0.5);
}
-
+ public static void SetSourceColor (this Cairo.Context cr, Cairo.Color color)
+ {
+ cr.SetSourceRGBA (color.R, color.G, color.B, color.A);
+ }
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs
index c728f017bb..a992a476d8 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs
@@ -316,10 +316,10 @@ namespace Mono.TextEditor
g.LineTo (x - arrowLength / phi, y);
g.ClosePath ();
- g.Color = new Cairo.Color (1.0, 0, 0);
+ g.SetSourceRGB (1.0, 0, 0);
g.StrokePreserve ();
- g.Color = new Cairo.Color (1.0, 0, 0, 0.1);
+ g.SetSourceRGBA (1.0, 0, 0, 0.1);
g.Fill ();
}
@@ -365,7 +365,7 @@ namespace Mono.TextEditor
cr.MoveTo (x, y);
cr.LineTo (x2, y);
- cr.Color = LineColor;
+ cr.SetSourceColor (LineColor);
cr.Stroke ();
// DrawArrow (cr, x - 4, y);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs
index 74f8582a1b..3fead25185 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs
@@ -44,7 +44,7 @@ namespace Mono.TextEditor
{
if (metrics.SelectionStart > 0)
return true;
- cr.Color = color;
+ cr.SetSourceColor (color);
cr.Rectangle (metrics.TextRenderStartPosition, y, metrics.TextRenderEndPosition - metrics.TextRenderStartPosition, editor.LineHeight);
cr.Fill ();
return true;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs
index 2825c85cc0..fd2e53ef29 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs
@@ -628,10 +628,10 @@ namespace Mono.TextEditor
cr.Rectangle (x1 + 0.5, y + 0.5, x2 - x1, editor.LineHeight - 1);
- cr.Color = fillGc;
+ cr.SetSourceColor (fillGc);
cr.FillPreserve ();
- cr.Color = rectangleGc;
+ cr.SetSourceColor (rectangleGc);
cr.Stroke ();
}
}
@@ -656,7 +656,7 @@ namespace Mono.TextEditor
cr.Rectangle (metrics.X, metrics.Y, metrics.Width, metrics.Height);
var lineNumberGC = editor.ColorStyle.LineNumbers.Foreground;
- cr.Color = editor.Caret.Line == metrics.LineNumber ? editor.ColorStyle.LineMarker.Color : lineNumberGC;
+ cr.SetSourceColor (editor.Caret.Line == metrics.LineNumber ? editor.ColorStyle.LineMarker.Color : lineNumberGC);
cr.Fill ();
return true;
@@ -677,7 +677,7 @@ namespace Mono.TextEditor
layout.SetText (metrics.LineNumber.ToString ());
cr.Save ();
cr.Translate (metrics.X + (int)width + (editor.Options.ShowFoldMargin ? 0 : -2), metrics.Y);
- cr.Color = lineNumberBgGC;
+ cr.SetSourceColor (lineNumberBgGC);
cr.ShowLayout (layout);
cr.Restore ();
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs
index 7e6ba99835..4e2c7c5a80 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs
@@ -146,9 +146,9 @@ namespace Mono.TextEditor
}
double height = editor.LineHeight / 5;
if (selected) {
- cr.Color = editor.ColorStyle.SelectedText.Foreground;
+ cr.SetSourceColor (editor.ColorStyle.SelectedText.Foreground);
} else {
- cr.Color = ColorName == null ? Color : editor.ColorStyle.GetChunkStyle (ColorName).Foreground;
+ cr.SetSourceColor (ColorName == null ? Color : editor.ColorStyle.GetChunkStyle (ColorName).Foreground);
}
if (Wave) {
Pango.CairoHelper.ShowErrorUnderline (cr, @from, y + editor.LineHeight - height, to - @from, height);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs
index 1bd3401682..0e8f4240d2 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs
@@ -123,9 +123,9 @@ namespace Mono.TextEditor
}
double height = editor.LineHeight / 5;
if (selected) {
- cr.Color = editor.ColorStyle.SelectedText.Foreground;
+ cr.SetSourceColor (editor.ColorStyle.SelectedText.Foreground);
} else {
- cr.Color = ColorName == null ? Color : editor.ColorStyle.GetChunkStyle (ColorName).Foreground;
+ cr.SetSourceColor (ColorName == null ? Color : editor.ColorStyle.GetChunkStyle (ColorName).Foreground);
}
if (Wave) {
Pango.CairoHelper.ShowErrorUnderline (cr, @from, y + editor.LineHeight - height, to - @from, height);