diff options
| author | rating89us <45968869+rating89us@users.noreply.github.com> | 2021-07-22 20:47:12 +0200 |
|---|---|---|
| committer | rating89us <45968869+rating89us@users.noreply.github.com> | 2021-11-21 19:28:36 +0100 |
| commit | cc8ddde01be4460e6ae6364c9ac1118edabe03eb (patch) | |
| tree | 6cd7b64a33af3e5c3320dec613ea95fe470b9904 /components/StandardButton.qml | |
| parent | ecf5c501d61bf5f85fb69fd9136cd0235f97f7b8 (diff) | |
| download | monzero-gui-cc8ddde01be4460e6ae6364c9ac1118edabe03eb.tar.gz monzero-gui-cc8ddde01be4460e6ae6364c9ac1118edabe03eb.tar.xz monzero-gui-cc8ddde01be4460e6ae6364c9ac1118edabe03eb.zip | |
Transfer: fix button colors, font size, bold; use secondary button for advanced options
Diffstat (limited to 'components/StandardButton.qml')
| -rw-r--r-- | components/StandardButton.qml | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/components/StandardButton.qml b/components/StandardButton.qml index b52b3a00..00fe0c89 100644 --- a/components/StandardButton.qml +++ b/components/StandardButton.qml @@ -39,16 +39,12 @@ Item { property bool primary: true property string rightIcon: "" property string rightIconInactive: "" - property color textColor: !button.enabled - ? MoneroComponents.Style.buttonTextColorDisabled - : primary - ? MoneroComponents.Style.buttonTextColor - : MoneroComponents.Style.buttonSecondaryTextColor; + property color textColor: primary ? MoneroComponents.Style.buttonTextColor : MoneroComponents.Style.buttonSecondaryTextColor; property bool small: false property alias text: label.text property alias fontBold: label.font.bold property int fontSize: { - if(small) return 14; + if(small) return 13.5; else return 16; } property alias label: label @@ -72,6 +68,7 @@ Item { anchors.fill: parent radius: 3 border.width: parent.focus && parent.enabled ? 1 : 0 + opacity: 1 state: button.enabled ? "active" : "disabled" Component.onCompleted: state = state @@ -102,7 +99,14 @@ Item { when: !button.enabled PropertyChanges { target: buttonRect - color: MoneroComponents.Style.buttonBackgroundColorDisabled + opacity: 0.5 + color: primary + ? MoneroComponents.Style.buttonBackgroundColor + : MoneroComponents.Style.buttonSecondaryBackgroundColor + } + PropertyChanges { + target: label + opacity: 0.5 } } ] @@ -122,7 +126,7 @@ Item { MoneroComponents.TextPlain { id: label font.family: MoneroComponents.Style.fontBold.name - font.bold: true + font.bold: button.primary ? true : false font.pixelSize: button.fontSize color: !buttonArea.pressed ? button.textColor : "transparent" visible: text !== "" @@ -145,6 +149,7 @@ Item { Layout.alignment: Qt.AlignVCenter | Qt.AlignRight width: button.small ? 16 : 20 height: button.small ? 16 : 20 + opacity: buttonRect.opacity source: { if (fontAwesomeIcon) return ""; if(button.rightIconInactive !== "" && !button.enabled) { |
