aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorselsta <selsta@sent.at>2020-06-13 03:34:16 +0200
committerselsta <selsta@sent.at>2020-06-13 03:34:16 +0200
commitd18af7da7295cc4fd8564a529db89deb20c96b82 (patch)
tree82682ab1875dfc8eb4179bc24d25de1cfda8f546
parentc8f4355e15e6574c7139bfb5f6ea195ad4199644 (diff)
downloadmonzero-gui-d18af7da7295cc4fd8564a529db89deb20c96b82.tar.gz
monzero-gui-d18af7da7295cc4fd8564a529db89deb20c96b82.tar.xz
monzero-gui-d18af7da7295cc4fd8564a529db89deb20c96b82.zip
LeftPanel: simpifly color binding
-rw-r--r--LeftPanel.qml17
1 files changed, 6 insertions, 11 deletions
diff --git a/LeftPanel.qml b/LeftPanel.qml
index 21f1e0a2..6f33651d 100644
--- a/LeftPanel.qml
+++ b/LeftPanel.qml
@@ -263,6 +263,10 @@ Rectangle {
anchors.leftMargin: 58
anchors.baseline: currencyLabel.baseline
color: MoneroComponents.Style.blackTheme ? "white" : "black"
+ Binding on color {
+ when: balancePart1MouseArea.containsMouse || balancePart2MouseArea.containsMouse
+ value: MoneroComponents.Style.orange
+ }
text: {
if (persistentSettings.fiatPriceEnabled && persistentSettings.fiatPriceToggle) {
return balanceFiatString.split('.')[0] + "."
@@ -284,14 +288,6 @@ Rectangle {
hoverEnabled: true
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
- onEntered: {
- balancePart1.color = MoneroComponents.Style.orange
- balancePart2.color = MoneroComponents.Style.orange
- }
- onExited: {
- balancePart1.color = Qt.binding(function() { return MoneroComponents.Style.blackTheme ? "white" : "black" })
- balancePart2.color = Qt.binding(function() { return MoneroComponents.Style.blackTheme ? "white" : "black" })
- }
onClicked: {
console.log("Copied to clipboard");
clipboard.setText(balancePart1.text + balancePart2.text);
@@ -305,7 +301,7 @@ Rectangle {
anchors.left: balancePart1.right
anchors.leftMargin: 2
anchors.baseline: currencyLabel.baseline
- color: MoneroComponents.Style.blackTheme ? "white" : "black"
+ color: balancePart1.color
text: {
if (persistentSettings.fiatPriceEnabled && persistentSettings.fiatPriceToggle) {
return balanceFiatString.split('.')[1]
@@ -315,11 +311,10 @@ Rectangle {
}
font.pixelSize: 16
MouseArea {
+ id: balancePart2MouseArea
hoverEnabled: true
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
- onEntered: balancePart1MouseArea.entered()
- onExited: balancePart1MouseArea.exited()
onClicked: balancePart1MouseArea.clicked(mouse)
}
}