aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-12-07 18:55:25 -0600
committerluigi1111 <luigi1111w@gmail.com>2018-12-07 18:55:25 -0600
commit9dcb3604d7fef65e566844631005976511a5f196 (patch)
treebb3f9fdea9ebf1a563ed8f0490eb8f208d4c07d8
parent4355dab38c4560b280955ab319aaf45cd129fd4c (diff)
parent4bfd8560cd5408c60a16f8977c75a59620f686a3 (diff)
downloadmonzero-gui-9dcb3604d7fef65e566844631005976511a5f196.tar.gz
monzero-gui-9dcb3604d7fef65e566844631005976511a5f196.tar.xz
monzero-gui-9dcb3604d7fef65e566844631005976511a5f196.zip
Merge pull request #1774
4bfd856 Enable clipboard copy functionality on XMR amounts (mmbyday)
-rw-r--r--LeftPanel.qml71
-rw-r--r--components/HistoryTable.qml18
-rw-r--r--components/Style.qml3
3 files changed, 74 insertions, 18 deletions
diff --git a/LeftPanel.qml b/LeftPanel.qml
index 9d4a52bb..53da5f22 100644
--- a/LeftPanel.qml
+++ b/LeftPanel.qml
@@ -31,7 +31,8 @@ import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import moneroComponents.Wallet 1.0
import moneroComponents.NetworkType 1.0
-import "components"
+import moneroComponents.Clipboard 1.0
+import "components" as MoneroComponents
Rectangle {
id: panel
@@ -46,6 +47,8 @@ Rectangle {
property alias daemonProgressBar : daemonProgressBar
property alias minutesToUnlockTxt: unlockedBalanceLabel.text
property int titleBarHeight: 50
+ property string copyValue: ""
+ Clipboard { id: clipboard }
signal dashboardClicked()
signal historyClicked()
@@ -202,6 +205,23 @@ Rectangle {
}
return defaultSize;
}
+
+ MouseArea {
+ hoverEnabled: true
+ anchors.fill: parent
+ cursorShape: Qt.PointingHandCursor
+ onEntered: {
+ parent.color = MoneroComponents.Style.orange
+ }
+ onExited: {
+ parent.color = MoneroComponents.Style.white
+ }
+ onClicked: {
+ console.log("Copied to clipboard");
+ clipboard.setText(parent.text);
+ appWindow.showStatusMessage(qsTr("Copied to clipboard"),3)
+ }
+ }
}
Text {
@@ -223,9 +243,26 @@ Rectangle {
}
return defaultSize;
}
+
+ MouseArea {
+ hoverEnabled: true
+ anchors.fill: parent
+ cursorShape: Qt.PointingHandCursor
+ onEntered: {
+ parent.color = MoneroComponents.Style.orange
+ }
+ onExited: {
+ parent.color = MoneroComponents.Style.white
+ }
+ onClicked: {
+ console.log("Copied to clipboard");
+ clipboard.setText(parent.text);
+ appWindow.showStatusMessage(qsTr("Copied to clipboard"),3)
+ }
+ }
}
- Label {
+ MoneroComponents.Label {
id: unlockedBalanceLabel
visible: true
text: qsTr("Unlocked balance") + translationManager.emptyString
@@ -236,7 +273,7 @@ Rectangle {
anchors.topMargin: 110
}
- Label {
+ MoneroComponents.Label {
visible: !isMobile
id: balanceLabel
text: qsTr("Balance") + translationManager.emptyString
@@ -334,7 +371,7 @@ Rectangle {
}
// ------------- Transfer tab ---------------
- MenuButton {
+ MoneroComponents.MenuButton {
id: transferButton
anchors.left: parent.left
anchors.right: parent.right
@@ -359,7 +396,7 @@ Rectangle {
// ------------- AddressBook tab ---------------
- MenuButton {
+ MoneroComponents.MenuButton {
id: addressBookButton
anchors.left: parent.left
anchors.right: parent.right
@@ -384,7 +421,7 @@ Rectangle {
}
// ------------- Receive tab ---------------
- MenuButton {
+ MoneroComponents.MenuButton {
id: receiveButton
anchors.left: parent.left
anchors.right: parent.right
@@ -408,7 +445,7 @@ Rectangle {
// ------------- History tab ---------------
- MenuButton {
+ MoneroComponents.MenuButton {
id: historyButton
anchors.left: parent.left
anchors.right: parent.right
@@ -431,7 +468,7 @@ Rectangle {
}
// ------------- Advanced tab ---------------
- MenuButton {
+ MoneroComponents.MenuButton {
id: advancedButton
anchors.left: parent.left
anchors.right: parent.right
@@ -453,7 +490,7 @@ Rectangle {
}
// ------------- Mining tab ---------------
- MenuButton {
+ MoneroComponents.MenuButton {
id: miningButton
visible: !isAndroid && !isIOS
anchors.left: parent.left
@@ -478,7 +515,7 @@ Rectangle {
height: 1
}
// ------------- TxKey tab ---------------
- MenuButton {
+ MoneroComponents.MenuButton {
id: txkeyButton
anchors.left: parent.left
anchors.right: parent.right
@@ -501,7 +538,7 @@ Rectangle {
height: 1
}
// ------------- Shared RingDB tab ---------------
- MenuButton {
+ MoneroComponents.MenuButton {
id: sharedringdbButton
anchors.left: parent.left
anchors.right: parent.right
@@ -526,7 +563,7 @@ Rectangle {
// ------------- Sign/verify tab ---------------
- MenuButton {
+ MoneroComponents.MenuButton {
id: signButton
anchors.left: parent.left
anchors.right: parent.right
@@ -549,7 +586,7 @@ Rectangle {
height: 1
}
// ------------- Settings tab ---------------
- MenuButton {
+ MoneroComponents.MenuButton {
id: settingsButton
anchors.left: parent.left
anchors.right: parent.right
@@ -571,7 +608,7 @@ Rectangle {
height: 1
}
// ------------- Sign/verify tab ---------------
- MenuButton {
+ MoneroComponents.MenuButton {
id: keysButton
anchors.left: parent.left
anchors.right: parent.right
@@ -609,7 +646,7 @@ Rectangle {
color: "transparent"
}
- NetworkStatusItem {
+ MoneroComponents.NetworkStatusItem {
id: networkStatus
anchors.left: parent.left
anchors.right: parent.right
@@ -620,7 +657,7 @@ Rectangle {
height: 48 * scaleRatio
}
- ProgressBar {
+ MoneroComponents.ProgressBar {
id: progressBar
anchors.left: parent.left
anchors.right: parent.right
@@ -630,7 +667,7 @@ Rectangle {
visible: networkStatus.connected
}
- ProgressBar {
+ MoneroComponents.ProgressBar {
id: daemonProgressBar
anchors.left: parent.left
anchors.right: parent.right
diff --git a/components/HistoryTable.qml b/components/HistoryTable.qml
index f4ccd914..d7eb6046 100644
--- a/components/HistoryTable.qml
+++ b/components/HistoryTable.qml
@@ -175,7 +175,23 @@ ListView {
return _amount + " XMR";
}
- color: isOut ? "white" : "#2eb358"
+ color: isOut ? MoneroComponents.Style.white : MoneroComponents.Style.green
+
+ MouseArea {
+ hoverEnabled: true
+ anchors.fill: parent
+ cursorShape: Qt.PointingHandCursor
+ onEntered: {
+ parent.color = MoneroComponents.Style.orange
+ }
+ onExited: {
+ parent.color = isOut ? MoneroComponents.Style.white : MoneroComponents.Style.green }
+ onClicked: {
+ console.log("Copied to clipboard");
+ clipboard.setText(parent.text.split(" ")[0]);
+ appWindow.showStatusMessage(qsTr("Copied to clipboard"),3)
+ }
+ }
}
Rectangle {
diff --git a/components/Style.qml b/components/Style.qml
index f57dcfe4..9c6fded4 100644
--- a/components/Style.qml
+++ b/components/Style.qml
@@ -9,6 +9,9 @@ QtObject {
property QtObject fontRegular: FontLoader { id: _fontRegular; source: "qrc:/fonts/Roboto-Regular.ttf"; }
property string grey: "#404040"
+ property string orange: "#FF6C3C"
+ property string white: "#FFFFFF"
+ property string green: "#2EB358"
property string defaultFontColor: "white"
property string dimmedFontColor: "#BBBBBB"