@@ -168,141 +168,156 @@ MainTab {
168
168
SplitView .minimumWidth : parent .width * 0.55
169
169
spacing: 0
170
170
171
- GridLayout {
172
- property int colWidth: Math .max (Constants .settingsTab .buttonIconWidth , ((parent .width / (columns)) - columnSpacing * (columns)))
173
- property int buttonPadding: 3
174
-
171
+ Item {
175
172
Layout .fillWidth : true
176
- rowSpacing: 0
177
- columnSpacing: 2
178
- columns: 5
179
- rows: 2
180
- enabled: settingsTable .settingsHealthy
181
-
182
- SwiftButton {
183
- Layout .columnSpan : 1
184
- Layout .rowSpan : 1
185
- Layout .preferredWidth : parent .colWidth
186
- Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
187
- padding: parent .buttonPadding
188
- text: " Save to\n Device"
189
- icon .source : Constants .icons .savePath
190
- icon .width : Constants .settingsTab .buttonIconWidth
191
- icon .height : Constants .settingsTab .buttonIconHeight
192
- display: AbstractButton .TextUnderIcon
193
- flat: true
194
- onClicked: data_model .settings_save_request ()
195
- }
173
+ Layout .preferredHeight : grid .implicitHeight
196
174
197
- SwiftButton {
198
- Layout .columnSpan : 1
199
- Layout .rowSpan : 1
200
- Layout .preferredWidth : parent .colWidth
201
- Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
202
- padding: parent .buttonPadding
203
- text: " Export to\n file"
204
- icon .source : Constants .icons .exportPath
205
- icon .width : Constants .settingsTab .buttonIconWidth
206
- icon .height : Constants .settingsTab .buttonIconHeight
207
- display: AbstractButton .TextUnderIcon
208
- flat: true
209
- onClicked: exportDialog .visible = true
175
+ MouseArea {
176
+ anchors .fill : parent
177
+ onClicked: saveButton .forceActiveFocus ()
210
178
}
211
179
212
- SwiftButton {
213
- Layout .columnSpan : 1
214
- Layout .rowSpan : 1
215
- Layout .preferredWidth : parent .colWidth
216
- Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
217
- padding: parent .buttonPadding
218
- text: " Import from\n File"
219
- icon .source : Constants .icons .importPath
220
- icon .width : Constants .settingsTab .buttonIconWidth
221
- icon .height : Constants .settingsTab .buttonIconHeight
222
- display: AbstractButton .TextUnderIcon
223
- flat: true
224
- onClicked: importDialog .visible = true
225
- }
180
+ GridLayout {
181
+ id: grid
182
+
183
+ property int colWidth: Math .max (Constants .settingsTab .buttonIconWidth , ((parent .width / (columns)) - columnSpacing * (columns)))
184
+ property int buttonPadding: 3
185
+
186
+ anchors .fill : parent
187
+ rowSpacing: 0
188
+ columnSpacing: 2
189
+ columns: 5
190
+ rows: 2
191
+ enabled: settingsTable .settingsHealthy
192
+
193
+ SwiftButton {
194
+ id: saveButton
195
+
196
+ Layout .columnSpan : 1
197
+ Layout .rowSpan : 1
198
+ Layout .preferredWidth : parent .colWidth
199
+ Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
200
+ padding: parent .buttonPadding
201
+ text: " Save to\n Device"
202
+ icon .source : Constants .icons .savePath
203
+ icon .width : Constants .settingsTab .buttonIconWidth
204
+ icon .height : Constants .settingsTab .buttonIconHeight
205
+ display: AbstractButton .TextUnderIcon
206
+ flat: true
207
+ onClicked: data_model .settings_save_request ()
208
+ }
226
209
227
- SwiftButton {
228
- Layout .columnSpan : 1
229
- Layout .rowSpan : 1
230
- Layout .preferredWidth : parent .colWidth
231
- Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
232
- padding: parent .buttonPadding
233
- text: " Reset to\n Defaults"
234
- icon .source : Constants .icons .warningPath
235
- icon .width : Constants .settingsTab .buttonIconWidth
236
- icon .height : Constants .settingsTab .buttonIconHeight
237
- display: AbstractButton .TextUnderIcon
238
- flat: true
239
- onClicked: resetDialog .visible = true
240
- }
210
+ SwiftButton {
211
+ Layout .columnSpan : 1
212
+ Layout .rowSpan : 1
213
+ Layout .preferredWidth : parent .colWidth
214
+ Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
215
+ padding: parent .buttonPadding
216
+ text: " Export to\n file"
217
+ icon .source : Constants .icons .exportPath
218
+ icon .width : Constants .settingsTab .buttonIconWidth
219
+ icon .height : Constants .settingsTab .buttonIconHeight
220
+ display: AbstractButton .TextUnderIcon
221
+ flat: true
222
+ onClicked: exportDialog .visible = true
223
+ }
224
+
225
+ SwiftButton {
226
+ Layout .columnSpan : 1
227
+ Layout .rowSpan : 1
228
+ Layout .preferredWidth : parent .colWidth
229
+ Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
230
+ padding: parent .buttonPadding
231
+ text: " Import from\n File"
232
+ icon .source : Constants .icons .importPath
233
+ icon .width : Constants .settingsTab .buttonIconWidth
234
+ icon .height : Constants .settingsTab .buttonIconHeight
235
+ display: AbstractButton .TextUnderIcon
236
+ flat: true
237
+ onClicked: importDialog .visible = true
238
+ }
239
+
240
+ SwiftButton {
241
+ Layout .columnSpan : 1
242
+ Layout .rowSpan : 1
243
+ Layout .preferredWidth : parent .colWidth
244
+ Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
245
+ padding: parent .buttonPadding
246
+ text: " Reset to\n Defaults"
247
+ icon .source : Constants .icons .warningPath
248
+ icon .width : Constants .settingsTab .buttonIconWidth
249
+ icon .height : Constants .settingsTab .buttonIconHeight
250
+ display: AbstractButton .TextUnderIcon
251
+ flat: true
252
+ onClicked: resetDialog .visible = true
253
+ }
241
254
242
- SwiftButton {
243
- id: autoSurveyButton
244
-
245
- property bool buttonEnabled: (selectedRowField (" group" ) === " surveyed_position" )
246
-
247
- Layout .columnSpan : 1
248
- Layout .rowSpan : 1
249
- Layout .preferredWidth : parent .colWidth
250
- Layout .preferredHeight : refreshButton .height
251
- Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
252
- ToolTip .text : " Select element under \' surveyed_position\' group to enable."
253
- ToolTip .visible : ! buttonEnabled && hovered
254
- background .visible : buttonEnabled
255
- padding: parent .buttonPadding
256
- text: " Auto Survey\n "
257
- opacity: buttonEnabled ? 1 : 0.5
258
- icon .source : Constants .icons .centerOnButtonUrl
259
- icon .width : Constants .settingsTab .buttonIconWidth
260
- icon .height : Constants .settingsTab .buttonIconHeight
261
- display: AbstractButton .TextUnderIcon
262
- flat: true
263
- onClicked: {
264
- if (buttonEnabled)
265
- autoSurveyDialog .visible = true ;
255
+ SwiftButton {
256
+ id: autoSurveyButton
257
+
258
+ property bool buttonEnabled: (selectedRowField (" group" ) === " surveyed_position" )
259
+
260
+ Layout .columnSpan : 1
261
+ Layout .rowSpan : 1
262
+ Layout .preferredWidth : parent .colWidth
263
+ Layout .preferredHeight : refreshButton .height
264
+ Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
265
+ ToolTip .text : " Select element under \' surveyed_position\' group to enable."
266
+ ToolTip .visible : ! buttonEnabled && hovered
267
+ background .visible : buttonEnabled
268
+ padding: parent .buttonPadding
269
+ text: " Auto Survey\n "
270
+ opacity: buttonEnabled ? 1 : 0.5
271
+ icon .source : Constants .icons .centerOnButtonUrl
272
+ icon .width : Constants .settingsTab .buttonIconWidth
273
+ icon .height : Constants .settingsTab .buttonIconHeight
274
+ display: AbstractButton .TextUnderIcon
275
+ flat: true
276
+ onClicked: {
277
+ if (buttonEnabled)
278
+ autoSurveyDialog .visible = true ;
266
279
280
+ }
267
281
}
268
- }
269
282
270
- SwiftButton {
271
- id: refreshButton
272
-
273
- Layout .columnSpan : 1
274
- Layout .rowSpan : 1
275
- Layout .preferredWidth : parent .colWidth
276
- Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
277
- padding: parent .buttonPadding
278
- text: " Refresh from\n device"
279
- icon .source : Constants .icons .refreshPath
280
- icon .width : Constants .settingsTab .buttonIconWidth
281
- icon .height : Constants .settingsTab .buttonIconHeight
282
- display: AbstractButton .TextUnderIcon
283
- flat: true
284
- onClicked: data_model .settings_refresh ()
285
- }
283
+ SwiftButton {
284
+ id: refreshButton
285
+
286
+ Layout .columnSpan : 1
287
+ Layout .rowSpan : 1
288
+ Layout .preferredWidth : parent .colWidth
289
+ Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
290
+ padding: parent .buttonPadding
291
+ text: " Refresh from\n device"
292
+ icon .source : Constants .icons .refreshPath
293
+ icon .width : Constants .settingsTab .buttonIconWidth
294
+ icon .height : Constants .settingsTab .buttonIconHeight
295
+ display: AbstractButton .TextUnderIcon
296
+ flat: true
297
+ onClicked: data_model .settings_refresh ()
298
+ }
286
299
287
- SmallCheckBox {
288
- Layout .columnSpan : 1
289
- Layout .rowSpan : 1
290
- Layout .preferredWidth : parent .colWidth
291
- Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
292
- padding: parent .buttonPadding
293
- bottomPadding: refreshButton .bottomPadding
294
- text: " SHOW ADVANCED SETTINGS"
295
- font .pointSize : refreshButton .font .pointSize
296
- font .family : Constants .fontFamily
297
- font .bold : false
298
- onClicked: {
299
- if (this .enabled ) {
300
- this .enabled = false ;
301
- settingsTable .showExpert = checked;
302
- settingsTable .selectedRowIdx = - 1 ;
303
- this .enabled = true ;
300
+ SmallCheckBox {
301
+ Layout .columnSpan : 1
302
+ Layout .rowSpan : 1
303
+ Layout .preferredWidth : parent .colWidth
304
+ Layout .alignment : Qt .AlignHCenter | Qt .AlignVCenter
305
+ padding: parent .buttonPadding
306
+ bottomPadding: refreshButton .bottomPadding
307
+ text: " SHOW ADVANCED SETTINGS"
308
+ font .pointSize : refreshButton .font .pointSize
309
+ font .family : Constants .fontFamily
310
+ font .bold : false
311
+ onClicked: {
312
+ if (this .enabled ) {
313
+ this .enabled = false ;
314
+ settingsTable .showExpert = checked;
315
+ settingsTable .selectedRowIdx = - 1 ;
316
+ this .enabled = true ;
317
+ }
304
318
}
305
319
}
320
+
306
321
}
307
322
308
323
}
0 commit comments