marcin 2014-07-16 16:48:17 +02:00
parent 4cbd5f57be
commit e87418f36c
9 changed files with 197 additions and 122 deletions

View file

@ -1,94 +1,115 @@
import QtQuick 2.0
import moneroComponents 1.0
ListView {
id: listView
clip: true
boundsBehavior: ListView.StopAtBounds
property var previousItem
delegate: Rectangle {
id: delegate
height: 64
width: listView.width
color: index % 2 ? "#F8F8F8" : "#FFFFFF"
function collapseDropdown() { dropdown.expanded = false }
StandardButton {
id: goToTransferButton
Text {
id: descriptionText
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
width: 37
anchors.leftMargin: 3
shadowReleasedColor: "#FF4304"
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
icon: "../images/goToTransferIcon.png"
}
anchors.top: parent.top
anchors.topMargin: 12
width: text.length ? (descriptionArea.containsMouse ? dropdown.x - x - 12 : 139) : 0
font.family: "Arial"
font.bold: true
font.pixelSize: 19
color: "#444444"
elide: Text.ElideRight
text: description
StandardButton {
id: removeButton
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
width: 37
anchors.rightMargin: 3
shadowReleasedColor: "#DBDBDB"
shadowPressedColor: "#888888"
releasedColor: "#F0EEEE"
pressedColor: "#DBDBDB"
icon: "../images/deleteIcon.png"
}
Row {
anchors.left: goToTransferButton.right
anchors.right: removeButton.left
anchors.leftMargin: 12
anchors.top: goToTransferButton.top
anchors.topMargin: -2
Text {
id: paymentIdText
anchors.top: parent.top
width: text.length ? 139 : 0
font.family: "Arial"
font.bold: true
font.pixelSize: 19
color: "#444444"
elide: Text.ElideRight
text: paymentId
}
Item { //separator
width: paymentIdText.width ? 12 : 0
height: 14
}
Text {
anchors.bottom: paymentIdText.bottom
width: parent.width - x - 12
elide: Text.ElideRight
font.family: "Arial"
font.pixelSize: 14
color: "#545454"
text: description
MouseArea {
id: descriptionArea
anchors.fill: parent
hoverEnabled: true
}
}
Text {
anchors.top: description.length === 0 && paymentId.length === 0 ? goToTransferButton.top : undefined
anchors.bottom: description.length === 0 && paymentId.length === 0 ? undefined : goToTransferButton.bottom
anchors.topMargin: -2
anchors.bottomMargin: -2
anchors.left: goToTransferButton.right
anchors.right: removeButton.left
id: addressText
anchors.bottom: descriptionText.bottom
anchors.left: descriptionText.right
anchors.right: dropdown.left
anchors.leftMargin: description.length > 0 ? 12 : 0
anchors.rightMargin: 12
anchors.leftMargin: 12
elide: Text.ElideRight
font.family: "Arial"
font.pixelSize: 14
font.pixelSize: 16
font.letterSpacing: -1
color: "#545454"
text: address
}
Text {
id: paymentLabel
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.bottomMargin: 12
width: 139
font.family: "Arial"
font.pixelSize: 12
font.letterSpacing: -1
color: "#535353"
text: qsTr("Payment ID:")
}
Text {
anchors.bottom: paymentLabel.bottom
anchors.left: paymentLabel.right
anchors.leftMargin: 12
anchors.rightMargin: 12
anchors.right: dropdown.left
elide: Text.ElideRight
font.family: "Arial"
font.pixelSize: 13
font.letterSpacing: -1
color: "#545454"
text: paymentId
}
ListModel {
id: dropModel
ListElement { name: "<b>Copy address to clipboard</b>"; icon: "../images/dropdownCopy.png" }
ListElement { name: "<b>Send to same destination</b>"; icon: "../images/dropdownSend.png" }
ListElement { name: "<b>Find similar transactions</b>"; icon: "../images/dropdownSearch.png" }
ListElement { name: "<b>Remove from history</b>"; icon: "../images/dropdownDel.png" }
}
Clipboard { id: clipboard }
TableDropdown {
id: dropdown
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 5
dataModel: dropModel
z: 1
onExpandedChanged: {
if(listView.previousItem !== undefined && listView.previousItem !== delegate)
listView.previousItem.collapseDropdown()
if(expanded) {
listView.previousItem = delegate
listView.currentIndex = index
listView.currentItem.z = 2
}
}
onCollapsed: delegate.z = 0
onOptionClicked: {
if(option === 0)
clipboard.setText(address)
}
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right

View file

@ -1,5 +1,4 @@
import QtQuick 2.0
import "../components"
import moneroComponents 1.0
ListView {
@ -12,7 +11,6 @@ ListView {
id: delegate
height: 90
width: listView.width
z: 0
color: index % 2 ? "#F8F8F8" : "#FFFFFF"
function collapseDropdown() { dropdown.expanded = false }
@ -175,14 +173,6 @@ ListView {
}
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 1
color: "#DBDBDB"
}
ListModel {
id: dropModel
ListElement { name: "<b>Copy address to clipboard</b>"; icon: "../images/dropdownCopy.png" }
@ -199,6 +189,7 @@ ListView {
anchors.bottomMargin: 11
anchors.rightMargin: 5
dataModel: dropModel
z: 1
onExpandedChanged: {
if(listView.previousItem !== undefined && listView.previousItem !== delegate)
listView.previousItem.collapseDropdown()
@ -214,5 +205,13 @@ ListView {
clipboard.setText(address)
}
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 1
color: "#DBDBDB"
}
}
}

BIN
images/dropdownDel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

BIN
images/expandTable.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

View file

@ -49,35 +49,34 @@ Rectangle {
text: qsTr("Payment ID <font size='2'>(Optional)</font>")
fontSize: 14
tipText: qsTr("<b>Payment ID</b><br/><br/>A unique user name used in<br/>the address book. It is not a<br/>transfer of information sent<br/>during thevtransfer")
width: 156
}
Label {
id: descriptionLabel
anchors.left: paymentIdLabel.right
anchors.top: addressLine.bottom
anchors.leftMargin: 17
anchors.topMargin: 17
text: qsTr("Description <font size='2'>(Local database)</font>")
fontSize: 14
tipText: qsTr("<b>Tip tekst test</b><br/><br/>test line 2")
width: 156
}
LineEdit {
id: paymentIdLine
anchors.left: parent.left
anchors.right: parent.right
anchors.top: paymentIdLabel.bottom
anchors.leftMargin: 17
anchors.rightMargin: 17
anchors.topMargin: 5
width: 156
}
Label {
id: descriptionLabel
anchors.left: parent.left
anchors.top: paymentIdLine.bottom
anchors.leftMargin: 17
anchors.topMargin: 17
text: qsTr("Description <font size='2'>(Local database)</font>")
fontSize: 14
tipText: qsTr("<b>Tip tekst test</b><br/><br/>test line 2")
}
LineEdit {
id: descriptionLine
anchors.left: paymentIdLine.right
anchors.right: addButton.left
anchors.top: paymentIdLabel.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.top: descriptionLabel.bottom
anchors.leftMargin: 17
anchors.rightMargin: 17
anchors.topMargin: 5
@ -85,10 +84,10 @@ Rectangle {
StandardButton {
id: addButton
anchors.right: parent.right
anchors.top: paymentIdLabel.bottom
anchors.rightMargin: 17
anchors.topMargin: 5
anchors.left: parent.left
anchors.top: descriptionLine.bottom
anchors.leftMargin: 17
anchors.topMargin: 17
width: 60
shadowReleasedColor: "#FF4304"
@ -98,14 +97,40 @@ Rectangle {
text: qsTr("ADD")
}
Item {
id: expandItem
property bool expanded: false
anchors.right: parent.right
anchors.bottom: tableRect.top
width: 34
height: 34
Image {
anchors.centerIn: parent
source: "../images/expandTable.png"
rotation: parent.expanded ? 180 : 0
}
MouseArea {
anchors.fill: parent
onClicked: parent.expanded = !parent.expanded
}
}
Rectangle {
id: tableRect
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.top: paymentIdLine.bottom
anchors.topMargin: 17
height: expandItem.expanded ? parent.height - newEntryText.y - newEntryText.height - 17 :
parent.height - addButton.y - addButton.height - 17
color: "#FFFFFF"
Behavior on height {
NumberAnimation { duration: 200; easing.type: Easing.InQuad }
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
@ -116,8 +141,9 @@ Rectangle {
ListModel {
id: columnsModel
ListElement { columnName: "Address"; columnWidth: 148 }
ListElement { columnName: "Payment ID"; columnWidth: 148 }
ListElement { columnName: "Description"; columnWidth: 420 }
ListElement { columnName: "Description"; columnWidth: 148 }
}
TableHeader {
@ -134,19 +160,19 @@ Rectangle {
ListModel {
id: testModel
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "" }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "Client from Australia" }
ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; description: "" }
}

View file

@ -9,7 +9,9 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 17
anchors.leftMargin: 17
anchors.rightMargin: 17
anchors.topMargin: 17
z: 1
}
@ -114,16 +116,16 @@ Rectangle {
ListModel {
id: testModel
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: "Client from Australia"; out: false }
ListElement { paymentId: "Martin"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: true }
ListElement { paymentId: "Martin"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: true }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: "Client from Australia"; out: false }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: true }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: true }
ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: false }
ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: "Client from Australia"; out: false }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: false }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: false }
ListElement { paymentId: ""; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: false }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: false }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: "Client from Australia"; out: false }
ListElement { paymentId: "Malkolm T."; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: false }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: false }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: "Client from Australia"; out: false }
ListElement { paymentId: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; address: "faef56b9acf67a7dba75ec01f403497049d7cff111628edfe7b57278554dc798"; date: "Jan 12, 2014"; time: "12:23 <font size='2'>AM</font>"; amount: "19301.<font size='2'>870709159241</font>"; balance: "0.<font size='2'>000709159241</font>"; description: ""; out: false }
}
Scroll {

View file

@ -8,7 +8,9 @@ Rectangle {
id: amountLabel
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 17
anchors.leftMargin: 17
anchors.rightMargin: 17
anchors.topMargin: 17
text: qsTr("Amount")
fontSize: 14
}
@ -129,13 +131,37 @@ Rectangle {
anchors.topMargin: 5
}
Row {
Label {
id: descriptionLabel
anchors.left: parent.left
anchors.right: parent.right
anchors.top: paymentLine.bottom
anchors.leftMargin: 17
anchors.rightMargin: 17
anchors.topMargin: 17
fontSize: 14
text: qsTr("Description <font size='2'>( Local database )</font>")
visible: checkBox.checked
}
LineEdit {
id: descriptionLine
anchors.left: parent.left
anchors.right: parent.right
anchors.top: descriptionLabel.bottom
anchors.leftMargin: 17
anchors.rightMargin: 17
anchors.topMargin: 5
visible: checkBox.checked
}
Row {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: checkBox.checked ? descriptionLine.bottom : paymentLine.bottom
anchors.leftMargin: 17
anchors.rightMargin: 17
anchors.topMargin: 17
spacing: 17
StandardButton {

View file

@ -51,7 +51,6 @@
<file>tabs/TweetsModel.qml</file>
<file>components/Scroll.qml</file>
<file>components/AddressBookTable.qml</file>
<file>images/goToTransferIcon.png</file>
<file>images/deleteIcon.png</file>
<file>images/moneroIcon.png</file>
<file>components/StandardDropdown.qml</file>
@ -70,5 +69,7 @@
<file>images/collapseRightPanel.png</file>
<file>images/expandRightPanel.png</file>
<file>images/dropdownCopy.png</file>
<file>images/expandTable.png</file>
<file>images/dropdownDel.png</file>
</qresource>
</RCC>