forked from qt-creator/qt-creator
Editor: Fix dark themes
Text selection now uses a subdued blue selection. Selections were previously nearly impossible to see due to the colors being almost the same as unselected text. Locator now uses the normal text color when highlighting what the user typed. This fixes a dark text color being used with a dark background, which was difficult to read. Also make the highlighting background a bit lighter to improve contrast. Task-number: QTCREATORBUG-18888 Change-Id: I2f48dc83844270cc832841b94ad5dea9cc6c6f00 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -7,8 +7,10 @@ DefaultTextEditorColorScheme=dark.xml
|
||||
shadowBackground=ff232323
|
||||
text=ffe7e7e7
|
||||
textDisabled=7fffffff
|
||||
textHighlighted=ffe7e7e7
|
||||
hoverBackground=18ffffff
|
||||
selectedBackground=66000000
|
||||
selectedBackgroundText=aa1f75cc
|
||||
normalBackground=ff333333
|
||||
alternateBackground=ff515151
|
||||
error=ffd84044
|
||||
@@ -118,7 +120,7 @@ SplitterColor=splitterColor
|
||||
TextColorDisabled=textDisabled
|
||||
TextColorError=ffff4040
|
||||
TextColorHighlight=ffff0000
|
||||
TextColorHighlightBackground=555500
|
||||
TextColorHighlightBackground=7a6f1c
|
||||
TextColorLink=textColorLink
|
||||
TextColorLinkVisited=textColorLinkVisited
|
||||
TextColorNormal=text
|
||||
@@ -143,7 +145,7 @@ OutputPanes_TestWarnTextColor=ffc8c800
|
||||
OutputPanes_TestFatalTextColor=ffb42828
|
||||
OutputPanes_TestDebugTextColor=ff329696
|
||||
OutputPaneButtonFlashColor=error
|
||||
OutputPaneToggleButtonTextColorChecked=text
|
||||
OutputPaneToggleButtonTextColorChecked=textHighlighted
|
||||
OutputPaneToggleButtonTextColorUnchecked=text
|
||||
|
||||
Debugger_LogWindow_LogInput=ff00acac
|
||||
@@ -204,9 +206,9 @@ PaletteText=text
|
||||
PaletteButtonText=text
|
||||
PaletteButtonTextDisabled=textDisabled
|
||||
PaletteToolTipBase=selectedBackground
|
||||
PaletteHighlight=selectedBackground
|
||||
PaletteHighlight=selectedBackgroundText
|
||||
PaletteDark=shadowBackground
|
||||
PaletteHighlightedText=ffffffff
|
||||
PaletteHighlightedText=textHighlighted
|
||||
PaletteToolTipText=text
|
||||
PaletteLink=textColorLink
|
||||
PaletteLinkVisited=textColorLinkVisited
|
||||
|
@@ -7,12 +7,14 @@ DefaultTextEditorColorScheme=creator-dark.xml
|
||||
shadowBackground=ff404244
|
||||
text=ffd0d0d0
|
||||
textDisabled=60a4a6a8
|
||||
textHighlighted=fff0f0f0
|
||||
toolBarItem=b6fbfdff
|
||||
toolBarItemDisabled=60a4a6a8
|
||||
fancyBarsNormalTextColor=ffd0d0d0
|
||||
fancyBarsBoldTextColor=b6fbfdff
|
||||
hoverBackground=22ffffff
|
||||
selectedBackground=66000000
|
||||
selectedBackgroundText=ff1d545c
|
||||
normalBackground=ff2E2F30
|
||||
alternateBackground=ff353637
|
||||
error=ffdf4f4f
|
||||
@@ -122,7 +124,7 @@ SplitterColor=splitter
|
||||
TextColorDisabled=textDisabled
|
||||
TextColorError=ffff4040
|
||||
TextColorHighlight=ffff0000
|
||||
TextColorHighlightBackground=8a7f2c
|
||||
TextColorHighlightBackground=7a6f1c
|
||||
TextColorLink=textColorLink
|
||||
TextColorLinkVisited=textColorLinkVisited
|
||||
TextColorNormal=text
|
||||
@@ -147,7 +149,7 @@ OutputPanes_TestWarnTextColor=ffc8c800
|
||||
OutputPanes_TestFatalTextColor=ffc82828
|
||||
OutputPanes_TestDebugTextColor=ff329696
|
||||
OutputPaneButtonFlashColor=error
|
||||
OutputPaneToggleButtonTextColorChecked=fancyBarsNormalTextColor
|
||||
OutputPaneToggleButtonTextColorChecked=textHighlighted
|
||||
OutputPaneToggleButtonTextColorUnchecked=fancyBarsNormalTextColor
|
||||
|
||||
Debugger_LogWindow_LogInput=ff00acac
|
||||
@@ -222,9 +224,9 @@ PaletteText=text
|
||||
PaletteButtonText=text
|
||||
PaletteButtonTextDisabled=textDisabled
|
||||
PaletteToolTipBase=selectedBackground
|
||||
PaletteHighlight=selectedBackground
|
||||
PaletteHighlight=selectedBackgroundText
|
||||
PaletteDark=shadowBackground
|
||||
PaletteHighlightedText=ffffffff
|
||||
PaletteHighlightedText=textHighlighted
|
||||
PaletteToolTipText=text
|
||||
PaletteLink=textColorLink
|
||||
PaletteLinkVisited=textColorLinkVisited
|
||||
|
@@ -87,6 +87,7 @@ public:
|
||||
LocatorModel(QObject *parent = nullptr)
|
||||
: QAbstractListModel(parent)
|
||||
, mBackgroundColor(Utils::creatorTheme()->color(Utils::Theme::TextColorHighlightBackground))
|
||||
, mForegroundColor(Utils::creatorTheme()->color(Utils::Theme::TextColorNormal))
|
||||
{}
|
||||
|
||||
void clear();
|
||||
@@ -100,6 +101,7 @@ private:
|
||||
mutable QList<LocatorFilterEntry> mEntries;
|
||||
bool hasExtraInfo = false;
|
||||
QColor mBackgroundColor;
|
||||
QColor mForegroundColor;
|
||||
};
|
||||
|
||||
class CompletionDelegate : public HighlightingItemDelegate
|
||||
@@ -224,6 +226,8 @@ QVariant LocatorModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
case int(HighlightingItemRole::Background):
|
||||
return mBackgroundColor;
|
||||
case int(HighlightingItemRole::Foreground):
|
||||
return mForegroundColor;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
|
Reference in New Issue
Block a user