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
|
PaletteBaseDisabled=backgroundColorDisabled
|
||||||
PaletteTextDisabled=textDisabled
|
PaletteTextDisabled=textDisabled
|
||||||
|
|
||||||
|
QmlDesigner_BackgroundColor=ff3c3e40
|
||||||
QmlDesigner_HighlightColor=ff46a2da
|
QmlDesigner_HighlightColor=ff46a2da
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
|
@@ -171,6 +171,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=ffffa500
|
|||||||
ClangCodeModel_Error_TextMarkColor=ffff882f
|
ClangCodeModel_Error_TextMarkColor=ffff882f
|
||||||
ClangCodeModel_Warning_TextMarkColor=ffc6c132
|
ClangCodeModel_Warning_TextMarkColor=ffc6c132
|
||||||
|
|
||||||
|
QmlDesigner_BackgroundColor=ff4c4e50
|
||||||
QmlDesigner_HighlightColor=ff46a2da
|
QmlDesigner_HighlightColor=ff46a2da
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
|
@@ -185,6 +185,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=ffffff40
|
|||||||
ClangCodeModel_Error_TextMarkColor=ffff882f
|
ClangCodeModel_Error_TextMarkColor=ffff882f
|
||||||
ClangCodeModel_Warning_TextMarkColor=ffceff40
|
ClangCodeModel_Warning_TextMarkColor=ffceff40
|
||||||
|
|
||||||
|
QmlDesigner_BackgroundColor=ff4c4e50
|
||||||
QmlDesigner_HighlightColor=ff3f91c4
|
QmlDesigner_HighlightColor=ff3f91c4
|
||||||
|
|
||||||
PaletteWindow=normalBackground
|
PaletteWindow=normalBackground
|
||||||
|
@@ -182,6 +182,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=ffffa500
|
|||||||
ClangCodeModel_Error_TextMarkColor=ffff882f
|
ClangCodeModel_Error_TextMarkColor=ffff882f
|
||||||
ClangCodeModel_Warning_TextMarkColor=ffc6c132
|
ClangCodeModel_Warning_TextMarkColor=ffc6c132
|
||||||
|
|
||||||
|
QmlDesigner_BackgroundColor=fff8f8f8
|
||||||
QmlDesigner_HighlightColor=ff46a2da
|
QmlDesigner_HighlightColor=ff46a2da
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
|
@@ -181,6 +181,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=ffffa500
|
|||||||
ClangCodeModel_Error_TextMarkColor=ffff882f
|
ClangCodeModel_Error_TextMarkColor=ffff882f
|
||||||
ClangCodeModel_Warning_TextMarkColor=ffc6c132
|
ClangCodeModel_Warning_TextMarkColor=ffc6c132
|
||||||
|
|
||||||
|
QmlDesigner_BackgroundColor=ff4c4e50
|
||||||
QmlDesigner_HighlightColor=ff46a2da
|
QmlDesigner_HighlightColor=ff46a2da
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
|
@@ -282,6 +282,7 @@ public:
|
|||||||
ClangCodeModel_Warning_TextMarkColor,
|
ClangCodeModel_Warning_TextMarkColor,
|
||||||
|
|
||||||
/* QmlDesigner */
|
/* QmlDesigner */
|
||||||
|
QmlDesigner_BackgroundColor,
|
||||||
QmlDesigner_HighlightColor
|
QmlDesigner_HighlightColor
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -33,13 +33,6 @@
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
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)
|
void Theming::insertTheme(QQmlPropertyMap *map)
|
||||||
{
|
{
|
||||||
const QVariantHash creatorTheme = Utils::creatorTheme()->values();
|
const QVariantHash creatorTheme = Utils::creatorTheme()->values();
|
||||||
@@ -47,6 +40,7 @@ void Theming::insertTheme(QQmlPropertyMap *map)
|
|||||||
map->insert(it.key(), it.value());
|
map->insert(it.key(), it.value());
|
||||||
|
|
||||||
/* Define QmlDesigner colors and remove alpha channels */
|
/* 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 panelStatusBarBackgroundColor = Utils::creatorTheme()->color(Utils::Theme::PanelStatusBarBackgroundColor);
|
||||||
const QColor fancyToolButtonSelectedColor = Utils::creatorTheme()->color(Utils::Theme::FancyToolButtonSelectedColor);
|
const QColor fancyToolButtonSelectedColor = Utils::creatorTheme()->color(Utils::Theme::FancyToolButtonSelectedColor);
|
||||||
const QColor darkerBackground = Utils::StyleHelper::alphaBlendedColors(panelStatusBarBackgroundColor, fancyToolButtonSelectedColor);
|
const QColor darkerBackground = Utils::StyleHelper::alphaBlendedColors(panelStatusBarBackgroundColor, fancyToolButtonSelectedColor);
|
||||||
@@ -65,7 +59,7 @@ void Theming::insertTheme(QQmlPropertyMap *map)
|
|||||||
}
|
}
|
||||||
|
|
||||||
map->insert("QmlDesignerBackgroundColorDarker", darkerBackground);
|
map->insert("QmlDesignerBackgroundColorDarker", darkerBackground);
|
||||||
map->insert("QmlDesignerBackgroundColorDarkAlternate", midtone(panelStatusBarBackgroundColor, buttonColor));
|
map->insert("QmlDesignerBackgroundColorDarkAlternate", backgroundColor);
|
||||||
map->insert("QmlDesignerTabLight", tabLight);
|
map->insert("QmlDesignerTabLight", tabLight);
|
||||||
map->insert("QmlDesignerTabDark", tabDark);
|
map->insert("QmlDesignerTabDark", tabDark);
|
||||||
map->insert("QmlDesignerButtonColor", buttonColor);
|
map->insert("QmlDesignerButtonColor", buttonColor);
|
||||||
|
Reference in New Issue
Block a user