From dee9f43761f93d53234067a603febfd5323f80fb 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/src/StatusQ/Controls/StatusBaseButton.qml b/src/StatusQ/Controls/StatusBaseButton.qml index 9a0ffeb9..f7d9282a 100644 --- a/src/StatusQ/Controls/StatusBaseButton.qml +++ b/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) {