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:
Aaron Barany
2018-05-07 13:56:39 -07:00
parent 993f8177c0
commit 328289484a
3 changed files with 16 additions and 8 deletions

View File

@@ -7,8 +7,10 @@ DefaultTextEditorColorScheme=dark.xml
shadowBackground=ff232323 shadowBackground=ff232323
text=ffe7e7e7 text=ffe7e7e7
textDisabled=7fffffff textDisabled=7fffffff
textHighlighted=ffe7e7e7
hoverBackground=18ffffff hoverBackground=18ffffff
selectedBackground=66000000 selectedBackground=66000000
selectedBackgroundText=aa1f75cc
normalBackground=ff333333 normalBackground=ff333333
alternateBackground=ff515151 alternateBackground=ff515151
error=ffd84044 error=ffd84044
@@ -118,7 +120,7 @@ SplitterColor=splitterColor
TextColorDisabled=textDisabled TextColorDisabled=textDisabled
TextColorError=ffff4040 TextColorError=ffff4040
TextColorHighlight=ffff0000 TextColorHighlight=ffff0000
TextColorHighlightBackground=555500 TextColorHighlightBackground=7a6f1c
TextColorLink=textColorLink TextColorLink=textColorLink
TextColorLinkVisited=textColorLinkVisited TextColorLinkVisited=textColorLinkVisited
TextColorNormal=text TextColorNormal=text
@@ -143,7 +145,7 @@ OutputPanes_TestWarnTextColor=ffc8c800
OutputPanes_TestFatalTextColor=ffb42828 OutputPanes_TestFatalTextColor=ffb42828
OutputPanes_TestDebugTextColor=ff329696 OutputPanes_TestDebugTextColor=ff329696
OutputPaneButtonFlashColor=error OutputPaneButtonFlashColor=error
OutputPaneToggleButtonTextColorChecked=text OutputPaneToggleButtonTextColorChecked=textHighlighted
OutputPaneToggleButtonTextColorUnchecked=text OutputPaneToggleButtonTextColorUnchecked=text
Debugger_LogWindow_LogInput=ff00acac Debugger_LogWindow_LogInput=ff00acac
@@ -204,9 +206,9 @@ PaletteText=text
PaletteButtonText=text PaletteButtonText=text
PaletteButtonTextDisabled=textDisabled PaletteButtonTextDisabled=textDisabled
PaletteToolTipBase=selectedBackground PaletteToolTipBase=selectedBackground
PaletteHighlight=selectedBackground PaletteHighlight=selectedBackgroundText
PaletteDark=shadowBackground PaletteDark=shadowBackground
PaletteHighlightedText=ffffffff PaletteHighlightedText=textHighlighted
PaletteToolTipText=text PaletteToolTipText=text
PaletteLink=textColorLink PaletteLink=textColorLink
PaletteLinkVisited=textColorLinkVisited PaletteLinkVisited=textColorLinkVisited

View File

@@ -7,12 +7,14 @@ DefaultTextEditorColorScheme=creator-dark.xml
shadowBackground=ff404244 shadowBackground=ff404244
text=ffd0d0d0 text=ffd0d0d0
textDisabled=60a4a6a8 textDisabled=60a4a6a8
textHighlighted=fff0f0f0
toolBarItem=b6fbfdff toolBarItem=b6fbfdff
toolBarItemDisabled=60a4a6a8 toolBarItemDisabled=60a4a6a8
fancyBarsNormalTextColor=ffd0d0d0 fancyBarsNormalTextColor=ffd0d0d0
fancyBarsBoldTextColor=b6fbfdff fancyBarsBoldTextColor=b6fbfdff
hoverBackground=22ffffff hoverBackground=22ffffff
selectedBackground=66000000 selectedBackground=66000000
selectedBackgroundText=ff1d545c
normalBackground=ff2E2F30 normalBackground=ff2E2F30
alternateBackground=ff353637 alternateBackground=ff353637
error=ffdf4f4f error=ffdf4f4f
@@ -122,7 +124,7 @@ SplitterColor=splitter
TextColorDisabled=textDisabled TextColorDisabled=textDisabled
TextColorError=ffff4040 TextColorError=ffff4040
TextColorHighlight=ffff0000 TextColorHighlight=ffff0000
TextColorHighlightBackground=8a7f2c TextColorHighlightBackground=7a6f1c
TextColorLink=textColorLink TextColorLink=textColorLink
TextColorLinkVisited=textColorLinkVisited TextColorLinkVisited=textColorLinkVisited
TextColorNormal=text TextColorNormal=text
@@ -147,7 +149,7 @@ OutputPanes_TestWarnTextColor=ffc8c800
OutputPanes_TestFatalTextColor=ffc82828 OutputPanes_TestFatalTextColor=ffc82828
OutputPanes_TestDebugTextColor=ff329696 OutputPanes_TestDebugTextColor=ff329696
OutputPaneButtonFlashColor=error OutputPaneButtonFlashColor=error
OutputPaneToggleButtonTextColorChecked=fancyBarsNormalTextColor OutputPaneToggleButtonTextColorChecked=textHighlighted
OutputPaneToggleButtonTextColorUnchecked=fancyBarsNormalTextColor OutputPaneToggleButtonTextColorUnchecked=fancyBarsNormalTextColor
Debugger_LogWindow_LogInput=ff00acac Debugger_LogWindow_LogInput=ff00acac
@@ -222,9 +224,9 @@ PaletteText=text
PaletteButtonText=text PaletteButtonText=text
PaletteButtonTextDisabled=textDisabled PaletteButtonTextDisabled=textDisabled
PaletteToolTipBase=selectedBackground PaletteToolTipBase=selectedBackground
PaletteHighlight=selectedBackground PaletteHighlight=selectedBackgroundText
PaletteDark=shadowBackground PaletteDark=shadowBackground
PaletteHighlightedText=ffffffff PaletteHighlightedText=textHighlighted
PaletteToolTipText=text PaletteToolTipText=text
PaletteLink=textColorLink PaletteLink=textColorLink
PaletteLinkVisited=textColorLinkVisited PaletteLinkVisited=textColorLinkVisited

View File

@@ -87,6 +87,7 @@ public:
LocatorModel(QObject *parent = nullptr) LocatorModel(QObject *parent = nullptr)
: QAbstractListModel(parent) : QAbstractListModel(parent)
, mBackgroundColor(Utils::creatorTheme()->color(Utils::Theme::TextColorHighlightBackground)) , mBackgroundColor(Utils::creatorTheme()->color(Utils::Theme::TextColorHighlightBackground))
, mForegroundColor(Utils::creatorTheme()->color(Utils::Theme::TextColorNormal))
{} {}
void clear(); void clear();
@@ -100,6 +101,7 @@ private:
mutable QList<LocatorFilterEntry> mEntries; mutable QList<LocatorFilterEntry> mEntries;
bool hasExtraInfo = false; bool hasExtraInfo = false;
QColor mBackgroundColor; QColor mBackgroundColor;
QColor mForegroundColor;
}; };
class CompletionDelegate : public HighlightingItemDelegate class CompletionDelegate : public HighlightingItemDelegate
@@ -224,6 +226,8 @@ QVariant LocatorModel::data(const QModelIndex &index, int role) const
} }
case int(HighlightingItemRole::Background): case int(HighlightingItemRole::Background):
return mBackgroundColor; return mBackgroundColor;
case int(HighlightingItemRole::Foreground):
return mForegroundColor;
} }
return QVariant(); return QVariant();