Receive: update subaddress table design

This commit is contained in:
selsta 2019-01-22 15:51:37 +01:00
parent c7f3deb5cc
commit 28332f54e6
No known key found for this signature in database
GPG key ID: 2EA0A99A8B07AE5E

View file

@ -88,8 +88,8 @@ Rectangle {
ColumnLayout { ColumnLayout {
id: subaddressListRow id: subaddressListRow
property int subaddressListItemHeight: 32 * scaleRatio property int subaddressListItemHeight: 50 * scaleRatio
Layout.topMargin: 22 * scaleRatio Layout.topMargin: 6 * scaleRatio
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: 240 Layout.minimumWidth: 240
Layout.preferredHeight: subaddressListItemHeight * subaddressListView.count Layout.preferredHeight: subaddressListItemHeight * subaddressListView.count
@ -97,8 +97,8 @@ Rectangle {
ListView { ListView {
id: subaddressListView id: subaddressListView
Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
anchors.fill: parent
clip: true clip: true
boundsBehavior: ListView.StopAtBounds boundsBehavior: ListView.StopAtBounds
delegate: Rectangle { delegate: Rectangle {
@ -128,7 +128,7 @@ Rectangle {
color: index === appWindow.current_subaddress_table_index ? "white" : "#757575" color: index === appWindow.current_subaddress_table_index ? "white" : "#757575"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 6 anchors.leftMargin: 6 * scaleRatio
fontSize: 14 * scaleRatio fontSize: 14 * scaleRatio
fontBold: true fontBold: true
text: "#" + index text: "#" + index
@ -139,29 +139,26 @@ Rectangle {
color: "#a5a5a5" color: "#a5a5a5"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: idLabel.right anchors.left: idLabel.right
anchors.leftMargin: 6 anchors.leftMargin: 6 * scaleRatio
fontSize: 14 * scaleRatio fontSize: 14 * scaleRatio
fontBold: true fontBold: true
text: label text: label
elide: Text.ElideRight
textWidth: addressLabel.x - nameLabel.x - 1
} }
MoneroComponents.Label { MoneroComponents.Label {
id: addressLabel
color: "white" color: "white"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: nameLabel.right anchors.left: parent.right
anchors.leftMargin: 6 anchors.leftMargin: (mainLayout.width < 510 ? -130 : -190) * scaleRatio
fontSize: 14 * scaleRatio fontSize: 14 * scaleRatio
fontBold: true fontBold: true
text: { text: TxUtils.addressTruncate(address, mainLayout.width < 510 ? 6 : 10)
if(isMobile){
TxUtils.addressTruncate(address, 6);
} else {
return TxUtils.addressTruncate(address, 10);
}
}
} }
MouseArea{ MouseArea {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
@ -181,9 +178,9 @@ Rectangle {
id: renameButton id: renameButton
imageSource: "../images/editIcon.png" imageSource: "../images/editIcon.png"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.right: index !== 0 ? copyButton.left : parent.right anchors.right: parent.right
anchors.rightMargin: index !== 0 ? 0 : 6 anchors.rightMargin: 30 * scaleRatio
anchors.top: undefined anchors.topMargin: 1 * scaleRatio
visible: index !== 0 visible: index !== 0
onClicked: { onClicked: {
@ -193,7 +190,7 @@ Rectangle {
MoneroComponents.IconButton { MoneroComponents.IconButton {
id: copyButton id: copyButton
imageSource: "../images/copyToClipboard.png" imageSource: "../images/dropdownCopy.png"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.top: undefined anchors.top: undefined
anchors.right: parent.right anchors.right: parent.right
@ -216,45 +213,23 @@ Rectangle {
} }
} }
// 'fake' row for 'create new address'
ColumnLayout {
id: createAddressRow
Layout.fillWidth: true
spacing: 0
Rectangle { Rectangle {
color: "#404040" color: "#404040"
Layout.fillWidth: true Layout.fillWidth: true
height: 1 height: 1
} }
Rectangle { MoneroComponents.CheckBox {
id: createAddressRect id: addNewAccountCheckbox
Layout.preferredHeight: subaddressListRow.subaddressListItemHeight visible: !selectAndSend
color: "transparent" border: false
Layout.fillWidth: true checkedIcon: "qrc:///images/plus-in-circle-medium-white.png"
uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png"
MoneroComponents.Label {
color: "#757575"
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 6
fontSize: 14 * scaleRatio fontSize: 14 * scaleRatio
fontBold: true iconOnTheLeft: true
text: "+ " + qsTr("Create new address") + translationManager.emptyString; Layout.fillWidth: true
} Layout.topMargin: 10 * scaleRatio
text: qsTr("Create new account") + translationManager.emptyString;
MouseArea {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onEntered: {
createAddressRect.color = "#26FFFFFF"
}
onExited: {
createAddressRect.color = "transparent"
}
onClicked: { onClicked: {
inputDialog.labelText = qsTr("Set the label of the new address:") + translationManager.emptyString inputDialog.labelText = qsTr("Set the label of the new address:") + translationManager.emptyString
inputDialog.inputText = qsTr("(Untitled)") inputDialog.inputText = qsTr("(Untitled)")
@ -267,8 +242,6 @@ Rectangle {
} }
} }
} }
}
}
ColumnLayout { ColumnLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter