Message info
 
To:kde-commits@kde.org From:Dominik Haumann Subject:[kate] part: make vertical indentation line color configurable Date:Sun, 18 Mar 2012 16:35:52 +0100 (CET)
 

Git commit 52e3db8b540942eacac636057957bd21cc91ab7a by Dominik Haumann.
Committed on 18/03/2012 at 16:34.
Pushed by dhaumann into branch 'master'.

make vertical indentation line color configurable

M +1 -1 part/render/katerenderer.cpp
M +6 -0 part/schema/kateschemaconfig.cpp
M +23 -1 part/utils/kateconfig.cpp
M +5 -0 part/utils/kateconfig.h

http://commits.kde.org/kate/52e3db8b540942eacac636057957bd21cc91ab7a

diff --git a/part/render/katerenderer.cpp b/part/render/katerenderer.cpp
index 1dc8497..fb9ecc8 100644
--- a/part/render/katerenderer.cpp
+++ b/part/render/katerenderer.cpp
@@ -291,7 +291,7 @@ void KateRenderer::paintNonBreakSpace(QPainter &paint, qreal x, qreal y)
void KateRenderer::paintIndentMarker(QPainter &paint, uint x, uint row)
{
QPen penBackup( paint.pen() );
- paint.setPen( config()->tabMarkerColor() );
+ paint.setPen( config()->indentationLineColor() );

const int height = config()->fontMetrics().height();
const int top = 0;
diff --git a/part/schema/kateschemaconfig.cpp b/part/schema/kateschemaconfig.cpp
index 056e1c7..c89bdc8 100644
--- a/part/schema/kateschemaconfig.cpp
+++ b/part/schema/kateschemaconfig.cpp
@@ -176,6 +176,12 @@ QVector<KateColorItem> KateSchemaConfigColorTab::colorItemList() const
ci.defaultColor = KColorUtils::shade(schemeView.background().color(), bgLuma > 0.7 ? -0.35 : 0.3);
items.append(ci);

+ ci.name = i18n("Indentation Line");
+ ci.key = "Color Indentation Line";
+ ci.whatsThis = i18n("<p>Sets the color of the vertical indentation lines.</p>");
+ ci.defaultColor = KColorUtils::shade(schemeView.background().color(), bgLuma > 0.7 ? -0.35 : 0.3);
+ items.append(ci);
+
ci.name = i18n("Bracket Highlight");
ci.key = "Color Highlighted Bracket";
ci.whatsThis = i18n("<p>Sets the bracket matching color. This means, if you place the cursor e.g. at a <b>(</b>, the matching <b>)</b> will be highlighted with this color.</p>");
diff --git a/part/utils/kateconfig.cpp b/part/utils/kateconfig.cpp
index dfdd865..be4dd02 100644
--- a/part/utils/kateconfig.cpp
+++ b/part/utils/kateconfig.cpp
@@ -1731,6 +1731,7 @@ KateRendererConfig::KateRendererConfig ()
m_highlightedBracketColorSet (true),
m_wordWrapMarkerColorSet (true),
m_tabMarkerColorSet(true),
+ m_indentationLineColorSet(true),
m_iconBarColorSet(true),
m_foldingColorSet(true),
m_lineNumberColorSet (true),
@@ -1766,7 +1767,8 @@ KateRendererConfig::KateRendererConfig (KateRenderer *renderer)
m_highlightedLineColorSet (false),
m_highlightedBracketColorSet (false),
m_wordWrapMarkerColorSet (false),
- m_tabMarkerColorSet(false),
+ m_tabMarkerColorSet (false),
+ m_indentationLineColorSet (false),
m_iconBarColorSet (false),
m_foldingColorSet (false),
m_lineNumberColorSet (false),
@@ -1896,6 +1898,8 @@ void KateRendererConfig::setSchemaInternal( const QString &schema )
m_wordWrapMarkerColorSet = true;
m_tabMarkerColor = config.readEntry("Color Tab Marker", tmp5);
m_tabMarkerColorSet = true;
+ m_indentationLineColor = config.readEntry("Color Indentation Line", tmp5);
+ m_indentationLineColorSet = true;
m_iconBarColor = config.readEntry("Color Icon Bar", tmp6);
m_iconBarColorSet = true;
m_foldingColor = config.readEntry("Color Code Folding", tmp12);
@@ -2136,6 +2140,24 @@ void KateRendererConfig::setTabMarkerColor (const QColor &col)
configEnd ();
}

+const QColor& KateRendererConfig::indentationLineColor() const
+{
+ if (m_indentationLineColorSet || isGlobal())
+ return m_indentationLineColor;
+
+ return s_global->indentationLineColor();
+}
+
+void KateRendererConfig::setIndentationLineColor (const QColor &col)
+{
+ configStart ();
+
+ m_indentationLineColorSet = true;
+ m_indentationLineColor = col;
+
+ configEnd ();
+}
+
const QColor& KateRendererConfig::iconBarColor() const
{
if (m_iconBarColorSet || isGlobal())
diff --git a/part/utils/kateconfig.h b/part/utils/kateconfig.h
index 47933ac..5b4abff 100644
--- a/part/utils/kateconfig.h
+++ b/part/utils/kateconfig.h
@@ -655,6 +655,9 @@ class KateRendererConfig : public KateConfig
const QColor& tabMarkerColor() const;
void setTabMarkerColor (const QColor &col);

+ const QColor& indentationLineColor() const;
+ void setIndentationLineColor (const QColor &col);
+
const QColor& iconBarColor() const;
void setIconBarColor (const QColor &col);

@@ -710,6 +713,7 @@ class KateRendererConfig : public KateConfig
QColor m_highlightedBracketColor;
QColor m_wordWrapMarkerColor;
QColor m_tabMarkerColor;
+ QColor m_indentationLineColor;
QColor m_iconBarColor;
QColor m_foldingColor;
QColor m_lineNumberColor;
@@ -737,6 +741,7 @@ class KateRendererConfig : public KateConfig
bool m_highlightedBracketColorSet : 1;
bool m_wordWrapMarkerColorSet : 1;
bool m_tabMarkerColorSet : 1;
+ bool m_indentationLineColorSet : 1;
bool m_iconBarColorSet : 1;
bool m_foldingColorSet : 1;
bool m_lineNumberColorSet : 1;