qml: Relayout buttons for [3,1,1,1]

This change adjusts the layout for the progress bar, write button and
cancellation buttons such that they are all placed on the same layout
'row', with the progress bar stacked as before, and the
write/cancel/cancel buttons stacked as a column.

This is not ideal, but probably as sensible as we can get inside this
layout paradigm.
This commit is contained in:
Tom Dewey tom.dewey@raspberrypi.com 2023-10-10 14:03:20 +01:00
parent bcdee1818d
commit e8663baf34
3 changed files with 49 additions and 37 deletions

View file

@ -69,23 +69,24 @@ ApplicationWindow {
spacing: 0
Rectangle {
implicitHeight: window.height/2
implicitHeight: window.height/3
Image {
id: image
Layout.fillWidth: true
//Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
fillMode: Image.PreserveAspectFit
source: "icons/logo_stacked_imager.png"
source: "icons/logo_sxs_imager.png"
width: window.width
height: window.height/2
height: window.height/3
}
}
Rectangle {
color: "#c31c4a"
implicitWidth: window.width
implicitHeight: window.height/2
implicitHeight: (window.height/3) * 2
GridLayout {
id: gridLayout
@ -215,41 +216,11 @@ ApplicationWindow {
}
ColumnLayout {
id: columnLayoutProgress
spacing: 0
Layout.row: 1
Layout.column: 2
Layout.fillWidth: true
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
ImButton {
id: writebutton
text: qsTr("WRITE")
Layout.bottomMargin: 25
Layout.minimumHeight: 40
Layout.fillWidth: true
Accessible.ignored: ospopup.visible || dstpopup.visible || hwpopup.visible
Accessible.description: qsTr("Select this button to start writing the image")
enabled: false
onClicked: {
if (!imageWriter.readyToWrite()) {
return
}
if (!optionspopup.initialized && imageWriter.imageSupportsCustomization() && imageWriter.hasSavedCustomizationSettings()) {
usesavedsettingspopup.openPopup()
} else {
confirmwritepopup.askForConfirmation()
}
}
}
}
ColumnLayout {
id: columnLayout3
Layout.columnSpan: 2
Layout.row: 1
Layout.column: 0
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.columnSpan: 2
Text {
id: progressText
@ -272,9 +243,19 @@ ApplicationWindow {
visible: false
Material.background: "#d15d7d"
}
}
ColumnLayout {
id: columnLayout3
Layout.row: 1
Layout.column: 2
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
spacing: 0
ImButton {
Layout.bottomMargin: 25
Layout.minimumHeight: 40
Layout.preferredWidth: 200
padding: 5
id: cancelwritebutton
text: qsTr("CANCEL WRITE")
@ -288,6 +269,8 @@ ApplicationWindow {
}
ImButton {
Layout.bottomMargin: 25
Layout.minimumHeight: 40
Layout.preferredWidth: 200
padding: 5
id: cancelverifybutton
text: qsTr("CANCEL VERIFY")
@ -302,6 +285,9 @@ ApplicationWindow {
ImButton {
Layout.bottomMargin: 25
Layout.minimumHeight: 40
Layout.preferredWidth: 200
Layout.alignment: Qt.AlignRight
padding: 5
id: customizebutton
onClicked: {
@ -314,6 +300,28 @@ ApplicationWindow {
fillMode: Image.PreserveAspectFit
}
}
ImButton {
id: writebutton
text: qsTr("WRITE")
Layout.bottomMargin: 25
Layout.minimumHeight: 40
Layout.preferredWidth: 200
Layout.alignment: Qt.AlignRight
Accessible.ignored: ospopup.visible || dstpopup.visible || hwpopup.visible
Accessible.description: qsTr("Select this button to start writing the image")
enabled: false
onClicked: {
if (!imageWriter.readyToWrite()) {
return
}
if (!optionspopup.initialized && imageWriter.imageSupportsCustomization() && imageWriter.hasSavedCustomizationSettings()) {
usesavedsettingspopup.openPopup()
} else {
confirmwritepopup.askForConfirmation()
}
}
}
}
Text {
@ -1126,6 +1134,7 @@ ApplicationWindow {
title: qsTr("Warning")
onYes: {
langbarRect.visible = false
writebutton.visible = false
writebutton.enabled = false
customizebutton.visible = false
cancelwritebutton.enabled = true
@ -1138,6 +1147,7 @@ ApplicationWindow {
progressBar.Material.accent = "#ffffff"
osbutton.enabled = false
dstbutton.enabled = false
hwbutton.enabled = false
imageWriter.setVerifyEnabled(true)
imageWriter.startWrite()
}
@ -1259,6 +1269,7 @@ ApplicationWindow {
customizebutton.visible = imageWriter.imageSupportsCustomization()
osbutton.enabled = true
dstbutton.enabled = true
hwbutton.enabled = true
writebutton.visible = true
writebutton.enabled = imageWriter.readyToWrite()
cancelwritebutton.visible = false