From 0b37d0fdb46538f7ac48198d8d63d56c2ed8deba Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Thu, 29 Apr 2021 22:41:35 -0600 Subject: [PATCH] [applets/digital-clock] Fix "both pointSize and pixelSize defined" warning This warning happens because the Digital Clock is using PC2 labels, which set the pointSize internally. However in this usage of them, we don't use the pointSize and instead set the pixelSize to make the label always match the height of a size helper item. This results in both pointSize and pixelSize being defined. This is an ambiguous situation, so Qt helpfully ignores pointSize in favor of pixelSize and prints a warning for us. Because what we're doing here is intentional, let's explicitly unset pointSize ourselves so we don't make Qt do it for us. This removes the noisy warning message that is printed at every plasmashell startup. Ultimately we need to port these labels to PC3, but that is quite challenging due to the complicated text sizing logic. --- applets/digital-clock/package/contents/ui/DigitalClock.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/applets/digital-clock/package/contents/ui/DigitalClock.qml b/applets/digital-clock/package/contents/ui/DigitalClock.qml index 153ac6373..7217d49bf 100644 --- a/applets/digital-clock/package/contents/ui/DigitalClock.qml +++ b/applets/digital-clock/package/contents/ui/DigitalClock.qml @@ -491,6 +491,8 @@ Item { weight: plasmoid.configuration.boldText ? Font.Bold : PlasmaCore.Theme.defaultFont.weight italic: plasmoid.configuration.italicText pixelSize: 1024 + pointSize: undefined // Because we're setting the pixel size instead + // TODO: remove once this label is ported to PC3 } minimumPixelSize: 1 @@ -516,6 +518,8 @@ Item { font.weight: timeLabel.font.weight font.italic: timeLabel.font.italic font.pixelSize: 1024 + font.pointSize: undefined // Because we're setting the pixel size instead + // TODO: remove once this label is ported to PC3 minimumPixelSize: 1 visible: text.length > 0 @@ -533,6 +537,8 @@ Item { font.weight: timeLabel.font.weight font.italic: timeLabel.font.italic font.pixelSize: 1024 + font.pointSize: undefined // Because we're setting the pixel size instead + // TODO: remove once this label is ported to PC3 minimumPixelSize: 1 horizontalAlignment: Text.AlignHCenter