From 09e0d8a8b96288d860ee233c17b261d617e11b7b Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 2 Nov 2021 11:23:47 +0100 Subject: [PATCH] feat(StatusBaseButton): introduce `Tiny` size --- .../src/StatusQ/Controls/StatusBaseButton.qml | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Controls/StatusBaseButton.qml b/ui/StatusQ/src/StatusQ/Controls/StatusBaseButton.qml index 9a0ffeb940..f7d9282aa9 100644 --- a/ui/StatusQ/src/StatusQ/Controls/StatusBaseButton.qml +++ b/ui/StatusQ/src/StatusQ/Controls/StatusBaseButton.qml @@ -7,6 +7,7 @@ Rectangle { id: statusBaseButton enum Size { + Tiny, Small, Large } @@ -33,8 +34,32 @@ Rectangle { property real defaultLeftPadding: size === StatusBaseButton.Size.Large ? 24 : 12 property real defaultRightPadding: size === StatusBaseButton.Size.Large ? 24 : 12 - property real defaultTopPadding: size === StatusBaseButton.Size.Large ? 11 : 10 - property real defaultBottomPadding: size === StatusBaseButton.Size.Large ? 11 : 10 + property real defaultTopPadding: { + switch (size) { + case StatusBaseButton.Size.Tiny: + return 5 + case StatusBaseButton.Size.Small: + return 10 + break; + case StatusBaseButton.Size.Large: + default: + return 11 + break; + } + } + property real defaultBottomPadding: { + switch (size) { + case StatusBaseButton.Size.Tiny: + return 5 + case StatusBaseButton.Size.Small: + return 10 + break; + case StatusBaseButton.Size.Large: + default: + return 11 + break; + } + } property real leftPadding: defaultLeftPadding @@ -62,7 +87,7 @@ Rectangle { implicitWidth: sensor.width implicitHeight: sensor.height - radius: 8 + radius: size !== StatusBaseButton.Size.Tiny ? 8 : 6 color: { if (statusBaseButton.enabled) {