Browse Source

Forum-8545: Fixed color of +/- sign in folding marker.

By default, use system colors for folding marker.
Fixed Mode.xsd so that .xshd files generated by the highlighting editor are valid again.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3658 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
20fad3dd84
  1. 11
      src/Libraries/ICSharpCode.TextEditor/Project/Resources/Boo.xshd
  2. 1
      src/Libraries/ICSharpCode.TextEditor/Project/Resources/Mode.xsd
  3. 6
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/HighlightingStrategy/DefaultHighlightingStrategy.cs
  4. 14
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/HighlightingStrategy/HighlightColor.cs
  5. 9
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/FoldMargin.cs

11
src/Libraries/ICSharpCode.TextEditor/Project/Resources/Boo.xshd

@ -3,17 +3,6 @@ @@ -3,17 +3,6 @@
<SyntaxDefinition name="Boo" extensions=".boo">
<Environment>
<Default bold="false" italic="false" color="SystemColors.WindowText" bgcolor="SystemColors.Window" />
<Selection bold="false" italic="false" color="SystemColors.HighlightText" bgcolor="SystemColors.Highlight" />
<VRuler bold="false" italic="false" color="SystemColors.ControlLight" />
<InvalidLines bold="false" italic="false" color="Red" />
<CaretMarker bold="false" italic="false" color="Yellow" />
<LineNumbers bold="false" italic="false" color="SystemColors.ControlDark" bgcolor="SystemColors.Window" />
<FoldLine bold="false" italic="false" color="Gray" bgcolor="Black" />
<FoldMarker bold="false" italic="false" color="Gray" bgcolor="White" />
<EOLMarkers bold="false" italic="false" color="#E0E0E5" />
<SpaceMarkers bold="false" italic="false" color="#E0E0E5" />
<TabMarkers bold="false" italic="false" color="#E0E0E5" />
<Custom name="LocalVariableCreation" bold="false" italic="false" color="#04ABAB" />
</Environment>

1
src/Libraries/ICSharpCode.TextEditor/Project/Resources/Mode.xsd

@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
<xsd:element name="VRuler" type="EnvironmentEntry" minOccurs="0" maxOccurs="1"/>
<xsd:element name="InvalidLines" type="EnvironmentEntry" minOccurs="0" maxOccurs="1"/>
<xsd:element name="CaretMarker" type="EnvironmentEntry" minOccurs="0" maxOccurs="1"/>
<xsd:element name="CaretLine" type="EnvironmentEntry" minOccurs="0" maxOccurs="1"/>
<xsd:element name="LineNumbers" type="EnvironmentEntry" minOccurs="0" maxOccurs="1"/>

6
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/HighlightingStrategy/DefaultHighlightingStrategy.cs

@ -74,9 +74,9 @@ namespace ICSharpCode.TextEditor.Document @@ -74,9 +74,9 @@ namespace ICSharpCode.TextEditor.Document
environmentColors["CaretLine"] = new HighlightBackground("ControlLight", "Window", false, false);
environmentColors["LineNumbers"] = new HighlightBackground("ControlDark", "Window", false, false);
environmentColors["FoldLine"] = new HighlightColor(Color.FromArgb(0x80, 0x80, 0x80), Color.Black, false, false);
environmentColors["FoldMarker"] = new HighlightColor(Color.FromArgb(0x80, 0x80, 0x80), Color.White, false, false);
environmentColors["SelectedFoldLine"] = new HighlightColor(Color.Black, false, false);
environmentColors["FoldLine"] = new HighlightColor("ControlDark", false, false);
environmentColors["FoldMarker"] = new HighlightColor("WindowText", "Window", false, false);
environmentColors["SelectedFoldLine"] = new HighlightColor("WindowText", false, false);
environmentColors["EOLMarkers"] = new HighlightColor("ControlLight", "Window", false, false);
environmentColors["SpaceMarkers"] = new HighlightColor("ControlLight", "Window", false, false);
environmentColors["TabMarkers"] = new HighlightColor("ControlLight", "Window", false, false);

14
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/HighlightingStrategy/HighlightColor.cs

@ -251,6 +251,20 @@ namespace ICSharpCode.TextEditor.Document @@ -251,6 +251,20 @@ namespace ICSharpCode.TextEditor.Document
this.italic = italic;
}
/// <summary>
/// Creates a new instance of <see cref="HighlightColor"/>
/// </summary>
public HighlightColor(string systemColor, bool bold, bool italic)
{
hasForeground = true;
this.systemColor = true;
systemColorName = systemColor;
this.bold = bold;
this.italic = italic;
}
static Color ParseColor(string c)
{
int a = 255;

9
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/FoldMargin.cs

@ -44,7 +44,6 @@ namespace ICSharpCode.TextEditor @@ -44,7 +44,6 @@ namespace ICSharpCode.TextEditor
return;
}
HighlightColor lineNumberPainterColor = textArea.Document.HighlightingStrategy.GetColorFor("LineNumbers");
HighlightColor foldLineColor = textArea.Document.HighlightingStrategy.GetColorFor("FoldLine");
for (int y = 0; y < (DrawingPosition.Height + textArea.TextView.VisibleLineDrawingRemainder) / textArea.TextView.FontHeight + 1; ++y) {
@ -251,19 +250,21 @@ namespace ICSharpCode.TextEditor @@ -251,19 +250,21 @@ namespace ICSharpCode.TextEditor
Rectangle intRect = new Rectangle((int)rectangle.X, (int)rectangle.Y, (int)rectangle.Width, (int)rectangle.Height);
g.FillRectangle(BrushRegistry.GetBrush(foldMarkerColor.BackgroundColor), intRect);
g.DrawRectangle(BrushRegistry.GetPen(isSelected ? selectedFoldLine.Color : foldMarkerColor.Color), intRect);
g.DrawRectangle(BrushRegistry.GetPen(isSelected ? selectedFoldLine.Color : foldLineColor.Color), intRect);
int space = (int)Math.Round(((double)rectangle.Height) / 8d) + 1;
int mid = intRect.Height / 2 + intRect.Height % 2;
g.DrawLine(BrushRegistry.GetPen(foldLineColor.BackgroundColor),
// draw minus
g.DrawLine(BrushRegistry.GetPen(foldMarkerColor.Color),
rectangle.X + space,
rectangle.Y + mid,
rectangle.X + rectangle.Width - space,
rectangle.Y + mid);
// draw plus
if (!isOpened) {
g.DrawLine(BrushRegistry.GetPen(foldLineColor.BackgroundColor),
g.DrawLine(BrushRegistry.GetPen(foldMarkerColor.Color),
rectangle.X + mid,
rectangle.Y + space,
rectangle.X + mid,

Loading…
Cancel
Save