qml: Move write button, assign explicit cells

1) Resize the window back to 680dip default widths. We don't need the
   extra space now.
2) Reduce Row spacing within the grid layout. We need all the space we
   can get.
3) Assign layouts to explicit cells, at least for selection options and
   write. This layout isn't really scaling to the amount of data we want
   to provide, but we'll make do for now.
4) Mark selection buttons as accessibility ignored when the hwpopup is
   active.
This commit is contained in:
Tom Dewey tom.dewey@raspberrypi.com 2023-10-10 13:13:44 +01:00
parent 758853e8a8
commit bcdee1818d

View file

@ -14,9 +14,9 @@ ApplicationWindow {
id: window id: window
visible: true visible: true
width: imageWriter.isEmbeddedMode() ? -1 : 730 width: imageWriter.isEmbeddedMode() ? -1 : 680
height: imageWriter.isEmbeddedMode() ? -1 : 450 height: imageWriter.isEmbeddedMode() ? -1 : 450
minimumWidth: imageWriter.isEmbeddedMode() ? -1 : 730 minimumWidth: imageWriter.isEmbeddedMode() ? -1 : 680
minimumHeight: imageWriter.isEmbeddedMode() ? -1 : 420 minimumHeight: imageWriter.isEmbeddedMode() ? -1 : 420
title: qsTr("Raspberry Pi Imager v%1").arg(imageWriter.constantVersion()) title: qsTr("Raspberry Pi Imager v%1").arg(imageWriter.constantVersion())
@ -89,20 +89,22 @@ ApplicationWindow {
GridLayout { GridLayout {
id: gridLayout id: gridLayout
rowSpacing: 25 rowSpacing: 15
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 25 anchors.topMargin: 25
anchors.rightMargin: 50 anchors.rightMargin: 50
anchors.leftMargin: 50 anchors.leftMargin: 50
rows: 6 rows: 5
columns: 4 columns: 3
columnSpacing: 25 columnSpacing: 15
ColumnLayout { ColumnLayout {
id: columnLayout0 id: columnLayout0
spacing: 0 spacing: 0
Layout.row: 0
Layout.column: 0
Layout.fillWidth: true Layout.fillWidth: true
Text { Text {
@ -131,7 +133,7 @@ ApplicationWindow {
hwpopup.open() hwpopup.open()
hwlistview.currentItem.forceActiveFocus() hwlistview.currentItem.forceActiveFocus()
} }
Accessible.ignored: ospopup.visible || dstpopup.visible Accessible.ignored: ospopup.visible || dstpopup.visible || hwpopup.visible
Accessible.description: qsTr("Select this button to choose your target Raspberry Pi") Accessible.description: qsTr("Select this button to choose your target Raspberry Pi")
} }
} }
@ -139,6 +141,8 @@ ApplicationWindow {
ColumnLayout { ColumnLayout {
id: columnLayout1 id: columnLayout1
spacing: 0 spacing: 0
Layout.row: 0
Layout.column: 1
Layout.fillWidth: true Layout.fillWidth: true
Text { Text {
@ -166,7 +170,7 @@ ApplicationWindow {
ospopup.open() ospopup.open()
osswipeview.currentItem.forceActiveFocus() osswipeview.currentItem.forceActiveFocus()
} }
Accessible.ignored: ospopup.visible || dstpopup.visible Accessible.ignored: ospopup.visible || dstpopup.visible || hwpopup.visible
Accessible.description: qsTr("Select this button to change the operating system") Accessible.description: qsTr("Select this button to change the operating system")
} }
} }
@ -174,6 +178,8 @@ ApplicationWindow {
ColumnLayout { ColumnLayout {
id: columnLayout2 id: columnLayout2
spacing: 0 spacing: 0
Layout.row: 0
Layout.column: 2
Layout.fillWidth: true Layout.fillWidth: true
Text { Text {
@ -203,27 +209,25 @@ ApplicationWindow {
dstpopup.open() dstpopup.open()
dstlist.forceActiveFocus() dstlist.forceActiveFocus()
} }
Accessible.ignored: ospopup.visible || dstpopup.visible Accessible.ignored: ospopup.visible || dstpopup.visible || hwpopup.visible
Accessible.description: qsTr("Select this button to change the destination storage device") Accessible.description: qsTr("Select this button to change the destination storage device")
} }
} }
ColumnLayout { ColumnLayout {
spacing: 0 spacing: 0
Layout.row: 1
Layout.column: 2
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Text {
text: " "
Layout.preferredHeight: 17
Layout.preferredWidth: 100
}
ImButton { ImButton {
id: writebutton id: writebutton
text: qsTr("WRITE") text: qsTr("WRITE")
Layout.bottomMargin: 25
Layout.minimumHeight: 40 Layout.minimumHeight: 40
Layout.fillWidth: true Layout.fillWidth: true
Accessible.ignored: ospopup.visible || dstpopup.visible Accessible.ignored: ospopup.visible || dstpopup.visible || hwpopup.visible
Accessible.description: qsTr("Select this button to start writing the image") Accessible.description: qsTr("Select this button to start writing the image")
enabled: false enabled: false
onClicked: { onClicked: {
@ -242,7 +246,9 @@ ApplicationWindow {
ColumnLayout { ColumnLayout {
id: columnLayout3 id: columnLayout3
Layout.columnSpan: 4 Layout.columnSpan: 2
Layout.row: 1
Layout.column: 0
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Text { Text {
@ -254,9 +260,13 @@ ApplicationWindow {
visible: false visible: false
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true Layout.fillWidth: true
Layout.bottomMargin: 25
padding: 5
} }
ProgressBar { ProgressBar {
Layout.bottomMargin: 25
padding: 5
id: progressBar id: progressBar
Layout.fillWidth: true Layout.fillWidth: true
visible: false visible: false
@ -264,6 +274,8 @@ ApplicationWindow {
} }
ImButton { ImButton {
Layout.bottomMargin: 25
padding: 5
id: cancelwritebutton id: cancelwritebutton
text: qsTr("CANCEL WRITE") text: qsTr("CANCEL WRITE")
onClicked: { onClicked: {
@ -275,6 +287,8 @@ ApplicationWindow {
visible: false visible: false
} }
ImButton { ImButton {
Layout.bottomMargin: 25
padding: 5
id: cancelverifybutton id: cancelverifybutton
text: qsTr("CANCEL VERIFY") text: qsTr("CANCEL VERIFY")
onClicked: { onClicked: {