forked from qt-creator/qt-creator
Qml Designer Theming: Fix background color
The background color for light theme is too dark. Instead of trying hard to deduct that color mathematically, let's add a theme role for it. Change-Id: I6a49d43e7e11c87427242819c67988b05b87518b Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -200,6 +200,7 @@ PaletteWindowTextDisabled=textDisabled
|
||||
PaletteBaseDisabled=backgroundColorDisabled
|
||||
PaletteTextDisabled=textDisabled
|
||||
|
||||
QmlDesigner_BackgroundColor=ff3c3e40
|
||||
QmlDesigner_HighlightColor=ff46a2da
|
||||
|
||||
[Flags]
|
||||
|
@@ -171,6 +171,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=ffffa500
|
||||
ClangCodeModel_Error_TextMarkColor=ffff882f
|
||||
ClangCodeModel_Warning_TextMarkColor=ffc6c132
|
||||
|
||||
QmlDesigner_BackgroundColor=ff4c4e50
|
||||
QmlDesigner_HighlightColor=ff46a2da
|
||||
|
||||
[Flags]
|
||||
|
@@ -185,6 +185,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=ffffff40
|
||||
ClangCodeModel_Error_TextMarkColor=ffff882f
|
||||
ClangCodeModel_Warning_TextMarkColor=ffceff40
|
||||
|
||||
QmlDesigner_BackgroundColor=ff4c4e50
|
||||
QmlDesigner_HighlightColor=ff3f91c4
|
||||
|
||||
PaletteWindow=normalBackground
|
||||
|
@@ -182,6 +182,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=ffffa500
|
||||
ClangCodeModel_Error_TextMarkColor=ffff882f
|
||||
ClangCodeModel_Warning_TextMarkColor=ffc6c132
|
||||
|
||||
QmlDesigner_BackgroundColor=fff8f8f8
|
||||
QmlDesigner_HighlightColor=ff46a2da
|
||||
|
||||
[Flags]
|
||||
|
@@ -181,6 +181,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=ffffa500
|
||||
ClangCodeModel_Error_TextMarkColor=ffff882f
|
||||
ClangCodeModel_Warning_TextMarkColor=ffc6c132
|
||||
|
||||
QmlDesigner_BackgroundColor=ff4c4e50
|
||||
QmlDesigner_HighlightColor=ff46a2da
|
||||
|
||||
[Flags]
|
||||
|
@@ -282,6 +282,7 @@ public:
|
||||
ClangCodeModel_Warning_TextMarkColor,
|
||||
|
||||
/* QmlDesigner */
|
||||
QmlDesigner_BackgroundColor,
|
||||
QmlDesigner_HighlightColor
|
||||
};
|
||||
|
||||
|
@@ -33,13 +33,6 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
QColor midtone(const QColor &a, const QColor &b)
|
||||
{
|
||||
QColor alphaB = b;
|
||||
alphaB.setAlpha(128);
|
||||
return Utils::StyleHelper::alphaBlendedColors(a ,alphaB);
|
||||
}
|
||||
|
||||
void Theming::insertTheme(QQmlPropertyMap *map)
|
||||
{
|
||||
const QVariantHash creatorTheme = Utils::creatorTheme()->values();
|
||||
@@ -47,6 +40,7 @@ void Theming::insertTheme(QQmlPropertyMap *map)
|
||||
map->insert(it.key(), it.value());
|
||||
|
||||
/* Define QmlDesigner colors and remove alpha channels */
|
||||
const QColor backgroundColor = Utils::creatorTheme()->color(Utils::Theme::QmlDesigner_BackgroundColor);
|
||||
const QColor panelStatusBarBackgroundColor = Utils::creatorTheme()->color(Utils::Theme::PanelStatusBarBackgroundColor);
|
||||
const QColor fancyToolButtonSelectedColor = Utils::creatorTheme()->color(Utils::Theme::FancyToolButtonSelectedColor);
|
||||
const QColor darkerBackground = Utils::StyleHelper::alphaBlendedColors(panelStatusBarBackgroundColor, fancyToolButtonSelectedColor);
|
||||
@@ -65,7 +59,7 @@ void Theming::insertTheme(QQmlPropertyMap *map)
|
||||
}
|
||||
|
||||
map->insert("QmlDesignerBackgroundColorDarker", darkerBackground);
|
||||
map->insert("QmlDesignerBackgroundColorDarkAlternate", midtone(panelStatusBarBackgroundColor, buttonColor));
|
||||
map->insert("QmlDesignerBackgroundColorDarkAlternate", backgroundColor);
|
||||
map->insert("QmlDesignerTabLight", tabLight);
|
||||
map->insert("QmlDesignerTabDark", tabDark);
|
||||
map->insert("QmlDesignerButtonColor", buttonColor);
|
||||
|
Reference in New Issue
Block a user