From d077477ced2f546b7864f918cc9d4b8289c4ff9b Mon Sep 17 00:00:00 2001 From: Ewerton Mattos Date: Wed, 14 Oct 2026 20:53:26 -0300 Subject: [PATCH] fix(settings): show the configured model in the sidebar The sidebar's model pill was the hard-coded string "Qwen3-1.7B", which isn't even XType's default model (qwen2.5:1.5b). It now binds to Config.model, so it reflects config.toml and updates as soon as a model is chosen on the Model page. The row's spacer also subtracted the pill's own text width instead of the "Model" caption, so the pill sat mid-row rather than right-aligned. It is right-aligned now, and long Ollama tags (hf.co/...:Q4_K_M) elide instead of overflowing the sidebar. Co-Authored-By: Claude Opus 5.5 --- settings/qt6-app/qml/primitives/XSidebar.qml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/settings/qt6-app/qml/primitives/XSidebar.qml b/settings/qt6-app/qml/primitives/XSidebar.qml index a2570c8..bded6ee 100644 --- a/settings/qt6-app/qml/primitives/XSidebar.qml +++ b/settings/qt6-app/qml/primitives/XSidebar.qml @@ -112,6 +112,7 @@ Item { width: parent.width spacing: 4 Text { + id: modelCaption text: "Model" font.family: Theme.sansFamily; font.pixelSize: 10 font.capitalization: Font.AllUppercase @@ -119,11 +120,13 @@ Item { renderType: Text.NativeRendering anchors.verticalCenter: parent.verticalCenter } - Item { width: parent.width - modelLabel.implicitWidth - modelPill.implicitWidth - 8; height: 1 } + Item { width: Math.max(0, parent.width - modelCaption.implicitWidth - modelPill.width - 8); height: 1 } Rectangle { id: modelPill radius: 999 - implicitWidth: modelLabel.implicitWidth + 14 + // Long Ollama tags (e.g. hf.co/…:Q4_K_M) elide instead of overflowing the sidebar. + // At max width the spacer is 0 px and Row skips it, leaving one 4 px gap. + width: Math.min(modelLabel.implicitWidth + 14, parent.width - modelCaption.implicitWidth - 4) implicitHeight: modelLabel.implicitHeight + 4 color: "transparent" border.color: Qt.rgba(0.655, 0.545, 0.980, 0.18) @@ -131,7 +134,9 @@ Item { Text { id: modelLabel anchors.centerIn: parent - text: "Qwen3-1.7B" + width: Math.min(implicitWidth, modelPill.width - 14) + elide: Text.ElideRight + text: Config.model font.family: Theme.monoFamily; font.pixelSize: 10 color: Theme.purpleSoft renderType: Text.NativeRendering