diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 669b5ab332e..baf0b1f208b 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -1498,10 +1498,8 @@ QRect BaseTextEditor::collapseBox()
QTextBlock begin = document()->findBlockByNumber(d->m_highlightBlocksInfo.open.last());
- if (true || !d->m_displaySettings.m_fancyFoldingBar) {
- if (TextBlockUserData::hasCollapseAfter(begin.previous()))
- begin = begin.previous();
- }
+ if (TextBlockUserData::hasCollapseAfter(begin.previous()))
+ begin = begin.previous();
QTextBlock end = document()->findBlockByNumber(d->m_highlightBlocksInfo.close.first());
if (!begin.isValid() || !end.isValid())
@@ -1694,13 +1692,6 @@ void BaseTextEditorPrivate::moveCursorVisible(bool ensureVisible)
q->ensureCursorVisible();
}
-static QColor calcMixColor(const QColor &one, const QColor &two)
-{
- return QColor((one.red() + two.red()) / 2,
- (one.green() + two.green()) / 2,
- (one.blue() + two.blue()) / 2);
-}
-
static QColor calcBlendColor(const QColor &baseColor, int factor = 1)
{
const int blendBase = (baseColor.value() > 128) ? 0 : 255;
@@ -2313,71 +2304,7 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
}
}
- if (d->m_codeFoldingVisible && d->m_displaySettings.m_fancyFoldingBar) {
- QRect r(extraAreaWidth+2, top, collapseBoxWidth-4, bottom - top);
-
- int extraAreaHighlightCollapseBlockNumber = -1;
- int extraAreaHighlightCollapseEndBlockNumber = -1;
- if (!d->m_highlightBlocksInfo.isEmpty()) {
- extraAreaHighlightCollapseBlockNumber = d->m_highlightBlocksInfo.open.last();
- extraAreaHighlightCollapseEndBlockNumber = d->m_highlightBlocksInfo.close.first();
-
- QTextBlock before = doc->findBlockByNumber(extraAreaHighlightCollapseBlockNumber-1);
- if (TextBlockUserData::hasCollapseAfter(before)) {
- extraAreaHighlightCollapseBlockNumber--;
- }
- }
- int minBraceDepth = qMax(braceDepth, previousBraceDepth);
- QColor color = calcBlendColor(baseColor, minBraceDepth);
- if (!d->m_highlightBlocksInfo.isEmpty()
- && blockNumber >= extraAreaHighlightCollapseBlockNumber
- && blockNumber <= extraAreaHighlightCollapseEndBlockNumber)
- color = calcMixColor(pal.highlight().color(), color);
- painter.fillRect(r, color);
-
- bool drawBox = !nextBlock.isVisible();
- bool drawDown = !d->m_highlightBlocksInfo.isEmpty()
- && blockNumber == extraAreaHighlightCollapseBlockNumber;
- bool drawUp = !d->m_highlightBlocksInfo.isEmpty()
- && blockNumber == extraAreaHighlightCollapseEndBlockNumber;
-
- if (drawBox || drawDown || drawUp) {
- painter.setRenderHint(QPainter::Antialiasing, true);
- painter.translate(.5, .5);
- painter.setPen(pal.text().color());
- painter.setBrush(pal.text().color());
-
- if (drawBox) {
- QPointF points1[3] = { QPointF(r.left(), r.center().y()-1),
- QPointF(r.center().x(), r.top()),
- QPointF(r.right(), r.center().y()-1) };
- QPointF points2[3] = { QPointF(r.left(), r.center().y()+1),
- QPointF(r.center().x(), r.bottom()-1),
- QPointF(r.right(), r.center().y()+1) };
- painter.drawPolygon(points1, 3);
- painter.drawPolygon(points2, 3);
- } else if (drawUp) {
-
- // check that we are not collapsed
- QTextBlock open = doc->findBlockByNumber(extraAreaHighlightCollapseBlockNumber);
- if (open.next().isVisible()) {
-
- QPointF points[3] = { QPointF(r.left(), r.bottom()-1),
- QPointF(r.center().x(), r.center().y()),
- QPointF(r.right(), r.bottom()-1) };
- painter.drawPolygon(points, 3);
- }
- } else if(drawDown) {
- QPointF points[3] = { QPointF(r.left(), r.top()),
- QPointF(r.center().x(), r.center().y()),
- QPointF(r.right(), r.top()) };
- painter.drawPolygon(points, 3);
- }
- painter.translate(-.5, -.5);
- painter.setRenderHint(QPainter::Antialiasing, false);
- }
-
- } else if (d->m_codeFoldingVisible) {
+ if (d->m_codeFoldingVisible) {
bool collapseThis = false;
bool collapseAfter = false;
@@ -2473,13 +2400,6 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
block = nextVisibleBlock;
blockNumber = nextVisibleBlockNumber;
}
-
- if (d->m_codeFoldingVisible && d->m_displaySettings.m_fancyFoldingBar) {
- painter.drawLine(extraAreaWidth, 0,
- extraAreaWidth, viewport()->height());
- painter.drawLine(extraAreaWidth + collapseBoxWidth - 1, 0,
- extraAreaWidth + collapseBoxWidth - 1, viewport()->height());
- }
}
void BaseTextEditor::drawFoldingMarker(QPainter *painter, const QRect &rect,
@@ -2707,15 +2627,13 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
d->extraAreaHighlightCollapseBlockNumber = -1;
d->extraAreaHighlightCollapseColumn = -1;
-
int collapseBoxWidth = fontMetrics().lineSpacing() + 1;
if (e->pos().x() > extraArea()->width() - collapseBoxWidth) {
d->extraAreaHighlightCollapseBlockNumber = cursor.blockNumber();
if (TextBlockUserData::canCollapse(cursor.block())
|| !TextBlockUserData::hasClosingCollapse(cursor.block()))
d->extraAreaHighlightCollapseColumn = cursor.block().length()-1;
- if ((true || !d->m_displaySettings.m_fancyFoldingBar)
- && TextBlockUserData::hasCollapseAfter(cursor.block())) {
+ if (TextBlockUserData::hasCollapseAfter(cursor.block())) {
d->extraAreaHighlightCollapseBlockNumber++;
d->extraAreaHighlightCollapseColumn = -1;
if (TextBlockUserData::canCollapse(cursor.block().next())
diff --git a/src/plugins/texteditor/displaysettings.cpp b/src/plugins/texteditor/displaysettings.cpp
index b16cc1436ea..b0273a2c887 100644
--- a/src/plugins/texteditor/displaysettings.cpp
+++ b/src/plugins/texteditor/displaysettings.cpp
@@ -43,7 +43,6 @@ static const char * const displayFoldingMarkersKey = "DisplayFoldingMarkers";
static const char * const highlightCurrentLineKey = "HighlightCurrentLineKeyV2";
static const char * const highlightBlocksKey = "HighlightBlocksKey";
static const char * const animateMatchingParenthesesKey= "AnimateMatchingParenthesesKey";
-static const char * const fancyFoldingBarKey= "FancyFoldingBarKey";
static const char * const groupPostfix = "DisplaySettings";
namespace TextEditor {
@@ -57,8 +56,7 @@ DisplaySettings::DisplaySettings() :
m_displayFoldingMarkers(true),
m_highlightCurrentLine(false),
m_highlightBlocks(false),
- m_animateMatchingParentheses(true),
- m_fancyFoldingBar(false)
+ m_animateMatchingParentheses(true)
{
}
@@ -77,7 +75,6 @@ void DisplaySettings::toSettings(const QString &category, QSettings *s) const
s->setValue(QLatin1String(highlightCurrentLineKey), m_highlightCurrentLine);
s->setValue(QLatin1String(highlightBlocksKey), m_highlightBlocks);
s->setValue(QLatin1String(animateMatchingParenthesesKey), m_animateMatchingParentheses);
- s->setValue(QLatin1String(fancyFoldingBarKey), m_fancyFoldingBar);
s->endGroup();
}
@@ -99,7 +96,6 @@ void DisplaySettings::fromSettings(const QString &category, const QSettings *s)
m_highlightCurrentLine = s->value(group + QLatin1String(highlightCurrentLineKey), m_highlightCurrentLine).toBool();
m_highlightBlocks = s->value(group + QLatin1String(highlightBlocksKey), m_highlightBlocks).toBool();
m_animateMatchingParentheses = s->value(group + QLatin1String(animateMatchingParenthesesKey), m_animateMatchingParentheses).toBool();
- m_fancyFoldingBar = s->value(group + QLatin1String(fancyFoldingBarKey), m_fancyFoldingBar).toBool();
}
bool DisplaySettings::equals(const DisplaySettings &ds) const
@@ -113,7 +109,6 @@ bool DisplaySettings::equals(const DisplaySettings &ds) const
&& m_highlightCurrentLine == ds.m_highlightCurrentLine
&& m_highlightBlocks == ds.m_highlightBlocks
&& m_animateMatchingParentheses == ds.m_animateMatchingParentheses
- && m_fancyFoldingBar == ds.m_fancyFoldingBar
;
}
diff --git a/src/plugins/texteditor/displaysettings.h b/src/plugins/texteditor/displaysettings.h
index b05cc7a1915..06a7d0fa381 100644
--- a/src/plugins/texteditor/displaysettings.h
+++ b/src/plugins/texteditor/displaysettings.h
@@ -54,7 +54,6 @@ struct TEXTEDITOR_EXPORT DisplaySettings
bool m_highlightCurrentLine;
bool m_highlightBlocks;
bool m_animateMatchingParentheses;
- bool m_fancyFoldingBar;
bool equals(const DisplaySettings &ds) const;
};
diff --git a/src/plugins/texteditor/displaysettingspage.cpp b/src/plugins/texteditor/displaysettingspage.cpp
index 31c7c803d22..ec7ae6a2210 100644
--- a/src/plugins/texteditor/displaysettingspage.cpp
+++ b/src/plugins/texteditor/displaysettingspage.cpp
@@ -124,7 +124,6 @@ void DisplaySettingsPage::settingsFromUI(DisplaySettings &displaySettings) const
displaySettings.m_highlightCurrentLine = m_d->m_page.highlightCurrentLine->isChecked();
displaySettings.m_highlightBlocks = m_d->m_page.highlightBlocks->isChecked();
displaySettings.m_animateMatchingParentheses= m_d->m_page.animateMatchingParentheses->isChecked();
- displaySettings.m_fancyFoldingBar = m_d->m_page.fancyFoldingBar->isChecked();
}
void DisplaySettingsPage::settingsToUI()
@@ -139,7 +138,6 @@ void DisplaySettingsPage::settingsToUI()
m_d->m_page.highlightCurrentLine->setChecked(displaySettings.m_highlightCurrentLine);
m_d->m_page.highlightBlocks->setChecked(displaySettings.m_highlightBlocks);
m_d->m_page.animateMatchingParentheses->setChecked(displaySettings.m_animateMatchingParentheses);
- m_d->m_page.fancyFoldingBar->setChecked(displaySettings.m_fancyFoldingBar);
}
DisplaySettings DisplaySettingsPage::displaySettings() const
diff --git a/src/plugins/texteditor/displaysettingspage.ui b/src/plugins/texteditor/displaysettingspage.ui
index e6d7eb867a6..ee465dd8572 100644
--- a/src/plugins/texteditor/displaysettingspage.ui
+++ b/src/plugins/texteditor/displaysettingspage.ui
@@ -47,36 +47,6 @@
- -
-
-
-
-
-
- Qt::Horizontal
-
-
- QSizePolicy::Fixed
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- false
-
-
- Use fancy style
-
-
-
-
-
-
@@ -181,21 +151,5 @@
-
- displayFoldingMarkers
- toggled(bool)
- fancyFoldingBar
- setEnabled(bool)
-
-
- 60
- 161
-
-
- 87
- 179
-
-
-