diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-03-23 12:14:59 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-03-23 12:14:59 +0800 |
commit | b3d2b1fc6251d2a75a45ef88477cbf6ed5aa9eb7 (patch) | |
tree | 3fdccbbc6064e4116e4520297345cc970eba2ade /Button | |
parent | 9928dd9ccaab6b447af80539cad97b1b13576287 (diff) |
Implementation of .btn & primary reuses it
Diffstat (limited to 'Button')
-rw-r--r-- | Button/Btn.ui.qml | 25 | ||||
-rw-r--r-- | Button/Primary.ui.qml | 30 |
2 files changed, 37 insertions, 18 deletions
diff --git a/Button/Btn.ui.qml b/Button/Btn.ui.qml new file mode 100644 index 0000000..cdf730b --- /dev/null +++ b/Button/Btn.ui.qml @@ -0,0 +1,25 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import Bootstrap 5.3 + +Button { + id: button + horizontalPadding: Bootstrap.btnPaddingX + verticalPadding: Bootstrap.btnPaddingY + font: Bootstrap.btnFont + contentItem: Text { + text: button.text + font: button.font + color: Bootstrap.btnColor + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + background: Rectangle { + color: Bootstrap.btnBg + border { + width: Bootstrap.btnBorderWidth + color: Bootstrap.btnBorderColor + } + radius: Bootstrap.btnBorderRadius + } +} diff --git a/Button/Primary.ui.qml b/Button/Primary.ui.qml index 831430a..dec0148 100644 --- a/Button/Primary.ui.qml +++ b/Button/Primary.ui.qml @@ -2,27 +2,21 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import Bootstrap 5.3 -Button { +Btn { id: button - horizontalPadding: 16 - verticalPadding: 8 - font: Bootstrap.btnFont - contentItem: Text { - text: button.text - font: button.font - color: Bootstrap.btnColor - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } background: Rectangle { - color: button.down ? Bootstrap.btnActiveBG : button.enabled - ? Bootstrap.btnBg : Bootstrap.btnDisabledBg + color: button.down ? Bootstrap.btnPrimaryActiveBG + : button.enabled + ? Bootstrap.btnPrimaryBg + : Bootstrap.btnPrimaryDisabledBg border { - color: button.down ? Bootstrap.btnActiveBorderColor - : button.enabled ? Bootstrap.btnBorderColor - : Bootstrap.btnDisabledBorderColor - width: 1 + color: button.down + ? Bootstrap.btnPrimaryActiveBorderColor + : button.enabled + ? Bootstrap.btnPrimaryBorderColor + : Bootstrap.btnPrimaryDisabledBorderColor + width: Bootstrap.btnBorderWidth } - radius: 5.2 + radius: Bootstrap.btnBorderRadius } } |