Fix Label having non-integer sizes

When using a non-integer baseLine, the height can be non-integer, resulting
in non-exact pixel alignments which generate artifacts on the screen.

This happened in Kickoff's LeaveView in Plasma 5.18 (currently used in
openSUSE Leap 15.3) where the focus outline was painted with a different
width in the top and bottom borders due to this pixel misalignment.
This commit is contained in:
Antonio Larrosa Jimenez 2021-05-06 15:30:39 +00:00 committed by Nate Graham
parent e9ef688387
commit a4e4156a47

View File

@ -12,6 +12,9 @@ import org.kde.plasma.core 2.0 as PlasmaCore
T.Label {
id: control
height: Math.ceil(implicitHeight)
width: Math.ceil(implicitWidth)
verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter
activeFocusOnTab: false