From 328289484a646333579c028bcab8001862d7416d Mon Sep 17 00:00:00 2001 From: Aaron Barany Date: Mon, 7 May 2018 13:56:39 -0700 Subject: [PATCH] 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 Reviewed-by: Alessandro Portale --- share/qtcreator/themes/dark.creatortheme | 10 ++++++---- share/qtcreator/themes/flat-dark.creatortheme | 10 ++++++---- src/plugins/coreplugin/locator/locatorwidget.cpp | 4 ++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/share/qtcreator/themes/dark.creatortheme b/share/qtcreator/themes/dark.creatortheme index ef19fc9fa63..5da67fa2363 100644 --- a/share/qtcreator/themes/dark.creatortheme +++ b/share/qtcreator/themes/dark.creatortheme @@ -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 diff --git a/share/qtcreator/themes/flat-dark.creatortheme b/share/qtcreator/themes/flat-dark.creatortheme index 0c01aa17071..e73d10b0ffc 100644 --- a/share/qtcreator/themes/flat-dark.creatortheme +++ b/share/qtcreator/themes/flat-dark.creatortheme @@ -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 diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index 7276685d20f..2421bd776ab 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -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 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();