Different scaling for Bar and Panels

This commit is contained in:
ItsLemmy
2025-10-12 15:48:52 -04:00
parent a2cd377837
commit 9f54822e4c
14 changed files with 47 additions and 16 deletions

View File

@@ -51,7 +51,7 @@ Singleton {
property int marginL: Math.round(13 * uiScaleRatio)
property int marginXL: Math.round(18 * uiScaleRatio)
property real uiScaleRatio: 0.8
property real uiScaleRatio: 1.2
// Opacity
property real opacityNone: 0.0

View File

@@ -11,8 +11,8 @@ import qs.Widgets
NPanel {
id: root
preferredWidth: 380
preferredHeight: 500
preferredWidth: 380 * Style.uiScaleRatio
preferredHeight: 500 * Style.uiScaleRatio
panelKeyboardFocus: true
panelContent: Rectangle {

View File

@@ -10,8 +10,8 @@ import qs.Widgets
NPanel {
id: root
preferredWidth: Settings.data.location.showWeekNumberInCalendar ? 400 : 380
preferredHeight: 520
preferredWidth: (Settings.data.location.showWeekNumberInCalendar ? 400 : 380) * Style.uiScaleRatio
preferredHeight: 520 * Style.uiScaleRatio
panelContent: ColumnLayout {
id: content
@@ -55,7 +55,7 @@ NPanel {
// Combined layout for weather icon, date, and weather text
RowLayout {
Layout.fillWidth: true
height: 60
height: 60 * Style.uiScaleRatio
clip: true
spacing: Style.marginS
@@ -119,7 +119,7 @@ NPanel {
// Month, year, location
ColumnLayout {
Layout.preferredWidth: 170
Layout.preferredWidth: 170 * Style.uiScaleRatio
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.bottomMargin: Style.marginXXS
Layout.topMargin: -Style.marginXXS
@@ -186,7 +186,7 @@ NPanel {
anchors.right: parent.right
anchors.rightMargin: Style.marginM
anchors.verticalCenter: parent.verticalCenter
height: Math.round((Style.fontSizeXXXL * 1.9) / 2) * 2
height: Math.round((Style.fontSizeXXXL * 1.9) / 2 * Style.uiScaleRatio) * 2
width: clockItem.height
// Seconds circular progress

View File

@@ -90,6 +90,7 @@ Item {
text: root.text + root.suffix
family: Settings.data.ui.fontFixed
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightBold
color: forceOpen ? Color.mOnSurface : Color.mPrimary
visible: revealed

View File

@@ -102,6 +102,7 @@ Item {
text: root.text + root.suffix
family: Settings.data.ui.fontFixed
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter

View File

@@ -10,8 +10,8 @@ import qs.Widgets
NPanel {
id: root
preferredWidth: 400
preferredHeight: 500
preferredWidth: 400 * Style.uiScaleRatio
preferredHeight: 500 * Style.uiScaleRatio
panelKeyboardFocus: true
property string passwordSsid: ""
@@ -173,7 +173,7 @@ NPanel {
NText {
text: I18n.tr("wifi.panel.searching")
pointSize: Style.fontSizeNormal
pointSize: Style.fontSizeM
color: Color.mOnSurfaceVariant
Layout.alignment: Qt.AlignHCenter
}
@@ -252,7 +252,7 @@ NPanel {
NText {
text: modelData.ssid
pointSize: Style.fontSizeNormal
pointSize: Style.fontSizeM
font.weight: modelData.connected ? Style.fontWeightBold : Style.fontWeightMedium
color: Color.mOnSurface
elide: Text.ElideRight

View File

@@ -107,6 +107,7 @@ Item {
visible: false
text: windowTitle
pointSize: Style.fontSizeS
applyUiScale: false
font.weight: Style.fontWeightMedium
}
@@ -244,6 +245,7 @@ Item {
id: titleText
text: windowTitle
pointSize: Style.fontSizeS
applyUiScale: false
font.weight: Style.fontWeightMedium
verticalAlignment: Text.AlignVCenter
color: Color.mOnSurface
@@ -253,6 +255,8 @@ Item {
NText {
text: windowTitle
font: titleText.font
pointSize: Style.fontSizeS
applyUiScale: false
verticalAlignment: Text.AlignVCenter
color: Color.mOnSurface
visible: titleContainer.needsScrolling && titleContainer.isScrolling

View File

@@ -73,6 +73,7 @@ Rectangle {
return (index == 0) ? Style.fontSizeXS : Style.fontSizeXXS
}
}
applyUiScale: false
font.weight: Style.fontWeightBold
color: usePrimaryColor ? Color.mPrimary : Color.mOnSurface
wrapMode: Text.WordWrap
@@ -97,6 +98,7 @@ Rectangle {
text: modelData
family: useCustomFont && customFont ? customFont : Settings.data.ui.fontDefault
pointSize: Style.fontSizeS
applyUiScale: false
font.weight: Style.fontWeightBold
color: usePrimaryColor ? Color.mPrimary : Color.mOnSurface
wrapMode: Text.WordWrap

View File

@@ -84,6 +84,7 @@ Item {
visible: false
text: titleText.text
font: titleText.font
applyUiScale: false
}
Rectangle {
@@ -286,6 +287,7 @@ Item {
id: titleText
text: hasActivePlayer ? getTitle() : placeholderText
pointSize: Style.fontSizeS
applyUiScale: false
font.weight: Style.fontWeightMedium
verticalAlignment: Text.AlignVCenter
horizontalAlignment: hasActivePlayer ? Text.AlignLeft : Text.AlignHCenter
@@ -295,6 +297,7 @@ Item {
NText {
text: hasActivePlayer ? getTitle() : placeholderText
font: titleText.font
applyUiScale: false
verticalAlignment: Text.AlignVCenter
horizontalAlignment: hasActivePlayer ? Text.AlignLeft : Text.AlignHCenter
color: hasActivePlayer ? Color.mOnSurface : Color.mOnSurfaceVariant

View File

@@ -106,6 +106,7 @@ Rectangle {
NIcon {
icon: "cpu-usage"
pointSize: iconSize
applyUiScale: false
Layout.alignment: Qt.AlignCenter
Layout.row: isVertical ? 1 : 0
Layout.column: 0
@@ -115,6 +116,7 @@ Rectangle {
text: `${Math.round(SystemStatService.cpuUsage)}%`
family: Settings.data.ui.fontFixed
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : percentTextWidth
@@ -147,6 +149,7 @@ Rectangle {
NIcon {
icon: "cpu-temperature"
pointSize: iconSize
applyUiScale: false
Layout.alignment: Qt.AlignCenter
Layout.row: isVertical ? 1 : 0
Layout.column: 0
@@ -156,6 +159,7 @@ Rectangle {
text: `${Math.round(SystemStatService.cpuTemp)}°`
family: Settings.data.ui.fontFixed
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : tempTextWidth
@@ -188,6 +192,7 @@ Rectangle {
NIcon {
icon: "memory"
pointSize: iconSize
applyUiScale: false
Layout.alignment: Qt.AlignCenter
Layout.row: isVertical ? 1 : 0
Layout.column: 0
@@ -197,6 +202,7 @@ Rectangle {
text: showMemoryAsPercent ? `${Math.round(SystemStatService.memPercent)}%` : `${SystemStatService.memGb.toFixed(1)}G`
family: Settings.data.ui.fontFixed
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : (showMemoryAsPercent ? percentTextWidth : memTextWidth)
@@ -229,6 +235,7 @@ Rectangle {
NIcon {
icon: "download-speed"
pointSize: iconSize
applyUiScale: false
Layout.alignment: Qt.AlignCenter
Layout.row: isVertical ? 1 : 0
Layout.column: 0
@@ -238,6 +245,7 @@ Rectangle {
text: isVertical ? SystemStatService.formatCompactSpeed(SystemStatService.rxSpeed) : SystemStatService.formatSpeed(SystemStatService.rxSpeed)
family: Settings.data.ui.fontFixed
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : memTextWidth
@@ -270,6 +278,7 @@ Rectangle {
NIcon {
icon: "upload-speed"
pointSize: iconSize
applyUiScale: false
Layout.alignment: Qt.AlignCenter
Layout.row: isVertical ? 1 : 0
Layout.column: 0
@@ -279,6 +288,7 @@ Rectangle {
text: isVertical ? SystemStatService.formatCompactSpeed(SystemStatService.txSpeed) : SystemStatService.formatSpeed(SystemStatService.txSpeed)
family: Settings.data.ui.fontFixed
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : memTextWidth
@@ -311,6 +321,7 @@ Rectangle {
NIcon {
icon: "storage"
pointSize: iconSize
applyUiScale: false
Layout.alignment: Qt.AlignCenter
Layout.row: isVertical ? 1 : 0
Layout.column: 0
@@ -320,6 +331,7 @@ Rectangle {
text: `${SystemStatService.diskPercent}%`
family: Settings.data.ui.fontFixed
pointSize: textSize
applyUiScale: false
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: isVertical ? -1 : percentTextWidth

View File

@@ -286,6 +286,7 @@ Item {
}
family: Settings.data.ui.fontFixed
pointSize: model.isFocused ? workspacePillContainer.height * 0.45 : workspacePillContainer.height * 0.42
applyUiScale: false
font.capitalization: Font.AllUppercase
font.weight: Style.fontWeightBold
wrapMode: Text.Wrap
@@ -430,6 +431,7 @@ Item {
}
family: Settings.data.ui.fontFixed
pointSize: model.isFocused ? workspacePillContainerVertical.width * 0.45 : workspacePillContainerVertical.width * 0.42
applyUiScale: false
font.capitalization: Font.AllUppercase
font.weight: Style.fontWeightBold
wrapMode: Text.Wrap

View File

@@ -11,8 +11,8 @@ import qs.Widgets
NPanel {
id: root
preferredWidth: 800
preferredHeight: 800
preferredWidth: 800 * Style.uiScaleRatio
preferredHeight: 800 * Style.uiScaleRatio
preferredWidthRatio: 0.4
preferredHeightRatio: 0.75

View File

@@ -8,6 +8,7 @@ Text {
property string icon: Icons.defaultIcon
property real pointSize: Style.fontSizeL
property bool applyUiScale: true
visible: (icon !== undefined) && (icon !== "")
text: {
@@ -22,7 +23,7 @@ Text {
return Icons.get(icon)
}
font.family: Icons.fontFamily
font.pointSize: root.pointSize * Style.uiScaleRatio
font.pointSize: applyUiScale ? root.pointSize * Style.uiScaleRatio : root.pointSize
color: Color.mOnSurface
verticalAlignment: Text.AlignVCenter
}

View File

@@ -9,8 +9,13 @@ Text {
property string family: Settings.data.ui.fontDefault
property real pointSize: Style.fontSizeM
property bool applyUiScale: true
property real fontScale: {
return (root.family === Settings.data.ui.fontDefault ? Settings.data.ui.fontDefaultScale * Style.uiScaleRatio: Settings.data.ui.fontFixedScale * Style.uiScaleRatio)
const fontScale = (root.family === Settings.data.ui.fontDefault ? Settings.data.ui.fontDefaultScale : Settings.data.ui.fontFixedScale)
if (applyUiScale) {
return fontScale * Style.uiScaleRatio
}
return fontScale
}
font.family: root.family