ControlCenter: Looks better when it's taller and less wide.

This commit is contained in:
ItsLemmy
2025-10-09 20:20:26 -04:00
parent 4d0041abee
commit 3fe63f463e
4 changed files with 20 additions and 28 deletions
@@ -9,14 +9,11 @@ import qs.Widgets
NBox { NBox {
id: root id: root
GridLayout { RowLayout {
id: content id: content
anchors.fill: parent anchors.fill: parent
anchors.margins: Style.marginXS * scaling anchors.margins: Style.marginXS * scaling
columns: 2 spacing: Style.marginS * scaling
rows: 2
columnSpacing: Style.marginS * scaling
rowSpacing: Style.marginS * scaling
NCircleStat { NCircleStat {
value: SystemStatService.cpuUsage value: SystemStatService.cpuUsage
+1 -1
View File
@@ -105,7 +105,7 @@ NBox {
GridLayout { GridLayout {
id: grid id: grid
Layout.fillWidth: true Layout.fillWidth: true
columns: (Settings.data.controlCenter.quickSettingsStyle === "compact") ? 5 : 3 columns: (Settings.data.controlCenter.quickSettingsStyle === "compact") ? 4 : 3
columnSpacing: Style.marginM * scaling columnSpacing: Style.marginM * scaling
rowSpacing: Style.marginS * scaling rowSpacing: Style.marginS * scaling
+15 -20
View File
@@ -10,13 +10,13 @@ import qs.Widgets
NPanel { NPanel {
id: root id: root
preferredWidth: 440 preferredWidth: 400
preferredHeight: topHeight + bottomHeight + Math.round(Style.marginL * 3) preferredHeight: topHeight + midHeight + bottomHeight + Math.round(Style.marginL * 4)
panelKeyboardFocus: true panelKeyboardFocus: true
readonly property int bottomHeight: 196
readonly property int topHeight: { readonly property int topHeight: {
const columns = (Settings.data.controlCenter.quickSettingsStyle === "compact") ? 5 : 3 const columns = (Settings.data.controlCenter.quickSettingsStyle === "compact") ? 4 : 3
const rowsCount = Math.ceil(Settings.data.controlCenter.widgets.quickSettings.length / columns) const rowsCount = Math.ceil(Settings.data.controlCenter.widgets.quickSettings.length / columns)
var buttonHeight var buttonHeight
@@ -30,6 +30,9 @@ NPanel {
return (rowsCount * buttonHeight) + 120 return (rowsCount * buttonHeight) + 120
} }
readonly property int midHeight: 220
readonly property int bottomHeight: 80
// Positioning // Positioning
readonly property string controlCenterPosition: Settings.data.controlCenter.position readonly property string controlCenterPosition: Settings.data.controlCenter.position
@@ -59,24 +62,16 @@ NPanel {
Layout.preferredHeight: topHeight * scaling Layout.preferredHeight: topHeight * scaling
} }
// Media + stats column // Media card
RowLayout { MediaCard {
id: bottomCard Layout.fillWidth: true
Layout.preferredHeight: midHeight * scaling
}
// System monitors combined in one card
SystemMonitorCard {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: bottomHeight * scaling Layout.preferredHeight: bottomHeight * scaling
spacing: content.cardSpacing
// Media card
MediaCard {
Layout.preferredWidth: Math.max(250 * scaling)
Layout.preferredHeight: bottomHeight * scaling
}
// System monitors combined in one card
SystemMonitorCard {
Layout.preferredWidth: Math.max(140 * scaling)
Layout.preferredHeight: bottomHeight * scaling
}
} }
} }
} }
+2 -2
View File
@@ -300,7 +300,7 @@ Rectangle {
onReleased: mouse => { onReleased: mouse => {
root.scale = 1.0 root.scale = 1.0
root.pressed = false root.pressed = false
// Only trigger actions if released while hovering // Only trigger actions if released while hovering
if (root.hovered) { if (root.hovered) {
if (mouse.button === Qt.LeftButton) { if (mouse.button === Qt.LeftButton) {
@@ -322,4 +322,4 @@ Rectangle {
} }
} }
} }
} }