diff --git a/ui/qml/Main.qml b/ui/qml/Main.qml index 0c37888..6f6e7b3 100644 --- a/ui/qml/Main.qml +++ b/ui/qml/Main.qml @@ -90,16 +90,19 @@ ApplicationWindow { id: settingsDialog } + // Reference font size for scalable UI + readonly property int baseFontSize: theme.fontSize > 0 ? theme.fontSize : 12 + header: ToolBar { background: Rectangle { color: theme.buttonColor } RowLayout { anchors.fill: parent - anchors.leftMargin: 12 - anchors.rightMargin: 12 + anchors.leftMargin: root.baseFontSize + anchors.rightMargin: root.baseFontSize Label { text: "orkmode" color: theme.buttonTextColor - font.pixelSize: 16 + font.pointSize: root.baseFontSize + 2 font.bold: true } Item { Layout.fillWidth: true } @@ -108,7 +111,7 @@ ApplicationWindow { ? "● " + orkClient.address : "○ disconnected" color: orkClient.connected ? theme.doneColor : theme.deadlineColor - font.pixelSize: 12 + font.pointSize: root.baseFontSize - 1 } ToolButton { text: "⟳" @@ -131,7 +134,7 @@ ApplicationWindow { // Document sidebar. Rectangle { - Layout.preferredWidth: 220 + Layout.preferredWidth: root.baseFontSize * 16 Layout.fillHeight: true color: theme.baseColor @@ -142,9 +145,9 @@ ApplicationWindow { Label { text: qsTr("Documents") color: theme.placeholderTextColor - font.pixelSize: 11 + font.pointSize: root.baseFontSize - 1 font.bold: true - Layout.margins: 10 + Layout.margins: root.baseFontSize * 0.8 } ListView { @@ -158,23 +161,27 @@ ApplicationWindow { width: docList.width highlighted: root.currentDoc === modelData.name onClicked: root.selectDoc(modelData.name) + leftPadding: root.baseFontSize * 0.8 + rightPadding: root.baseFontSize * 0.8 + topPadding: root.baseFontSize * 0.4 + bottomPadding: root.baseFontSize * 0.4 background: Rectangle { color: highlighted ? theme.highlightColor : "transparent" opacity: highlighted ? 0.3 : 1.0 } contentItem: ColumnLayout { - spacing: 1 + spacing: root.baseFontSize * 0.15 Label { text: modelData.title color: theme.textColor - font.pixelSize: 13 + font.pointSize: root.baseFontSize elide: Text.ElideRight Layout.fillWidth: true } Label { text: modelData.name color: theme.placeholderTextColor - font.pixelSize: 10 + font.pointSize: root.baseFontSize - 2 elide: Text.ElideRight Layout.fillWidth: true } @@ -193,7 +200,7 @@ ApplicationWindow { OutlineView { anchors.fill: parent - anchors.margins: 8 + anchors.margins: root.baseFontSize * 0.6 model: docModel } @@ -204,7 +211,7 @@ ApplicationWindow { ? qsTr("Select a document") : qsTr("Not connected: %1").arg(orkClient.error) color: theme.placeholderTextColor - font.pixelSize: 14 + font.pointSize: root.baseFontSize + 1 } } }