[notifications] Fix margins of close button timeout indicator

The previous calculation multiplied the DPR by `units.smallSpacing`, which was not correct; we wanted DPR added to the existing margin, not multiplied by it.

Also using Math.floor is safer since Math.round sometimes rounds up (e.g. in case DPR is 2.501) which can cause undesirable effects.

BUG: 425911


(cherry picked from commit 07992bc4ab)
wilder-portage-prov
Nate Graham 5 years ago
parent f25948d755
commit 6d2ef8e256
  1. 4
      applets/notifications/package/contents/ui/NotificationHeader.qml

@ -225,7 +225,7 @@ RowLayout {
Charts.PieChart {
id: chart
anchors.fill: parent
anchors.margins: Math.round(units.devicePixelRatio * units.smallSpacing)
anchors.margins: units.smallSpacing + Math.floor(units.devicePixelRatio)
opacity: (notificationHeading.remainingTime > 0 && notificationHeading.remainingTime < notificationHeading.timeout) ? 1 : 0
Behavior on opacity {
@ -237,7 +237,7 @@ RowLayout {
valueSources: Charts.SingleValueSource { value: notificationHeading.remainingTime }
colorSource: Charts.SingleValueSource { value: theme.highlightColor }
thickness: Math.round(units.devicePixelRatio) * 5
thickness: Math.floor(units.devicePixelRatio) * 5
transform: Scale { origin.x: chart.width / 2; xScale: -1 }
}

Loading…
Cancel
Save