aboutsummaryrefslogtreecommitdiff
path: root/components/HistoryTableInnerColumn.qml
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-02-01 00:02:07 -0600
committerluigi1111 <luigi1111w@gmail.com>2019-02-01 00:02:07 -0600
commitb78968b9d5c223b0777e710c8ba6d5c3f69fca9c (patch)
tree8b839eea78889385acf62d1adcae2f3311447f74 /components/HistoryTableInnerColumn.qml
parent9689fff957ba994b619a2a7fb881598a997f66c2 (diff)
parentd5a69cb638b86c06f1a7394c139565e0b6d22052 (diff)
downloadmonzero-gui-b78968b9d5c223b0777e710c8ba6d5c3f69fca9c.tar.gz
monzero-gui-b78968b9d5c223b0777e710c8ba6d5c3f69fca9c.tar.xz
monzero-gui-b78968b9d5c223b0777e710c8ba6d5c3f69fca9c.zip
Merge pull request #1861
d5a69cb history: enable set_tx_note (mmbyday)
Diffstat (limited to 'components/HistoryTableInnerColumn.qml')
-rw-r--r--components/HistoryTableInnerColumn.qml105
1 files changed, 69 insertions, 36 deletions
diff --git a/components/HistoryTableInnerColumn.qml b/components/HistoryTableInnerColumn.qml
index 566c2466..a6127ce7 100644
--- a/components/HistoryTableInnerColumn.qml
+++ b/components/HistoryTableInnerColumn.qml
@@ -33,7 +33,7 @@ import moneroComponents.Clipboard 1.0
import moneroComponents.PendingTransaction 1.0
import moneroComponents.Wallet 1.0
-import "../components" as MoneroComponents
+import "." as MoneroComponents
Rectangle{
@@ -44,48 +44,81 @@ Rectangle{
color: "transparent"
property string copyValue: ""
+ property string hashValue: ""
property alias labelHeader: label1.text
property alias labelValue: label2.text
+ property alias labelHeaderIcon: icon
+ property alias labelHeaderIconImageSource: icon.imageSource
- Text {
- id: label1
- anchors.left: parent.left
- font.family: MoneroComponents.Style.fontRegular.name
- font.pixelSize: 14 * scaleRatio
- text: labelHeader
- color: MoneroComponents.Style.dimmedFontColor
- }
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 2 * scaleRatio
- Text {
- id: label2
- anchors.left: parent.left
- anchors.top: label1.bottom
- font.family: MoneroComponents.Style.fontRegular.name
- font.pixelSize: 14 * scaleRatio
- text: labelValue
- color: MoneroComponents.Style.dimmedFontColor
- }
+ RowLayout {
+ Layout.fillWidth: true
- // hover effect / copy value
- MouseArea {
- visible: copyValue !== ""
- hoverEnabled: true
- anchors.fill: parent
- cursorShape: Qt.PointingHandCursor
- onEntered: {
- label1.color = MoneroComponents.Style.defaultFontColor;
- label2.color = MoneroComponents.Style.defaultFontColor;
- }
- onExited: {
- label1.color = MoneroComponents.Style.dimmedFontColor
- label2.color = MoneroComponents.Style.dimmedFontColor;
+ Text {
+ id: label1
+ font.family: MoneroComponents.Style.fontRegular.name
+ font.pixelSize: 14 * scaleRatio
+ text: labelHeader
+ color: MoneroComponents.Style.dimmedFontColor
+ }
+
+ MoneroComponents.IconButton {
+ id: icon
+ visible: imageSource !== ""
+ Layout.leftMargin: 8 * scaleRatio
+ width: image.width
+ height: image.height
+
+ onClicked: {
+ editDescription(hashValue);
+ }
+ }
}
- onClicked: {
- if(copyValue){
- console.log("Copied to clipboard");
- clipboard.setText(copyValue);
- appWindow.showStatusMessage(qsTr("Copied to clipboard"),3)
+
+ Text {
+ id: label2
+ font.family: MoneroComponents.Style.fontRegular.name
+ font.pixelSize: 14 * scaleRatio
+ text: labelValue
+ color: MoneroComponents.Style.dimmedFontColor
+
+ MouseArea {
+ hoverEnabled: true
+ anchors.fill: parent
+ cursorShape: Qt.PointingHandCursor
+
+ onEntered: {
+ label1.color = MoneroComponents.Style.defaultFontColor;
+ label2.color = MoneroComponents.Style.defaultFontColor;
+ }
+
+ onExited: {
+ label1.color = MoneroComponents.Style.dimmedFontColor;
+ label2.color = MoneroComponents.Style.dimmedFontColor;
+ }
+
+ onClicked: {
+ if(copyValue){
+ console.log("Copied to clipboard");
+ clipboard.setText(copyValue);
+ appWindow.showStatusMessage(qsTr("Copied to clipboard"),3)
+ }
+ }
}
}
}
+
+ function editDescription(_hash){
+ inputDialog.labelText = qsTr("Set description:") + translationManager.emptyString;
+ inputDialog.onAcceptedCallback = function() {
+ appWindow.currentWallet.setUserNote(_hash, inputDialog.inputText);
+ appWindow.showStatusMessage(qsTr("Updated description."),3);
+ middlePanel.historyView.update();
+ }
+ inputDialog.onRejectedCallback = null;
+ inputDialog.open()
+ }
}