SettingsInfo: use MoneroComponents.StandardButton 💄

This commit is contained in:
mmbyday 2018-12-13 12:04:02 -08:00
parent 59fc48bd8b
commit d10ce1744c

View file

@ -37,7 +37,7 @@ import "../../components" as MoneroComponents
Rectangle { Rectangle {
color: "transparent" color: "transparent"
height: 1400 height: 1400 * scaleRatio
Layout.fillWidth: true Layout.fillWidth: true
ColumnLayout { ColumnLayout {
@ -48,19 +48,19 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
anchors.margins: (isMobile)? 17 : 20 anchors.margins: (isMobile)? 17 : 20
anchors.topMargin: 0 anchors.topMargin: 0
spacing: 30 spacing: 30 * scaleRatio
GridLayout { GridLayout {
columns: 2 columns: 2
columnSpacing: 0 columnSpacing: 0
MoneroComponents.TextBlock { MoneroComponents.TextBlock {
font.pixelSize: 14 font.pixelSize: 14 * scaleRatio
text: qsTr("GUI version: ") + translationManager.emptyString text: qsTr("GUI version: ") + translationManager.emptyString
} }
MoneroComponents.TextBlock { MoneroComponents.TextBlock {
font.pixelSize: 14 font.pixelSize: 14 * scaleRatio
text: Version.GUI_VERSION + " (Qt " + qtRuntimeVersion + ")" + translationManager.emptyString text: Version.GUI_VERSION + " (Qt " + qtRuntimeVersion + ")" + translationManager.emptyString
} }
@ -84,12 +84,12 @@ Rectangle {
MoneroComponents.TextBlock { MoneroComponents.TextBlock {
id: guiMoneroVersion id: guiMoneroVersion
font.pixelSize: 14 font.pixelSize: 14 * scaleRatio
text: qsTr("Embedded Monero version: ") + translationManager.emptyString text: qsTr("Embedded Monero version: ") + translationManager.emptyString
} }
MoneroComponents.TextBlock { MoneroComponents.TextBlock {
font.pixelSize: 14 font.pixelSize: 14 * scaleRatio
text: Version.GUI_MONERO_VERSION + translationManager.emptyString text: Version.GUI_MONERO_VERSION + translationManager.emptyString
} }
@ -113,14 +113,14 @@ Rectangle {
MoneroComponents.TextBlock { MoneroComponents.TextBlock {
Layout.fillWidth: true Layout.fillWidth: true
font.pixelSize: 14 font.pixelSize: 14 * scaleRatio
text: qsTr("Wallet path: ") + translationManager.emptyString text: qsTr("Wallet path: ") + translationManager.emptyString
} }
MoneroComponents.TextBlock { MoneroComponents.TextBlock {
Layout.fillWidth: true Layout.fillWidth: true
Layout.maximumWidth: 360 Layout.maximumWidth: 360 * scaleRatio
font.pixelSize: 14 font.pixelSize: 14 * scaleRatio
text: { text: {
var wallet_path = walletPath(); var wallet_path = walletPath();
if(isIOS) if(isIOS)
@ -149,7 +149,7 @@ Rectangle {
MoneroComponents.TextBlock { MoneroComponents.TextBlock {
id: restoreHeight id: restoreHeight
font.pixelSize: 14 font.pixelSize: 14 * scaleRatio
textFormat: Text.RichText textFormat: Text.RichText
text: (typeof currentWallet == "undefined") ? "" : qsTr("Wallet creation height: ") + translationManager.emptyString text: (typeof currentWallet == "undefined") ? "" : qsTr("Wallet creation height: ") + translationManager.emptyString
} }
@ -158,7 +158,7 @@ Rectangle {
id: restoreHeightText id: restoreHeightText
Layout.fillWidth: true Layout.fillWidth: true
textFormat: Text.RichText textFormat: Text.RichText
font.pixelSize: 14 font.pixelSize: 14 * scaleRatio
font.bold: true font.bold: true
property var style: "<style type='text/css'>a {cursor:pointer;text-decoration: none; color: #FF6C3C}</style>" property var style: "<style type='text/css'>a {cursor:pointer;text-decoration: none; color: #FF6C3C}</style>"
text: (currentWallet ? currentWallet.walletCreationHeight : "") + style + qsTr(" <a href='#'> (Click to change)</a>") + translationManager.emptyString text: (currentWallet ? currentWallet.walletCreationHeight : "") + style + qsTr(" <a href='#'> (Click to change)</a>") + translationManager.emptyString
@ -230,71 +230,42 @@ Rectangle {
MoneroComponents.TextBlock { MoneroComponents.TextBlock {
Layout.fillWidth: true Layout.fillWidth: true
font.pixelSize: 14 font.pixelSize: 14 * scaleRatio
text: qsTr("Wallet log path: ") + translationManager.emptyString text: qsTr("Wallet log path: ") + translationManager.emptyString
} }
MoneroComponents.TextBlock { MoneroComponents.TextBlock {
Layout.fillWidth: true Layout.fillWidth: true
font.pixelSize: 14 font.pixelSize: 14 * scaleRatio
text: walletLogPath text: walletLogPath
} }
} }
// Copy info to clipboard // Copy info to clipboard
Rectangle { MoneroComponents.StandardButton {
color: "transparent" small: true
Layout.preferredHeight: 24 * scaleRatio text: qsTr("Copy to clipboard") + translationManager.emptyString
Layout.fillWidth: true onClicked: {
var data = "";
data += "GUI version: " + Version.GUI_VERSION + " (Qt " + qtRuntimeVersion + ")";
data += "\nEmbedded Monero version: " + Version.GUI_MONERO_VERSION;
data += "\nWallet path: ";
Rectangle { var wallet_path = walletPath();
id: rectCopy if(isIOS)
color: MoneroComponents.Style.buttonBackgroundColorDisabled wallet_path = moneroAccountsDir + wallet_path;
width: btnCopy.width + 40 data += wallet_path;
height: 24
radius: 2
Text { data += "\nWallet creation height: ";
id: btnCopy if(currentWallet)
anchors.verticalCenter: parent.verticalCenter data += currentWallet.walletCreationHeight;
anchors.horizontalCenter: parent.horizontalCenter
color: MoneroComponents.Style.defaultFontColor
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 14 * scaleRatio
font.bold: true
text: qsTr("Copy to clipboard") + translationManager.emptyString
}
MouseArea { data += "\nWallet log path: " + walletLogPath;
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
var data = "";
data += "GUI version: " + Version.GUI_VERSION + " (Qt " + qtRuntimeVersion + ")";
data += "\nEmbedded Monero version: " + Version.GUI_MONERO_VERSION;
data += "\nWallet path: ";
var wallet_path = walletPath(); console.log("Copied to clipboard");
if(isIOS) clipboard.setText(data);
wallet_path = moneroAccountsDir + wallet_path; appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3);
data += wallet_path;
data += "\nWallet creation height: ";
if(currentWallet)
data += currentWallet.walletCreationHeight;
data += "\nWallet log path: " + walletLogPath;
console.log("Copied to clipboard");
clipboard.setText(data);
appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3);
}
}
} }
} }
} }
Component.onCompleted: {
}
} }