Code formatting

This commit is contained in:
quadbyte 2025-08-10 13:26:46 -04:00
parent c62e199ea7
commit 1d13bbe0f7
11 changed files with 161 additions and 85 deletions

View file

@ -22,7 +22,9 @@ NBox {
anchors.margins: Style.marginXL * scaling
spacing: Style.marginSmall * scaling
Item { height: 36 * scaling }
Item {
height: 36 * scaling
}
Text {
text: "music_note"
@ -38,7 +40,8 @@ NBox {
anchors.horizontalCenter: parent.horizontalCenter
}
Item { height: 36 * scaling }
Item {
height: 36 * scaling
}
}
}

View file

@ -27,7 +27,7 @@ NBox {
id: avatarBox
width: 40 * scaling
height: 40 * scaling
Image {
id: avatarImage
anchors.fill: parent
@ -52,17 +52,29 @@ NBox {
ColumnLayout {
Layout.fillWidth: true
spacing: 2 * scaling
NText { text: Quickshell.env("USER") || "user" }
NText { text: "System Uptime: —"; color: Colors.textSecondary }
NText {
text: Quickshell.env("USER") || "user"
}
NText {
text: "System Uptime: —"
color: Colors.textSecondary
}
}
RowLayout {
spacing: Style.marginSmall * scaling
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Item { Layout.fillWidth: true }
NIconButton { icon: "settings"; sizeMultiplier: 0.8 }
NIconButton { icon: "power_settings_new"; sizeMultiplier: 0.8 }
Item {
Layout.fillWidth: true
}
NIconButton {
icon: "settings"
sizeMultiplier: 0.8
}
NIconButton {
icon: "power_settings_new"
sizeMultiplier: 0.8
}
}
}
}

View file

@ -6,7 +6,6 @@ import Quickshell.Wayland
import qs.Services
import qs.Widgets
NLoader {
id: root
@ -46,7 +45,6 @@ NLoader {
Component.onCompleted: show()
// Inline helpers moved to dedicated widgets: NCard and NCircleStat
Rectangle {
id: panelBackground
color: Colors.backgroundPrimary
@ -61,13 +59,14 @@ NLoader {
// Place the panel just below the bar (overlay content starts below bar due to topMargin)
y: Style.marginSmall * scaling
// Center horizontally under the anchorX, clamped to the screen bounds
x: Math.max(
Style.marginSmall * scaling,
Math.min(parent.width - width - Style.marginSmall * scaling,
x: Math.max(Style.marginSmall * scaling, Math.min(
parent.width - width - Style.marginSmall * scaling,
Math.round(anchorX - width / 2)))
// Prevent closing when clicking in the panel bg
MouseArea { anchors.fill: parent }
MouseArea {
anchors.fill: parent
}
// Content wrapper to ensure childrenRect drives implicit height
Item {
@ -88,8 +87,14 @@ NLoader {
spacing: sidePanel.cardSpacing
// Cards (consistent inter-card spacing via ColumnLayout spacing)
ProfileCard { Layout.topMargin: 0; Layout.bottomMargin: 0 }
WeatherCard { Layout.topMargin: 0; Layout.bottomMargin: 0 }
ProfileCard {
Layout.topMargin: 0
Layout.bottomMargin: 0
}
WeatherCard {
Layout.topMargin: 0
Layout.bottomMargin: 0
}
// Middle section: media + stats column
RowLayout {
@ -99,10 +104,16 @@ NLoader {
spacing: sidePanel.cardSpacing
// Media card
MediaCard { id: mediaCard; Layout.fillWidth: true; implicitHeight: statsCard.implicitHeight }
MediaCard {
id: mediaCard
Layout.fillWidth: true
implicitHeight: statsCard.implicitHeight
}
// System monitors combined in one card
SystemCard { id: statsCard }
SystemCard {
id: statsCard
}
}
// Bottom actions (two grouped rows of round buttons)
@ -111,7 +122,7 @@ NLoader {
Layout.topMargin: 0
Layout.bottomMargin: 0
spacing: sidePanel.cardSpacing
// Power Profiles: performance, balanced, eco
NBox {
Layout.fillWidth: true
@ -122,26 +133,30 @@ NLoader {
anchors.fill: parent
anchors.margins: Style.marginSmall * scaling
spacing: sidePanel.cardSpacing
Item { Layout.fillWidth: true }
Item {
Layout.fillWidth: true
}
// Performance
NIconButton {
icon: "speed"
sizeMultiplier: 1.0
onClicked: function () { /* TODO: hook to power profile */ }
onClicked: function () {/* TODO: hook to power profile */ }
}
// Balanced
NIconButton {
icon: "balance"
sizeMultiplier: 1.0
onClicked: function () { /* TODO: hook to power profile */ }
onClicked: function () {/* TODO: hook to power profile */ }
}
// Eco
NIconButton {
icon: "eco"
sizeMultiplier: 1.0
onClicked: function () { /* TODO: hook to power profile */ }
onClicked: function () {/* TODO: hook to power profile */ }
}
Item {
Layout.fillWidth: true
}
Item { Layout.fillWidth: true }
}
}
@ -155,12 +170,22 @@ NLoader {
anchors.fill: parent
anchors.margins: Style.marginSmall * scaling
spacing: sidePanel.cardSpacing
Item { Layout.fillWidth: true }
Item {
Layout.fillWidth: true
}
// Record
NIconButton { icon: "fiber_manual_record"; sizeMultiplier: 1.0 }
NIconButton {
icon: "fiber_manual_record"
sizeMultiplier: 1.0
}
// Wallpaper
NIconButton { icon: "image"; sizeMultiplier: 1.0 }
Item { Layout.fillWidth: true }
NIconButton {
icon: "image"
sizeMultiplier: 1.0
}
Item {
Layout.fillWidth: true
}
}
}
}

View file

@ -24,17 +24,52 @@ NBox {
spacing: Style.marginSmall * scaling
// Slight top padding
Item { height: Style.marginTiny * scaling }
Item {
height: Style.marginTiny * scaling
}
NSystemMonitor { id: sysMon; intervalSeconds: 1 }
NSystemMonitor {
id: sysMon
intervalSeconds: 1
}
NCircleStat { value: sysMon.cpuUsage || SysInfo.cpuUsage; icon: "speed"; flat: true; contentScale: 0.8; width: 72 * scaling; height: 68 * scaling }
NCircleStat { value: sysMon.cpuTemp || SysInfo.cpuTemp; suffix: "°C"; icon: "device_thermostat"; flat: true; contentScale: 0.8; width: 72 * scaling; height: 68 * scaling }
NCircleStat { value: sysMon.memoryUsagePer || SysInfo.memoryUsagePer; icon: "memory"; flat: true; contentScale: 0.8; width: 72 * scaling; height: 68 * scaling }
NCircleStat { value: sysMon.diskUsage || SysInfo.diskUsage; icon: "data_usage"; flat: true; contentScale: 0.8; width: 72 * scaling; height: 68 * scaling }
NCircleStat {
value: sysMon.cpuUsage || SysInfo.cpuUsage
icon: "speed"
flat: true
contentScale: 0.8
width: 72 * scaling
height: 68 * scaling
}
NCircleStat {
value: sysMon.cpuTemp || SysInfo.cpuTemp
suffix: "°C"
icon: "device_thermostat"
flat: true
contentScale: 0.8
width: 72 * scaling
height: 68 * scaling
}
NCircleStat {
value: sysMon.memoryUsagePer || SysInfo.memoryUsagePer
icon: "memory"
flat: true
contentScale: 0.8
width: 72 * scaling
height: 68 * scaling
}
NCircleStat {
value: sysMon.diskUsage || SysInfo.diskUsage
icon: "data_usage"
flat: true
contentScale: 0.8
width: 72 * scaling
height: 68 * scaling
}
// Extra bottom padding to shift the perceived stack slightly upward
Item { height: Style.marginMedium * scaling }
Item {
height: Style.marginMedium * scaling
}
}
}

View file

@ -30,12 +30,21 @@ NBox {
color: Colors.accentSecondary
}
ColumnLayout {
NText { text: "Dinslaken (GMT+2)" }
NText { text: "26°C"; font.pointSize: (Style.fontSizeXL + 6) * scaling }
NText {
text: "Dinslaken (GMT+2)"
}
NText {
text: "26°C"
font.pointSize: (Style.fontSizeXL + 6) * scaling
}
}
}
Rectangle { height: 1; width: parent.width; color: Colors.backgroundTertiary }
Rectangle {
height: 1
width: parent.width
color: Colors.backgroundTertiary
}
RowLayout {
Layout.fillWidth: true
@ -44,16 +53,20 @@ NBox {
model: 5
delegate: ColumnLayout {
spacing: 2 * scaling
NText { text: ["Sun","Mon","Tue","Wed","Thu"][index] }
NText {
text: ["Sun", "Mon", "Tue", "Wed", "Thu"][index]
}
Text {
text: index % 2 === 0 ? "wb_sunny" : "cloud"
font.family: "Material Symbols Outlined"
color: Colors.textSecondary
}
NText { text: "26° / 14°"; color: Colors.textSecondary }
NText {
text: "26° / 14°"
color: Colors.textSecondary
}
}
}
}
}
}