Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable clipboard copy functionality on XMR amounts #1774

Merged
merged 1 commit into from
Dec 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 54 additions & 17 deletions LeftPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -236,7 +273,7 @@ Rectangle {
anchors.topMargin: 110
}

Label {
MoneroComponents.Label {
visible: !isMobile
id: balanceLabel
text: qsTr("Balance") + translationManager.emptyString
Expand Down Expand Up @@ -334,7 +371,7 @@ Rectangle {
}

// ------------- Transfer tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: transferButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -359,7 +396,7 @@ Rectangle {

// ------------- AddressBook tab ---------------

MenuButton {
MoneroComponents.MenuButton {
id: addressBookButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -384,7 +421,7 @@ Rectangle {
}

// ------------- Receive tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: receiveButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -408,7 +445,7 @@ Rectangle {

// ------------- History tab ---------------

MenuButton {
MoneroComponents.MenuButton {
id: historyButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -431,7 +468,7 @@ Rectangle {
}

// ------------- Advanced tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: advancedButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -453,7 +490,7 @@ Rectangle {
}

// ------------- Mining tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: miningButton
visible: !isAndroid && !isIOS
anchors.left: parent.left
Expand All @@ -478,7 +515,7 @@ Rectangle {
height: 1
}
// ------------- TxKey tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: txkeyButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -501,7 +538,7 @@ Rectangle {
height: 1
}
// ------------- Shared RingDB tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: sharedringdbButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -526,7 +563,7 @@ Rectangle {


// ------------- Sign/verify tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: signButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -549,7 +586,7 @@ Rectangle {
height: 1
}
// ------------- Settings tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: settingsButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -571,7 +608,7 @@ Rectangle {
height: 1
}
// ------------- Sign/verify tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: keysButton
anchors.left: parent.left
anchors.right: parent.right
Expand Down Expand Up @@ -609,7 +646,7 @@ Rectangle {
color: "transparent"
}

NetworkStatusItem {
MoneroComponents.NetworkStatusItem {
id: networkStatus
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -620,7 +657,7 @@ Rectangle {
height: 48 * scaleRatio
}

ProgressBar {
MoneroComponents.ProgressBar {
id: progressBar
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -630,7 +667,7 @@ Rectangle {
visible: networkStatus.connected
}

ProgressBar {
MoneroComponents.ProgressBar {
id: daemonProgressBar
anchors.left: parent.left
anchors.right: parent.right
Expand Down
18 changes: 17 additions & 1 deletion components/HistoryTable.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions components/Style.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down