Skip to content

Commit 0c42f17

Browse files
committed
QML layout fixes
Declare some widths/heights correctly, fix some resizing issues.
1 parent 4331b5c commit 0c42f17

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

qml/ConfigPageDebug.qml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ColumnLayout {
1515
}
1616

1717
FBLabel {
18-
Layout.maximumWidth: parent.width
18+
Layout.fillWidth: true
1919
wrapMode: Text.WordWrap
2020
text: qsTr("If enabled, a remote GDB debugger can be connected to the port and be used for debugging.")
2121
font.pixelSize: TextMetrics.normalSize
@@ -55,7 +55,7 @@ ColumnLayout {
5555
}
5656

5757
FBLabel {
58-
Layout.maximumWidth: parent.width
58+
Layout.fillWidth: true
5959
text: qsTr("Remote access to internal debugger")
6060
wrapMode: Text.WordWrap
6161
font.pixelSize: TextMetrics.title2Size
@@ -64,7 +64,7 @@ ColumnLayout {
6464
}
6565

6666
FBLabel {
67-
Layout.maximumWidth: parent.width
67+
Layout.fillWidth: true
6868
wrapMode: Text.WordWrap
6969
text: qsTr("Enable this to access the internal debugger via TCP (telnet/netcat), like for firebird-send.")
7070
font.pixelSize: TextMetrics.normalSize
@@ -73,7 +73,6 @@ ColumnLayout {
7373
RowLayout {
7474
// No spacing so that the spin box looks like part of the label
7575
spacing: 0
76-
width: parent.width
7776
Layout.fillWidth: true
7877

7978
CheckBox {
@@ -111,14 +110,14 @@ ColumnLayout {
111110
}
112111

113112
FBLabel {
114-
Layout.maximumWidth: parent.width
113+
Layout.fillWidth: true
115114
wrapMode: Text.WordWrap
116115
text: qsTr("Configure which situations cause the emulator to trap into the debugger.")
117116
font.pixelSize: TextMetrics.normalSize
118117
}
119118

120119
CheckBox {
121-
Layout.maximumWidth: parent.width
120+
Layout.fillWidth: true
122121
text: qsTr("Enter Debugger on Startup")
123122

124123
checked: Emu.debugOnStart
@@ -129,7 +128,7 @@ ColumnLayout {
129128
}
130129

131130
CheckBox {
132-
Layout.maximumWidth: parent.width
131+
Layout.fillWidth: true
133132
text: qsTr("Enter Debugger on Warnings and Errors")
134133

135134
checked: Emu.debugOnWarn
@@ -140,7 +139,7 @@ ColumnLayout {
140139
}
141140

142141
CheckBox {
143-
Layout.maximumWidth: parent.width
142+
Layout.fillWidth: true
144143
text: qsTr("Print a message on Warnings")
145144

146145
enabled: !Emu.debugOnWarn

qml/ConfigPageFileTransfer.qml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ ColumnLayout {
1616
}
1717

1818
FBLabel {
19-
Layout.maximumWidth: parent.width
19+
Layout.fillWidth: true
2020
wrapMode: Text.WordWrap
2121
text: qsTr("If you are unable to use the main window's file transfer using either drag'n'drop or the file explorer, you can send single files here.")
2222
font.pixelSize: TextMetrics.normalSize
2323
visible: !Emu.isMobile()
2424
}
2525

2626
FBLabel {
27-
Layout.maximumWidth: parent.width
27+
Layout.fillWidth: true
2828
wrapMode: Text.WordWrap
2929
text: qsTr("Here you can send single files into the target folder specified below.")
3030
font.pixelSize: TextMetrics.normalSize
@@ -44,7 +44,7 @@ ColumnLayout {
4444
}
4545

4646
RowLayout {
47-
Layout.maximumWidth: parent.width
47+
Layout.fillWidth: true
4848

4949
Button {
5050
text: qsTr("Send a file")
@@ -111,20 +111,23 @@ ColumnLayout {
111111
}
112112

113113
FBLabel {
114-
Layout.maximumWidth: parent.width
114+
Layout.fillWidth: true
115115
wrapMode: Text.WordWrap
116116
text: qsTr("When dragging files onto Firebird, it will try to send the file to the emulated system.")
117117
font.pixelSize: TextMetrics.normalSize
118118
}
119119

120120
RowLayout {
121-
width: parent.width
121+
Layout.fillWidth: true
122122

123123
FBLabel {
124+
Layout.fillWidth: true
124125
text: qsTr("Target folder for dropped files:")
126+
wrapMode: Text.WordWrap
125127
}
126128

127129
TextField {
130+
Layout.fillWidth: true
128131
text: Emu.usbdir
129132
onTextChanged: {
130133
Emu.usbdir = text
@@ -136,5 +139,4 @@ ColumnLayout {
136139
Item {
137140
Layout.fillHeight: true
138141
}
139-
140142
}

qml/ConfigPageKits.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ColumnLayout {
2525

2626
GroupBox {
2727
Layout.fillWidth: true
28+
Layout.minimumWidth: contentItem.Layout.minimumWidth
2829
Layout.bottomMargin: -1
2930
title: qsTr("Kit Properties")
3031

qml/Firebird/UIComponents/FileSelect.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ RowLayout {
4040
elide: "ElideRight"
4141

4242
Layout.fillWidth: true
43+
// Allow the label to shrink below its implicitWidth.
44+
// Without this, the layout doesn't allow it to go smaller...
45+
Layout.preferredWidth: 100
4346

4447
font.italic: filePath === ""
4548
text: filePath === "" ? qsTr("(none)") : Emu.basename(filePath)

qml/Firebird/UIComponents/KitList.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ Rectangle {
4242

4343
height: item.height + 10
4444
width: listView.width - listView.anchors.margins
45-
anchors.horizontalCenter: parent.horizontalCenter
4645

4746
MouseArea {
4847
anchors.fill: parent

0 commit comments

Comments
 (0)