Commit 2b1009b7 authored by Nate Graham's avatar Nate Graham
Browse files

[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.


(cherry picked from commit 0b37d0fd)
parent 362baa00
......@@ -498,6 +498,8 @@ Item {
weight: plasmoid.configuration.boldText ? Font.Bold : 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
......@@ -523,6 +525,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
......@@ -540,6 +544,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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment