Skip to content

Commit 83e04ed

Browse files
authored
combine note, description textedit [CPP-937] (#1050)
1 parent 450c847 commit 83e04ed

File tree

1 file changed

+14
-40
lines changed

1 file changed

+14
-40
lines changed

resources/SettingsTabComponents/SettingsPane.qml

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -217,60 +217,24 @@ Rectangle {
217217
property string _fieldName: "description"
218218

219219
visible: !!selectedRowField(_fieldName)
220-
Layout.rowSpan: 2
220+
Layout.rowSpan: parent.rows - 8
221221
Layout.columnSpan: 1
222222
Layout.preferredWidth: parent.colWidthLabel
223-
Layout.preferredHeight: isLongTextField(_fieldName) ? 2 * parent.smallRowHeight : parent.smallRowHeight
223+
Layout.preferredHeight: Math.max(1, parent.height - 8 * parent.smallRowHeight)
224224
sourceComponent: settingRowLabel
225225
}
226226

227227
Loader {
228228
property string _fieldName: "description"
229229

230230
visible: !!selectedRowField(_fieldName)
231-
Layout.rowSpan: 2
231+
Layout.rowSpan: parent.rows - 8
232232
Layout.columnSpan: parent.columns - 1
233233
Layout.preferredWidth: parent.colWidthField
234-
Layout.preferredHeight: isLongTextField(_fieldName) ? 2 * parent.smallRowHeight : parent.smallRowHeight
235-
sourceComponent: settingRowText
236-
}
237-
238-
Loader {
239-
property string _title: "Notes"
240-
property string _fieldName: "notes"
241-
242-
visible: !!selectedRowField(_fieldName)
243-
Layout.columnSpan: 1
244-
Layout.rowSpan: parent.rows - 7
245-
Layout.preferredHeight: Math.max(1, parent.height - 7 * parent.smallRowHeight)
246-
Layout.preferredWidth: parent.colWidthLabel
247-
sourceComponent: settingRowLabel
248-
}
249-
250-
Loader {
251-
id: notes
252-
253-
property string _fieldName: "notes"
254-
255-
visible: !!selectedRowField(_fieldName)
256-
Layout.columnSpan: parent.columns - 1
257-
Layout.rowSpan: parent.rows - 8
258234
Layout.preferredHeight: Math.max(1, parent.height - 8 * parent.smallRowHeight)
259-
Layout.preferredWidth: parent.colWidthField
260235
sourceComponent: settingRowText
261236
}
262237

263-
Loader {
264-
property string _fieldName: "notes"
265-
266-
visible: !notes.visible
267-
Layout.columnSpan: parent.columns
268-
Layout.rowSpan: parent.rows - 8
269-
Layout.fillHeight: true
270-
Layout.fillWidth: true
271-
sourceComponent: emptyRow
272-
}
273-
274238
}
275239

276240
ScrollBar.vertical: ScrollBar {
@@ -314,7 +278,17 @@ Rectangle {
314278
anchors.fill: parent
315279

316280
TextEdit {
317-
text: selectedRowField(_fieldName)
281+
text: {
282+
if (_fieldName == "description") {
283+
let desc = selectedRowField("description");
284+
let notes = selectedRowField("notes");
285+
if (notes)
286+
return desc + "\n\nNotes:\n" + notes;
287+
288+
return notes;
289+
}
290+
return selectedRowField(_fieldName);
291+
}
318292
anchors.fill: parent
319293
wrapMode: Text.WordWrap
320294
readOnly: true

0 commit comments

Comments
 (0)