New scaling wip

This commit is contained in:
ItsLemmy
2025-10-12 15:25:09 -04:00
parent 1e04a92047
commit a2cd377837
9 changed files with 65 additions and 49 deletions
+22 -18
View File
@@ -10,8 +10,8 @@ import qs.Widgets
NPanel {
id: root
preferredWidth: 460
preferredHeight: 790
preferredWidth: Math.round(460 * Style.uiScaleRatio)
preferredHeight: (profileHeight + weatherHeight + mediaSysMonHeight + audioHeight + bottomHeight) + 6 * Style.marginL
panelKeyboardFocus: true
// Positioning
@@ -23,35 +23,39 @@ NPanel {
panelAnchorBottom: controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.startsWith("bottom_")
panelAnchorTop: controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.startsWith("top_")
readonly property int profileHeight: Math.round(64 * Style.uiScaleRatio)
readonly property int weatherHeight: Math.round(190 * Style.uiScaleRatio)
readonly property int mediaSysMonHeight: Math.round(260 * Style.uiScaleRatio)
readonly property int audioHeight: Math.round(120 * Style.uiScaleRatio)
readonly property int bottomHeight: Math.round(60 * Style.uiScaleRatio)
panelContent: Item {
id: content
property real cardSpacing: Style.marginL
// Layout content
ColumnLayout {
id: layout
x: content.cardSpacing
y: content.cardSpacing
width: parent.width - (2 * content.cardSpacing)
spacing: content.cardSpacing
x: Style.marginL
y: Style.marginL
width: parent.width - (Style.marginL * 2)
spacing: Style.marginL
// Cards (consistent inter-card spacing via ColumnLayout spacing)
ProfileCard {
Layout.fillWidth: true
Layout.preferredHeight: Math.max(64)
Layout.preferredHeight: profileHeight
}
WeatherCard {
Layout.fillWidth: true
Layout.preferredHeight: Math.max(190)
Layout.preferredHeight: weatherHeight
}
// Middle section: media + stats column
RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: Math.max(260)
spacing: content.cardSpacing
Layout.preferredHeight: mediaSysMonHeight
spacing: Style.marginL
// Media card
MediaCard {
@@ -61,7 +65,7 @@ NPanel {
// System monitors combined in one card
SystemMonitorCard {
Layout.preferredWidth: Style.baseWidgetSize * 2.625
Layout.preferredWidth: Math.round(Style.baseWidgetSize * 2.625)
Layout.fillHeight: true
}
}
@@ -69,27 +73,27 @@ NPanel {
// Audio card below media and system monitor
AudioCard {
Layout.fillWidth: true
Layout.preferredHeight: Math.max(120)
Layout.preferredHeight: audioHeight
}
// Bottom actions (two grouped rows of round buttons)
RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: Math.max(60)
spacing: content.cardSpacing
Layout.preferredHeight: bottomHeight
spacing: Style.marginL
// Power Profiles switcher
PowerProfilesCard {
Layout.fillWidth: true
Layout.fillHeight: true
spacing: content.cardSpacing
spacing: Style.marginL
}
// Utilities buttons
UtilitiesCard {
Layout.fillWidth: true
Layout.fillHeight: true
spacing: content.cardSpacing
spacing: Style.marginL
}
}
}