New layouts for leftpanel

This commit is contained in:
Sander Ferdinand 2017-11-12 18:46:00 +01:00 committed by moneromooo-monero
parent f49ad844b8
commit f362953afc

View file

@ -77,47 +77,119 @@ Rectangle {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.top: parent.top anchors.top: parent.top
// Item with monero logo // card with monero logo
Item { Column {
visible: !isMobile visible: true
id: logoItem id: column1
height: 200
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: (persistentSettings.customDecorations)? 66 : 36 anchors.topMargin: (persistentSettings.customDecorations)? 56 : 36
height: logo.implicitHeight
Row {
visible: true
Item {
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter
height: 490 * scaleRatio
width: 50 * scaleRatio
Image { Image {
id: logo width: 259; height:170
anchors.left: parent.left fillMode: Image.PreserveAspectFit
anchors.leftMargin: 50 source: "images/card-background.png"
source: "images/moneroLogo.png"
} }
Text { Text {
id: viewOnlyLabel visible: !isMobile
visible: viewOnly id: balanceText
text: qsTr("View Only") + translationManager.emptyString
anchors.top: logo.bottom
anchors.topMargin: 5
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 50 anchors.leftMargin: 20
font.bold: true anchors.top: parent.top
color: "blue" anchors.topMargin: 76
font.family: "Arial"
color: "#FFFFFF"
text: "N/A"
// dynamically adjust text size
font.pixelSize: {
var digits = text.split('.')[0].length
var defaultSize = 22;
if(digits > 2) {
return defaultSize - 1.1*digits
}
return defaultSize;
}
} }
Text {
id: unlockedBalanceText
anchors.left: parent.left
anchors.leftMargin: 20
anchors.top: parent.top
anchors.topMargin: 126
font.family: "Arial"
color: "#FFFFFF"
text: "N/A"
// dynamically adjust text size
font.pixelSize: {
var digits = text.split('.')[0].length
var defaultSize = 20;
if(digits > 3) {
return defaultSize - 0.6*digits
}
return defaultSize;
}
}
Text { Text {
id: testnetLabel id: testnetLabel
visible: persistentSettings.nettype !== NetworkType.MAINNET visible: persistentSettings.testnet
text: (persistentSettings.nettype === NetworkType.TESTNET ? qsTr("Testnet") : qsTr("Stagenet")) + translationManager.emptyString text: qsTr("Testnet") + translationManager.emptyString
anchors.top: logo.bottom anchors.top: logo.bottom
anchors.topMargin: 5 anchors.topMargin: 5
anchors.left: viewOnly ? viewOnlyLabel.right : parent.left anchors.left: parent.left
anchors.leftMargin: viewOnly ? 10 : 50 anchors.leftMargin: 50
font.bold: true font.bold: true
color: "red" color: "red"
} }
// @TODO: implement
// Text {
// id: viewOnlyLabel
// visible: viewOnly
// text: qsTr("View Only") + translationManager.emptyString
// anchors.top: logo.bottom
// anchors.topMargin: 5
// anchors.left: parent.left
// anchors.leftMargin: 50
// font.bold: true
// color: "blue"
// }
Label {
id: unlockedBalanceLabel
text: qsTr("Unlocked balance") + translationManager.emptyString
anchors.left: parent.left
anchors.leftMargin: 20
anchors.top: parent.top
anchors.topMargin: 110
}
Label {
visible: !isMobile
id: balanceLabel
text: qsTr("Balance") + translationManager.emptyString
fontSize: 14
anchors.left: parent.left
anchors.leftMargin: 20
anchors.top: parent.top
anchors.topMargin: 60
}
Item { //separator
anchors.left: parent.left
anchors.right: parent.right
height: 1
}
/* Disable twitter/news panel /* Disable twitter/news panel
Image { Image {
anchors.left: parent.left anchors.left: parent.left
@ -133,91 +205,9 @@ Rectangle {
} }
*/ */
} }
Column {
visible: !isMobile
id: column1
anchors.left: parent.left
anchors.right: parent.right
anchors.top: logoItem.bottom
anchors.topMargin: 26
spacing: 5
Label {
visible: !isMobile
id: balanceLabel
text: qsTr("Balance") + translationManager.emptyString
anchors.left: parent.left
anchors.leftMargin: 50
}
Row {
visible: !isMobile
Item {
anchors.verticalCenter: parent.verticalCenter
height: 26 * scaleRatio
width: 50 * scaleRatio
Image {
anchors.centerIn: parent
source: "images/lockIcon.png"
} }
} }
Text {
visible: !isMobile
id: balanceText
anchors.verticalCenter: parent.verticalCenter
font.family: "Arial"
color: "#000000"
text: "N/A"
// dynamically adjust text size
font.pixelSize: {
var digits = text.split('.')[0].length
var defaultSize = 25;
if(digits > 2) {
return defaultSize - 1.1*digits
}
return defaultSize;
}
}
}
Item { //separator
anchors.left: parent.left
anchors.right: parent.right
height: 1
}
Label {
id: unlockedBalanceLabel
text: qsTr("Unlocked balance") + translationManager.emptyString
anchors.left: parent.left
anchors.leftMargin: 50
}
Text {
id: unlockedBalanceText
anchors.left: parent.left
anchors.leftMargin: 50
font.family: "Arial"
color: "#000000"
text: "N/A"
// dynamically adjust text size
font.pixelSize: {
var digits = text.split('.')[0].length
var defaultSize = 18;
if(digits > 3) {
return defaultSize - 0.6*digits
}
return defaultSize;
}
}
}
Rectangle { Rectangle {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left