From bd1ba6e539a326585a24fc21d0e27ef2c59e8731 Mon Sep 17 00:00:00 2001 From: Noah Davis Date: Wed, 6 Apr 2022 15:08:53 -0400 Subject: [PATCH] PC3 toggle controls: fix odd heights misaligning indicators BUG: 447977 --- src/declarativeimports/plasmacomponents3/CheckBox.qml | 2 +- src/declarativeimports/plasmacomponents3/CheckDelegate.qml | 2 +- src/declarativeimports/plasmacomponents3/MenuItem.qml | 2 +- src/declarativeimports/plasmacomponents3/RadioButton.qml | 2 +- src/declarativeimports/plasmacomponents3/RadioDelegate.qml | 2 +- src/declarativeimports/plasmacomponents3/Switch.qml | 2 +- src/declarativeimports/plasmacomponents3/SwitchDelegate.qml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/declarativeimports/plasmacomponents3/CheckBox.qml b/src/declarativeimports/plasmacomponents3/CheckBox.qml index 1da39da24..fed972566 100644 --- a/src/declarativeimports/plasmacomponents3/CheckBox.qml +++ b/src/declarativeimports/plasmacomponents3/CheckBox.qml @@ -35,7 +35,7 @@ T.CheckBox { indicator: CheckIndicator { x: !control.mirrored ? control.leftPadding : control.width - width - control.rightPadding - y: control.topPadding + (control.availableHeight - height) / 2 + y: control.topPadding + Math.round((control.availableHeight - height) / 2) control: control } diff --git a/src/declarativeimports/plasmacomponents3/CheckDelegate.qml b/src/declarativeimports/plasmacomponents3/CheckDelegate.qml index ef965becd..9d241467b 100644 --- a/src/declarativeimports/plasmacomponents3/CheckDelegate.qml +++ b/src/declarativeimports/plasmacomponents3/CheckDelegate.qml @@ -47,7 +47,7 @@ T.CheckDelegate { indicator: CheckIndicator { x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding - y: control.topPadding + (control.availableHeight - height) / 2 + y: control.topPadding + Math.round((control.availableHeight - height) / 2) control: control } diff --git a/src/declarativeimports/plasmacomponents3/MenuItem.qml b/src/declarativeimports/plasmacomponents3/MenuItem.qml index 16f2a5e36..964c5930d 100644 --- a/src/declarativeimports/plasmacomponents3/MenuItem.qml +++ b/src/declarativeimports/plasmacomponents3/MenuItem.qml @@ -81,7 +81,7 @@ T.MenuItem { indicator: Loader { x: controlRoot.mirrored ? controlRoot.width - width - controlRoot.rightPadding : controlRoot.leftPadding - y: controlRoot.topPadding + (controlRoot.availableHeight - height) / 2 + y: controlRoot.topPadding + Math.round((controlRoot.availableHeight - height) / 2) visible: controlRoot.checkable sourceComponent: controlRoot.autoExclusive ? radioComponent : checkComponent diff --git a/src/declarativeimports/plasmacomponents3/RadioButton.qml b/src/declarativeimports/plasmacomponents3/RadioButton.qml index 7eeee3f9b..0b7a19894 100644 --- a/src/declarativeimports/plasmacomponents3/RadioButton.qml +++ b/src/declarativeimports/plasmacomponents3/RadioButton.qml @@ -32,7 +32,7 @@ T.RadioButton { indicator: RadioIndicator { x: !control.mirrored ? control.leftPadding : control.width - width - control.rightPadding - y: control.topPadding + (control.availableHeight - height) / 2 + y: control.topPadding + Math.round((control.availableHeight - height) / 2) control: control } diff --git a/src/declarativeimports/plasmacomponents3/RadioDelegate.qml b/src/declarativeimports/plasmacomponents3/RadioDelegate.qml index e25f28cc3..a915a4eac 100644 --- a/src/declarativeimports/plasmacomponents3/RadioDelegate.qml +++ b/src/declarativeimports/plasmacomponents3/RadioDelegate.qml @@ -47,7 +47,7 @@ T.RadioDelegate { indicator: RadioIndicator { x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding - y: control.topPadding + (control.availableHeight - height) / 2 + y: control.topPadding + Math.round((control.availableHeight - height) / 2) control: control } diff --git a/src/declarativeimports/plasmacomponents3/Switch.qml b/src/declarativeimports/plasmacomponents3/Switch.qml index 32ef1274b..98de41388 100644 --- a/src/declarativeimports/plasmacomponents3/Switch.qml +++ b/src/declarativeimports/plasmacomponents3/Switch.qml @@ -32,7 +32,7 @@ T.Switch { indicator: SwitchIndicator { x: !control.mirrored ? control.leftPadding : control.width - width - control.rightPadding - y: control.topPadding + (control.availableHeight - height) / 2 + y: control.topPadding + Math.round((control.availableHeight - height) / 2) control: control } diff --git a/src/declarativeimports/plasmacomponents3/SwitchDelegate.qml b/src/declarativeimports/plasmacomponents3/SwitchDelegate.qml index e6adf9a6e..0f3db70de 100644 --- a/src/declarativeimports/plasmacomponents3/SwitchDelegate.qml +++ b/src/declarativeimports/plasmacomponents3/SwitchDelegate.qml @@ -45,7 +45,7 @@ T.SwitchDelegate { indicator: SwitchIndicator { x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding - y: control.topPadding + (control.availableHeight - height) / 2 + y: control.topPadding + Math.round((control.availableHeight - height) / 2) control: control } -- GitLab