diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-03-30 12:26:02 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-03-30 12:26:02 +0800 |
commit | af65e3444e638557a5a15d9722dc93ef65470760 (patch) | |
tree | 6ab92a1a4157a8d54fcff58caa3b288ff165ad1f /Button | |
parent | d2c379ee8c7b52270897cd3134f163fef3927da6 (diff) |
Change the way purposed buttons override Btn
Diffstat (limited to 'Button')
-rw-r--r-- | Button/Btn.ui.qml | 23 | ||||
-rw-r--r-- | Button/Primary.ui.qml | 25 | ||||
-rw-r--r-- | Button/Success.ui.qml | 25 |
3 files changed, 38 insertions, 35 deletions
diff --git a/Button/Btn.ui.qml b/Button/Btn.ui.qml index cf5c731..1d58fe8 100644 --- a/Button/Btn.ui.qml +++ b/Button/Btn.ui.qml @@ -3,6 +3,15 @@ import QtQuick.Controls 2.15 import Eduport 1.4 Button { + property color bsBtnColor: Eduport.bsBtnColor + property color bsBtnBg: Eduport.bsBtnBg + property color bsBtnBorderColor: Eduport.bsBtnBorderColor + property color bsBtnActiveColor: Eduport.bsBtnColor + property color bsBtnActiveBg: Eduport.bsBtnBg + property color bsBtnActiveBorderColor: Eduport.bsBtnBorderColor + property color bsBtnDisabledColor: Eduport.bsBtnColor + property color bsBtnDisabledBg: Eduport.bsBtnBg + property color bsBtnDisabledBorderColor: Eduport.bsBtnBorderColor id: button horizontalPadding: Eduport.bsBtnPaddingX verticalPadding: Eduport.bsBtnPaddingY @@ -10,15 +19,23 @@ Button { contentItem: Text { text: button.text font: button.font - color: Eduport.bsBtnPrimaryColor + color: button.down + ? bsBtnActiveColor + : button.enabled + ? bsBtnColor + : bsBtnDisabledColor horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } background: Rectangle { - color: Eduport.bsBtnBg + color: button.down + ? bsBtnActiveBg + : button.enabled + ? bsBtnBg + : bsBtnDisabledBg border { width: Eduport.bsBtnBorderWidth - color: Eduport.bsBtnBorderColor + color: bsBtnBorderColor } radius: Eduport.bsBtnBorderRadius } diff --git a/Button/Primary.ui.qml b/Button/Primary.ui.qml index 810c2f8..1e1aae6 100644 --- a/Button/Primary.ui.qml +++ b/Button/Primary.ui.qml @@ -3,20 +3,13 @@ import QtQuick.Controls 2.15 import Eduport 1.4 Btn { - id: button - background: Rectangle { - color: button.down ? Eduport.bsBtnPrimaryActiveBg - : button.enabled - ? Eduport.bsBtnPrimaryBg - : Eduport.bsBtnPrimaryDisabledBg - border { - width: Eduport.bsBtnBorderWidth - color: button.down - ? Eduport.bsBtnPrimaryActiveBorderColor - : button.enabled - ? Eduport.bsBtnPrimaryBorderColor - : Eduport.bsBtnPrimaryDisabledBorderColor - } - radius: Eduport.bsBtnBorderRadius - } + bsBtnColor: Eduport.bsBtnPrimaryColor + bsBtnBg: Eduport.bsBtnPrimaryBg + bsBtnBorderColor: Eduport.bsBtnPrimaryBorderColor + bsBtnActiveColor: Eduport.bsBtnPrimaryActiveColor + bsBtnActiveBg: Eduport.bsBtnPrimaryActiveBg + bsBtnActiveBorderColor: Eduport.bsBtnPrimaryActiveBorderColor + bsBtnDisabledColor: Eduport.bsBtnPrimaryDisabledColor + bsBtnDisabledBg: Eduport.bsBtnPrimaryDisabledBg + bsBtnDisabledBorderColor: Eduport.bsBtnPrimaryDisabledBorderColor } diff --git a/Button/Success.ui.qml b/Button/Success.ui.qml index 2da78cd..9a1286d 100644 --- a/Button/Success.ui.qml +++ b/Button/Success.ui.qml @@ -3,20 +3,13 @@ import QtQuick.Controls 2.15 import Eduport 1.4 Btn { - id: button - background: Rectangle { - color: button.down ? Eduport.bsBtnSuccessActiveBg - : button.enabled - ? Eduport.bsBtnSuccessBg - : Eduport.bsBtnSuccessDisabledBg - border { - width: Eduport.bsBtnBorderWidth - color: button.down - ? Eduport.bsBtnSuccessActiveBorderColor - : button.enabled - ? Eduport.bsBtnSuccessBorderColor - : Eduport.bsBtnSuccessDisabledBorderColor - } - radius: Eduport.bsBtnBorderRadius - } + bsBtnColor: Eduport.bsBtnSuccessColor + bsBtnBg: Eduport.bsBtnSuccessBg + bsBtnBorderColor: Eduport.bsBtnSuccessBorderColor + bsBtnActiveColor: Eduport.bsBtnSuccessActiveColor + bsBtnActiveBg: Eduport.bsBtnSuccessActiveBg + bsBtnActiveBorderColor: Eduport.bsBtnSuccessActiveBorderColor + bsBtnDisabledColor: Eduport.bsBtnSuccessDisabledColor + bsBtnDisabledBg: Eduport.bsBtnSuccessDisabledBg + bsBtnDisabledBorderColor: Eduport.bsBtnSuccessDisabledBorderColor } |