Improve UI
This commit is contained in:
parent
cff0316c0a
commit
028f492c32
1 changed files with 20 additions and 16 deletions
42
qml/Main.qml
42
qml/Main.qml
|
@ -22,12 +22,14 @@ ApplicationWindow {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
anchors.fill: parent
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
id: numberInput
|
id: numberInput
|
||||||
placeholderText: "Enter a number"
|
placeholderText: "Enter a number"
|
||||||
// NOTE: We can't use the IntValidator here, since it doesn't support 64-bit values (long long)
|
// NOTE: We can't use the IntValidator here, since it doesn't support 64-bit values (long long)
|
||||||
|
// Entering invalid numbers might cause unexpected behavior (will be fed to parseInt).
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
font.pixelSize: 16
|
font.pixelSize: 16
|
||||||
onTextChanged: factorizationController.reset()
|
onTextChanged: factorizationController.reset()
|
||||||
|
@ -61,7 +63,9 @@ ApplicationWindow {
|
||||||
GroupBox {
|
GroupBox {
|
||||||
title: "Settings"
|
title: "Settings"
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
anchors.fill: parent
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
@ -97,30 +101,30 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GroupBox {
|
||||||
|
title: "Current Status"
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
anchors.fill: parent
|
||||||
|
spacing: 5
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: "Current Number (being factorized): " + factorizationController.curFactNumber
|
||||||
|
font.pixelSize: 14
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: "Current Factor: " + factorizationController.currentFactor
|
||||||
|
font.pixelSize: 14
|
||||||
|
}
|
||||||
|
|
||||||
ProgressBar {
|
ProgressBar {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
from: 0
|
from: 0
|
||||||
to: 100
|
to: 100
|
||||||
value: factorizationController.progress
|
value: factorizationController.progress
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupBox {
|
|
||||||
title: "Current Status"
|
|
||||||
Layout.fillWidth: true
|
|
||||||
ColumnLayout {
|
|
||||||
spacing: 5
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: "Current Factor: " + factorizationController.currentFactor
|
|
||||||
font.pixelSize: 14
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: "Current Number (being factorized): " + factorizationController.curFactNumber
|
|
||||||
font.pixelSize: 14
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +141,7 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: factorizationController.useSqrtOptimization ? "Note: Only factors up to sqrt(n) are searched." : "Note: Searching all factors (slower)."
|
text: factorizationController.useSqrtOptimization ? "Note: Only factors up to sqrt(n) are searched." : "Warning: Searching all factors (inefficient)."
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue