forked from qt-creator/qt-creator
Utils: Fix placeholder text color for dark themes (Qt6)
Qt 6 changed the color for QPalette::PlaceholderText to a hardcoded argb value in qt_fusionPalette(), which does not work well with dark themes. This change restores the rgb values for QPalette::PlaceholderText from Qt 5 for Qt Creator's dark themes. Task-number: QTCREATORBUG-25444 Change-Id: I197d367ac6e35085a093abfee07467291010e3ba Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -352,6 +352,7 @@ PaletteWindowTextDisabled=textDisabled
|
|||||||
PaletteBaseDisabled=backgroundColorDisabled
|
PaletteBaseDisabled=backgroundColorDisabled
|
||||||
PaletteTextDisabled=textDisabled
|
PaletteTextDisabled=textDisabled
|
||||||
PaletteMid=ffa0a0a0
|
PaletteMid=ffa0a0a0
|
||||||
|
PalettePlaceholderText=ff8d8d8d
|
||||||
|
|
||||||
QmlDesigner_BackgroundColor=qmlDesignerButtonColor
|
QmlDesigner_BackgroundColor=qmlDesignerButtonColor
|
||||||
QmlDesigner_HighlightColor=ff46a2da
|
QmlDesigner_HighlightColor=ff46a2da
|
||||||
|
@@ -478,6 +478,7 @@ PaletteWindowTextDisabled=textDisabled
|
|||||||
PaletteBaseDisabled=backgroundColorDisabled
|
PaletteBaseDisabled=backgroundColorDisabled
|
||||||
PaletteTextDisabled=textDisabled
|
PaletteTextDisabled=textDisabled
|
||||||
PaletteMid=ffafafaf
|
PaletteMid=ffafafaf
|
||||||
|
PalettePlaceholderText=ff808081
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
ComboBoxDrawTextShadow=false
|
ComboBoxDrawTextShadow=false
|
||||||
|
@@ -370,6 +370,7 @@ PaletteWindowTextDisabled=textDisabled
|
|||||||
PaletteBaseDisabled=backgroundColorDisabled
|
PaletteBaseDisabled=backgroundColorDisabled
|
||||||
PaletteTextDisabled=textDisabled
|
PaletteTextDisabled=textDisabled
|
||||||
PaletteMid=ffa0a0a0
|
PaletteMid=ffa0a0a0
|
||||||
|
PalettePlaceholderText=ff7f7f80
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
ComboBoxDrawTextShadow=false
|
ComboBoxDrawTextShadow=false
|
||||||
|
@@ -193,7 +193,7 @@ void Theme::readSettings(QSettings &settings)
|
|||||||
for (int i = 0, total = e.keyCount(); i < total; ++i) {
|
for (int i = 0, total = e.keyCount(); i < total; ++i) {
|
||||||
const QString key = QLatin1String(e.key(i));
|
const QString key = QLatin1String(e.key(i));
|
||||||
if (!settings.contains(key)) {
|
if (!settings.contains(key)) {
|
||||||
if (i < PaletteWindow || i > PaletteShadowDisabled)
|
if (i < PaletteWindow || i > PalettePlaceholderTextDisabled)
|
||||||
qWarning("Theme \"%s\" misses color setting for key \"%s\".",
|
qWarning("Theme \"%s\" misses color setting for key \"%s\".",
|
||||||
qPrintable(d->fileName), qPrintable(key));
|
qPrintable(d->fileName), qPrintable(key));
|
||||||
continue;
|
continue;
|
||||||
@@ -325,7 +325,9 @@ QPalette Theme::palette() const
|
|||||||
{PaletteMid, QPalette::Mid, QPalette::All, false},
|
{PaletteMid, QPalette::Mid, QPalette::All, false},
|
||||||
{PaletteMidDisabled, QPalette::Mid, QPalette::Disabled, false},
|
{PaletteMidDisabled, QPalette::Mid, QPalette::Disabled, false},
|
||||||
{PaletteShadow, QPalette::Shadow, QPalette::All, false},
|
{PaletteShadow, QPalette::Shadow, QPalette::All, false},
|
||||||
{PaletteShadowDisabled, QPalette::Shadow, QPalette::Disabled, false}
|
{PaletteShadowDisabled, QPalette::Shadow, QPalette::Disabled, false},
|
||||||
|
{PalettePlaceholderText, QPalette::PlaceholderText, QPalette::All, false},
|
||||||
|
{PalettePlaceholderTextDisabled, QPalette::PlaceholderText, QPalette::Disabled, false},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto entry: mapping) {
|
for (auto entry: mapping) {
|
||||||
|
@@ -163,6 +163,9 @@ public:
|
|||||||
PaletteMidDisabled,
|
PaletteMidDisabled,
|
||||||
PaletteShadowDisabled,
|
PaletteShadowDisabled,
|
||||||
|
|
||||||
|
PalettePlaceholderText,
|
||||||
|
PalettePlaceholderTextDisabled,
|
||||||
|
|
||||||
/* Icons */
|
/* Icons */
|
||||||
|
|
||||||
IconsBaseColor,
|
IconsBaseColor,
|
||||||
|
Reference in New Issue
Block a user