From 0c1b13b2f42141ebb29146dad776ba422e4a8396 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 23 May 2023 06:31:41 +1000 Subject: [PATCH 1/5] combine note, description textedit --- .../SettingsTabComponents/SettingsPane.qml | 54 +++++-------------- 1 file changed, 14 insertions(+), 40 deletions(-) diff --git a/resources/SettingsTabComponents/SettingsPane.qml b/resources/SettingsTabComponents/SettingsPane.qml index 4a45557f5..6df8a4561 100644 --- a/resources/SettingsTabComponents/SettingsPane.qml +++ b/resources/SettingsTabComponents/SettingsPane.qml @@ -234,10 +234,10 @@ Rectangle { property string _fieldName: "description" visible: !!selectedRowField(_fieldName) - Layout.rowSpan: 2 + Layout.rowSpan: parents.rows - 8 Layout.columnSpan: 1 Layout.preferredWidth: parent.colWidthLabel - Layout.preferredHeight: isLongTextField(_fieldName) ? 2 * parent.smallRowHeight : parent.smallRowHeight + Layout.preferredHeight: Math.max(1, parent.height - 8 * parent.smallRowHeight) sourceComponent: settingRowLabel } @@ -245,48 +245,12 @@ Rectangle { property string _fieldName: "description" visible: !!selectedRowField(_fieldName) - Layout.rowSpan: 2 + Layout.rowSpan: parents.rows - 8 Layout.columnSpan: parent.columns - 1 Layout.preferredWidth: parent.colWidthField - Layout.preferredHeight: isLongTextField(_fieldName) ? 2 * parent.smallRowHeight : parent.smallRowHeight - sourceComponent: settingRowText - } - - Loader { - property string _title: "Notes" - property string _fieldName: "notes" - - visible: !!selectedRowField(_fieldName) - Layout.columnSpan: 1 - Layout.rowSpan: parent.rows - 7 - Layout.preferredHeight: Math.max(1, parent.height - 7 * parent.smallRowHeight) - Layout.preferredWidth: parent.colWidthLabel - sourceComponent: settingRowLabel - } - - Loader { - id: notes - - property string _fieldName: "notes" - - visible: !!selectedRowField(_fieldName) - Layout.columnSpan: parent.columns - 1 - Layout.rowSpan: parent.rows - 8 Layout.preferredHeight: Math.max(1, parent.height - 8 * parent.smallRowHeight) - Layout.preferredWidth: parent.colWidthField sourceComponent: settingRowText } - - Loader { - property string _fieldName: "notes" - - visible: !notes.visible - Layout.columnSpan: parent.columns - Layout.rowSpan: parent.rows - 8 - Layout.fillHeight: true - Layout.fillWidth: true - sourceComponent: emptyRow - } } ScrollBar.vertical: ScrollBar { @@ -326,7 +290,17 @@ Rectangle { anchors.fill: parent TextEdit { - text: selectedRowField(_fieldName) + text: { + if (_fieldName == "description") { + let desc = selectedRowField("description"); + let notes = selectedRowField("notes"); + if (notes) + return desc + "\n\nNotes:\n" + notes; + + return notes; + } + return selectedRowField(_fieldName); + } anchors.fill: parent wrapMode: Text.WordWrap readOnly: true From 4393bb0dd74caf2344aec023fbe1a5a0b1a7fdf1 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 23 May 2023 06:32:46 +1000 Subject: [PATCH 2/5] oops --- resources/SettingsTabComponents/SettingsPane.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/SettingsTabComponents/SettingsPane.qml b/resources/SettingsTabComponents/SettingsPane.qml index 6df8a4561..5bcc51fe3 100644 --- a/resources/SettingsTabComponents/SettingsPane.qml +++ b/resources/SettingsTabComponents/SettingsPane.qml @@ -297,7 +297,7 @@ Rectangle { if (notes) return desc + "\n\nNotes:\n" + notes; - return notes; + return desc; } return selectedRowField(_fieldName); } From 1988ca49e5e929827e3821e94b073e9368399441 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 23 May 2023 06:33:08 +1000 Subject: [PATCH 3/5] title --- console_backend/src/status_bar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console_backend/src/status_bar.rs b/console_backend/src/status_bar.rs index 6c00fe6b1..21e3dbad1 100644 --- a/console_backend/src/status_bar.rs +++ b/console_backend/src/status_bar.rs @@ -183,7 +183,7 @@ impl StatusBar { status_bar_status.set_data_rate(sb_update.data_rate); status_bar_status.set_solid_connection(sb_update.solid_connection); status_bar_status.set_title(&format!( - "{} Swift Console {}", + "{} - Swift Console {}", sb_update.port, sb_update.version )); client_sender.send_data(serialize_capnproto_builder(builder)); From c93b7f5b1d0099b8ab09f8d9e9d313c34918fcc2 Mon Sep 17 00:00:00 2001 From: Jason Mobarak Date: Mon, 22 May 2023 14:16:23 -0700 Subject: [PATCH 4/5] Update SettingsPane.qml --- resources/SettingsTabComponents/SettingsPane.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/SettingsTabComponents/SettingsPane.qml b/resources/SettingsTabComponents/SettingsPane.qml index 5bcc51fe3..e65216faf 100644 --- a/resources/SettingsTabComponents/SettingsPane.qml +++ b/resources/SettingsTabComponents/SettingsPane.qml @@ -296,7 +296,6 @@ Rectangle { let notes = selectedRowField("notes"); if (notes) return desc + "\n\nNotes:\n" + notes; - return desc; } return selectedRowField(_fieldName); From cae0e7f0605b34f812dd9f321529634e183c9fdd Mon Sep 17 00:00:00 2001 From: adrian-kong <35755741+adrian-kong@users.noreply.github.com> Date: Tue, 23 May 2023 11:35:58 +1000 Subject: [PATCH 5/5] title-dash only when connected (#1056) * title-dash? * Update console_backend/src/status_bar.rs Co-authored-by: Jason Mobarak * clippy * clippy --------- Co-authored-by: Jason Mobarak --- console_backend/src/status_bar.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/console_backend/src/status_bar.rs b/console_backend/src/status_bar.rs index 21e3dbad1..3e180e765 100644 --- a/console_backend/src/status_bar.rs +++ b/console_backend/src/status_bar.rs @@ -182,10 +182,12 @@ impl StatusBar { status_bar_status.set_ins(&sb_update.ins_status); status_bar_status.set_data_rate(sb_update.data_rate); status_bar_status.set_solid_connection(sb_update.solid_connection); - status_bar_status.set_title(&format!( - "{} - Swift Console {}", - sb_update.port, sb_update.version - )); + let port = if sb_update.port.is_empty() { + "".to_string() + } else { + sb_update.port + " - " + }; + status_bar_status.set_title(&format!("{port}Swift Console {}", sb_update.version)); client_sender.send_data(serialize_capnproto_builder(builder)); }