mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 03:42:05 +02:00
mining: fix layout issues
This commit is contained in:
parent
e729cd233c
commit
d6f88349b9
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2014-2018, The Monero Project
|
||||
// Copyright (c) 2014-2019, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
@ -59,10 +59,8 @@ Rectangle {
|
||||
visible: !walletManager.isDaemonLocal(appWindow.currentDaemonAddress)
|
||||
}
|
||||
|
||||
MoneroComponents.Label {
|
||||
id: soloSyncedLabel
|
||||
fontSize: 18 * scaleRatio
|
||||
color: "#D02020"
|
||||
MoneroComponents.WarningBox {
|
||||
Layout.bottomMargin: 8 * scaleRatio
|
||||
text: qsTr("Your daemon must be synchronized before you can start mining") + translationManager.emptyString
|
||||
visible: walletManager.isDaemonLocal(appWindow.currentDaemonAddress) && !appWindow.daemonSynced
|
||||
}
|
||||
@ -84,38 +82,46 @@ Rectangle {
|
||||
text: qsTr("Mining may reduce the performance of other running applications and processes.") + translationManager.emptyString
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: soloMinerThreadsRow
|
||||
GridLayout {
|
||||
columns: 2
|
||||
Layout.fillWidth: true
|
||||
columnSpacing: 20 * scaleRatio
|
||||
rowSpacing: 16 * scaleRatio
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment : Qt.AlignTop | Qt.AlignLeft
|
||||
|
||||
MoneroComponents.Label {
|
||||
id: soloMinerThreadsLabel
|
||||
color: MoneroComponents.Style.defaultFontColor
|
||||
text: qsTr("CPU threads") + translationManager.emptyString
|
||||
fontSize: 16 * scaleRatio
|
||||
Layout.preferredWidth: 120 * scaleRatio
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 16 * scaleRatio
|
||||
|
||||
MoneroComponents.LineEdit {
|
||||
id: soloMinerThreadsLine
|
||||
Layout.preferredWidth: 200 * scaleRatio
|
||||
Layout.minimumWidth: 200 * scaleRatio
|
||||
text: "1"
|
||||
validator: IntValidator { bottom: 1; top: idealThreadCount }
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: numAvailableThreadsText
|
||||
text: qsTr("Max # of CPU threads available for mining: ") + idealThreadCount + translationManager.emptyString
|
||||
wrapMode: Text.WordWrap
|
||||
Layout.leftMargin: 125 * scaleRatio
|
||||
font.family: MoneroComponents.Style.fontRegular.name
|
||||
font.pixelSize: 14 * scaleRatio
|
||||
color: MoneroComponents.Style.defaultFontColor
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.leftMargin: 125 * scaleRatio
|
||||
|
||||
MoneroComponents.StandardButton {
|
||||
id: autoRecommendedThreadsButton
|
||||
small: true
|
||||
@ -140,7 +146,6 @@ Rectangle {
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.leftMargin: 125 * scaleRatio
|
||||
MoneroComponents.CheckBox {
|
||||
id: backgroundMining
|
||||
enabled: startSoloMinerButton.enabled
|
||||
@ -153,7 +158,6 @@ Rectangle {
|
||||
RowLayout {
|
||||
// Disable this option until stable
|
||||
visible: false
|
||||
Layout.leftMargin: 125 * scaleRatio
|
||||
MoneroComponents.CheckBox {
|
||||
id: ignoreBattery
|
||||
enabled: startSoloMinerButton.enabled
|
||||
@ -162,20 +166,29 @@ Rectangle {
|
||||
text: qsTr("Enable mining when running on battery") + translationManager.emptyString
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.alignment : Qt.AlignTop | Qt.AlignLeft
|
||||
|
||||
RowLayout {
|
||||
MoneroComponents.Label {
|
||||
id: manageSoloMinerLabel
|
||||
color: MoneroComponents.Style.defaultFontColor
|
||||
text: qsTr("Manage miner") + translationManager.emptyString
|
||||
fontSize: 16 * scaleRatio
|
||||
Layout.preferredWidth: 120 * scaleRatio
|
||||
wrapMode: Text.Wrap
|
||||
Layout.preferredWidth: manageSoloMinerLabel.textWidth
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 16 * scaleRatio
|
||||
|
||||
RowLayout {
|
||||
MoneroComponents.StandardButton {
|
||||
visible: true
|
||||
id: startSoloMinerButton
|
||||
width: 110 * scaleRatio
|
||||
small: true
|
||||
text: qsTr("Start mining") + translationManager.emptyString
|
||||
onClicked: {
|
||||
@ -196,7 +209,6 @@ Rectangle {
|
||||
MoneroComponents.StandardButton {
|
||||
visible: true
|
||||
id: stopSoloMinerButton
|
||||
width: 110 * scaleRatio
|
||||
small: true
|
||||
text: qsTr("Stop mining") + translationManager.emptyString
|
||||
onClicked: {
|
||||
@ -205,24 +217,33 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: statusRow
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment : Qt.AlignTop | Qt.AlignLeft
|
||||
|
||||
MoneroComponents.Label {
|
||||
id: statusLabel
|
||||
color: MoneroComponents.Style.defaultFontColor
|
||||
text: qsTr("Status") + translationManager.emptyString
|
||||
fontSize: 16 * scaleRatio
|
||||
Layout.preferredWidth: 120 * scaleRatio
|
||||
}
|
||||
}
|
||||
|
||||
MoneroComponents.LineEdit {
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 16 * scaleRatio
|
||||
|
||||
MoneroComponents.LineEditMulti {
|
||||
id: statusText
|
||||
Layout.preferredWidth: 200 * scaleRatio
|
||||
Layout.minimumWidth: 300 * scaleRatio
|
||||
text: qsTr("Not mining") + translationManager.emptyString
|
||||
borderDisabled: true
|
||||
readOnly: true
|
||||
wrapMode: Text.Wrap
|
||||
inputPaddingLeft: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -237,10 +258,11 @@ Rectangle {
|
||||
}
|
||||
|
||||
function update() {
|
||||
var daemonReady = walletManager.isDaemonLocal(appWindow.currentDaemonAddress) && appWindow.daemonSynced
|
||||
appWindow.isMining = walletManager.isMining()
|
||||
updateStatusText()
|
||||
startSoloMinerButton.enabled = !appWindow.isMining
|
||||
stopSoloMinerButton.enabled = !startSoloMinerButton.enabled
|
||||
startSoloMinerButton.enabled = !appWindow.isMining && daemonReady
|
||||
stopSoloMinerButton.enabled = !startSoloMinerButton.enabled && daemonReady
|
||||
}
|
||||
|
||||
MoneroComponents.StandardDialog {
|
||||
|
Loading…
Reference in New Issue
Block a user