forked from qt-creator/qt-creator
TextEditor: fix low contrast of hovered folding markers
When using the 'windowsvista' style the folding markers are blue when hovered. This color is almost invisible on the default folding range background color. Use the tested folding markers of the fusion style, because it is already used when device pixel ratio != 1.0 Change-Id: I23659cce71a2eb101692597a1d256d43f6426920 Fixes: QTCREATORBUG-21702 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -106,6 +106,7 @@
|
||||
#include <QScrollBar>
|
||||
#include <QShortcut>
|
||||
#include <QStyle>
|
||||
#include <QStyleFactory>
|
||||
#include <QTextBlock>
|
||||
#include <QTextCodec>
|
||||
#include <QTextCursor>
|
||||
@@ -5363,7 +5364,19 @@ void TextEditorWidgetPrivate::drawFoldingMarker(QPainter *painter, const QPalett
|
||||
if (hovered)
|
||||
opt.palette.setBrush(QPalette::Window, pal.highlight());
|
||||
|
||||
const char* const className = s->metaObject()->className();
|
||||
const char *className = s->metaObject()->className();
|
||||
|
||||
// Do not use the windows folding marker since we cannot style them and the default hover color
|
||||
// is a blue which does not guarantee an high contrast on all themes.
|
||||
static QPointer<QStyle> fusionStyleOverwrite = nullptr;
|
||||
if (!qstrcmp(className, "QWindowsVistaStyle")) {
|
||||
if (fusionStyleOverwrite.isNull())
|
||||
fusionStyleOverwrite = QStyleFactory::create("fusion");
|
||||
if (!fusionStyleOverwrite.isNull()) {
|
||||
s = fusionStyleOverwrite.data();
|
||||
className = s->metaObject()->className();
|
||||
}
|
||||
}
|
||||
|
||||
if (!qstrcmp(className, "OxygenStyle")) {
|
||||
const QStyle::PrimitiveElement direction = expanded ? QStyle::PE_IndicatorArrowDown
|
||||
|
Reference in New Issue
Block a user