From c6cf5a0faba663f4770d09ea001e38c96679ca9c Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Wed, 27 Aug 2025 14:46:19 -0400 Subject: [PATCH] Bar UI improvements - better rounding at low scaling, for accurate vertical centering - use fixed font bar system monitor - use bold for workspaces name --- Modules/Bar/Bar.qml | 2 +- Modules/Bar/Widgets/ActiveWindow.qml | 3 ++- Modules/Bar/Widgets/MediaMini.qml | 12 +++--------- Modules/Bar/Widgets/SystemMonitor.qml | 3 +++ Modules/Bar/Widgets/Workspace.qml | 3 ++- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Modules/Bar/Bar.qml b/Modules/Bar/Bar.qml index fd6ef21..fe74419 100644 --- a/Modules/Bar/Bar.qml +++ b/Modules/Bar/Bar.qml @@ -26,7 +26,7 @@ Variants { WlrLayershell.namespace: "noctalia-bar" - implicitHeight: Style.barHeight * scaling + implicitHeight: Math.round(Style.barHeight * scaling) color: Color.transparent anchors { diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index ed4613d..ae9c9f0 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -88,7 +88,8 @@ Row { // Fix collapsed width to 120px to avoid layout shifts with neighbors // Expand up to 400px on hover - width: mouseArea.containsMouse ? Math.min(Math.max(minWidth * scaling, fullTitleMetrics.contentWidth), 400 * scaling) : minWidth * scaling + width: mouseArea.containsMouse ? Math.min(Math.max(minWidth * scaling, fullTitleMetrics.contentWidth), + 400 * scaling) : minWidth * scaling horizontalAlignment: Text.AlignLeft text: getTitle() font.pointSize: Style.fontSizeS * scaling diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 744f6f8..f3b6897 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -113,20 +113,14 @@ Row { anchors.verticalCenter: parent.verticalCenter visible: Settings.data.audio.showMiniplayerAlbumArt - Rectangle { - width: 18 * scaling - height: 18 * scaling - radius: width * 0.5 - color: Color.transparent - antialiasing: true - clip: true + Item { + width: Math.round(18 * scaling) + height: Math.round(18 * scaling) NImageCircled { id: trackArt visible: MediaService.trackArtUrl.toString() !== "" anchors.fill: parent - anchors.verticalCenter: parent.verticalCenter - anchors.margins: scaling imagePath: MediaService.trackArtUrl fallbackIcon: MediaService.isPlaying ? "pause" : "play_arrow" borderWidth: 0 diff --git a/Modules/Bar/Widgets/SystemMonitor.qml b/Modules/Bar/Widgets/SystemMonitor.qml index 610a940..43cddf0 100644 --- a/Modules/Bar/Widgets/SystemMonitor.qml +++ b/Modules/Bar/Widgets/SystemMonitor.qml @@ -46,6 +46,7 @@ Row { NText { id: cpuUsageText text: `${SystemStatService.cpuUsage}%` + font.family: Settings.data.ui.fontFixed font.pointSize: Style.fontSizeS * scaling font.weight: Style.fontWeightMedium anchors.verticalCenter: parent.verticalCenter @@ -67,6 +68,7 @@ Row { NText { text: `${SystemStatService.cpuTemp}°C` + font.family: Settings.data.ui.fontFixed font.pointSize: Style.fontSizeS * scaling font.weight: Style.fontWeightMedium anchors.verticalCenter: parent.verticalCenter @@ -87,6 +89,7 @@ Row { NText { text: `${SystemStatService.memoryUsageGb}G` + font.family: Settings.data.ui.fontFixed font.pointSize: Style.fontSizeS * scaling font.weight: Style.fontWeightMedium anchors.verticalCenter: parent.verticalCenter diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index 3a75800..a9bef1e 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -152,7 +152,7 @@ Item { model: localWorkspaces Item { id: workspacePillContainer - height: (Settings.data.bar.showWorkspaceLabel !== "none") ? 18 * scaling : 14 * scaling + height: (Settings.data.bar.showWorkspaceLabel !== "none") ? Math.round(18 * scaling) : Math.round(14 * scaling) width: root.calculatedWsWidth(model) Rectangle { @@ -177,6 +177,7 @@ Item { font.pointSize: model.isFocused ? Style.fontSizeXS * scaling : Style.fontSizeXXS * scaling font.capitalization: Font.AllUppercase font.family: Settings.data.ui.fontFixed + font.weight: Style.fontWeightBold wrapMode: Text.Wrap color: { if (model.isFocused)