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,147 +77,137 @@ 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
Image {
id: logo
anchors.left: parent.left
anchors.leftMargin: 50
source: "images/moneroLogo.png"
}
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"
}
Text {
id: testnetLabel
visible: persistentSettings.nettype !== NetworkType.MAINNET
text: (persistentSettings.nettype === NetworkType.TESTNET ? qsTr("Testnet") : qsTr("Stagenet")) + translationManager.emptyString
anchors.top: logo.bottom
anchors.topMargin: 5
anchors.left: viewOnly ? viewOnlyLabel.right : parent.left
anchors.leftMargin: viewOnly ? 10 : 50
font.bold: true
color: "red"
}
/* Disable twitter/news panel
Image {
anchors.left: parent.left
anchors.verticalCenter: logo.verticalCenter
anchors.leftMargin: 19
source: appWindow.rightPanelExpanded ? "images/expandRightPanel.png" :
"images/collapseRightPanel.png"
}
MouseArea {
anchors.fill: parent
onClicked: appWindow.rightPanelExpanded = !appWindow.rightPanelExpanded
}
*/
}
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 { Row {
visible: !isMobile visible: true
Item { Item {
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
height: 26 * scaleRatio height: 490 * scaleRatio
width: 50 * scaleRatio width: 50 * scaleRatio
Image { Image {
anchors.centerIn: parent width: 259; height:170
source: "images/lockIcon.png" fillMode: Image.PreserveAspectFit
source: "images/card-background.png"
} }
}
Text { Text {
visible: !isMobile visible: !isMobile
id: balanceText id: balanceText
anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left
font.family: "Arial" anchors.leftMargin: 20
color: "#000000" anchors.top: parent.top
text: "N/A" anchors.topMargin: 76
// dynamically adjust text size font.family: "Arial"
font.pixelSize: { color: "#FFFFFF"
var digits = text.split('.')[0].length text: "N/A"
var defaultSize = 25; // dynamically adjust text size
if(digits > 2) { font.pixelSize: {
return defaultSize - 1.1*digits var digits = text.split('.')[0].length
var defaultSize = 22;
if(digits > 2) {
return defaultSize - 1.1*digits
}
return defaultSize;
} }
return defaultSize;
} }
}
}
Item { //separator Text {
anchors.left: parent.left id: unlockedBalanceText
anchors.right: parent.right anchors.left: parent.left
height: 1 anchors.leftMargin: 20
} anchors.top: parent.top
anchors.topMargin: 126
Label { font.family: "Arial"
id: unlockedBalanceLabel color: "#FFFFFF"
text: qsTr("Unlocked balance") + translationManager.emptyString text: "N/A"
anchors.left: parent.left // dynamically adjust text size
anchors.leftMargin: 50 font.pixelSize: {
} var digits = text.split('.')[0].length
var defaultSize = 20;
Text { if(digits > 3) {
id: unlockedBalanceText return defaultSize - 0.6*digits
anchors.left: parent.left }
anchors.leftMargin: 50 return defaultSize;
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; Text {
id: testnetLabel
visible: persistentSettings.testnet
text: qsTr("Testnet") + translationManager.emptyString
anchors.top: logo.bottom
anchors.topMargin: 5
anchors.left: parent.left
anchors.leftMargin: 50
font.bold: true
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
Image {
anchors.left: parent.left
anchors.verticalCenter: logo.verticalCenter
anchors.leftMargin: 19
source: appWindow.rightPanelExpanded ? "images/expandRightPanel.png" :
"images/collapseRightPanel.png"
}
MouseArea {
anchors.fill: parent
onClicked: appWindow.rightPanelExpanded = !appWindow.rightPanelExpanded
}
*/
} }
} }
} }
Rectangle { Rectangle {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left