Android: Fix broken system palette
When we overwrite the default palette, we have to make sure we don't overwrite default values with black for all the colors that are not retrieved from the json file. We would for instance get black as both the base color and text color which would make some components unusable. Change-Id: I1079a70a0ac7eb379ed5e8d92c6b39c2ea77ba49 Task-number: QTBUG-42812 Task-number: QTBUG-42998 Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
This commit is contained in:
parent
457496b830
commit
ab6d645850
@ -278,7 +278,8 @@ static std::shared_ptr<AndroidStyle> loadAndroidStyle(QPalette *defaultPalette)
|
|||||||
const int pt = paletteType(key);
|
const int pt = paletteType(key);
|
||||||
if (pt > -1 || !qtClassName.isEmpty()) {
|
if (pt > -1 || !qtClassName.isEmpty()) {
|
||||||
// Extract palette information
|
// Extract palette information
|
||||||
QPalette palette;
|
QPalette palette = *defaultPalette;
|
||||||
|
|
||||||
attributeIterator = item.find(QLatin1String("defaultTextColorPrimary"));
|
attributeIterator = item.find(QLatin1String("defaultTextColorPrimary"));
|
||||||
if (attributeIterator != item.constEnd())
|
if (attributeIterator != item.constEnd())
|
||||||
palette.setColor(QPalette::WindowText, QRgb(int(attributeIterator.value().toDouble())));
|
palette.setColor(QPalette::WindowText, QRgb(int(attributeIterator.value().toDouble())));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user