Add scaling to everything, edit SidePanel

This commit is contained in:
Ly-sec 2025-08-07 15:38:27 +02:00
parent 68d7add474
commit 0b49aff13d
52 changed files with 3138 additions and 3043 deletions

View file

@ -44,7 +44,7 @@ Item {
id: iconText
text: "dashboard"
font.family: isActive ? "Material Symbols Rounded" : "Material Symbols Outlined"
font.pixelSize: 16
font.pixelSize: 16 * Theme.uiScale
color: sidebarPopup.visible ? Theme.accentPrimary : Theme.textPrimary
anchors.centerIn: parent
z: 1

View file

@ -8,15 +8,15 @@ import qs.Services
Rectangle {
id: musicCard
width: 360
height: 250
width: 360 * Theme.uiScale
height: 250 * Theme.uiScale
color: "transparent"
Rectangle {
id: card
anchors.fill: parent
color: Theme.surface
radius: 18
radius: 18 * Theme.uiScale
// Show fallback UI if no player is available
Item {
@ -26,12 +26,12 @@ Rectangle {
ColumnLayout {
anchors.centerIn: parent
spacing: 16
spacing: 16 * Theme.uiScale
Text {
text: "music_note"
font.family: "Material Symbols Outlined"
font.pixelSize: Theme.fontSizeHeader
font.pixelSize: Theme.fontSizeHeader * Theme.uiScale
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.3)
Layout.alignment: Qt.AlignHCenter
}
@ -40,7 +40,7 @@ Rectangle {
text: MusicManager.hasPlayer ? "No controllable player selected" : "No music player detected"
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.6)
font.family: Theme.fontFamily
font.pixelSize: Theme.fontSizeSmall
font.pixelSize: Theme.fontSizeSmall * Theme.uiScale
Layout.alignment: Qt.AlignHCenter
}
}
@ -49,45 +49,45 @@ Rectangle {
// Main player UI
ColumnLayout {
anchors.fill: parent
anchors.margins: 18
spacing: 12
anchors.margins: 18 * Theme.uiScale
spacing: 12 * Theme.uiScale
visible: !!MusicManager.currentPlayer
// Player selector
ComboBox {
id: playerSelector
Layout.fillWidth: true
Layout.preferredHeight: 40
Layout.preferredHeight: 40 * Theme.uiScale
visible: MusicManager.getAvailablePlayers().length > 1
model: MusicManager.getAvailablePlayers()
textRole: "identity"
currentIndex: MusicManager.selectedPlayerIndex
background: Rectangle {
implicitWidth: 120
implicitHeight: 40
implicitWidth: 120 * Theme.uiScale
implicitHeight: 40 * Theme.uiScale
color: Theme.surfaceVariant
border.color: playerSelector.activeFocus ? Theme.accentPrimary : Theme.outline
border.width: 1
radius: 16
border.width: 1 * Theme.uiScale
radius: 16 * Theme.uiScale
}
contentItem: Text {
leftPadding: 12
leftPadding: 12 * Theme.uiScale
rightPadding: playerSelector.indicator.width + playerSelector.spacing
text: playerSelector.displayText
font.pixelSize: 13
font.pixelSize: 13 * Theme.uiScale
color: Theme.textPrimary
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
indicator: Text {
x: playerSelector.width - width - 12
x: playerSelector.width - width - 12 * Theme.uiScale
y: playerSelector.topPadding + (playerSelector.availableHeight - height) / 2
text: "arrow_drop_down"
font.family: "Material Symbols Outlined"
font.pixelSize: 24
font.pixelSize: 24 * Theme.uiScale
color: Theme.textPrimary
}
@ -95,7 +95,7 @@ Rectangle {
y: playerSelector.height
width: playerSelector.width
implicitHeight: contentItem.implicitHeight
padding: 1
padding: 1 * Theme.uiScale
contentItem: ListView {
clip: true
@ -109,8 +109,8 @@ Rectangle {
background: Rectangle {
color: Theme.surfaceVariant
border.color: Theme.outline
border.width: 1
radius: 16
border.width: 1 * Theme.uiScale
radius: 16 * Theme.uiScale
}
}
@ -118,7 +118,7 @@ Rectangle {
width: playerSelector.width
contentItem: Text {
text: modelData.identity
font.pixelSize: 13
font.pixelSize: 13 * Theme.uiScale
color: Theme.textPrimary
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
@ -138,14 +138,14 @@ Rectangle {
// Album art with spectrum visualizer
RowLayout {
spacing: 12
spacing: 12 * Theme.uiScale
Layout.fillWidth: true
// Album art container with circular spectrum overlay
Item {
id: albumArtContainer
width: 96
height: 96 // enough for spectrum and art (will adjust if needed)
width: 96 * Theme.uiScale
height: 96 * Theme.uiScale // enough for spectrum and art (will adjust if needed)
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
// Circular spectrum visualizer around album art
@ -153,36 +153,36 @@ Rectangle {
id: spectrum
values: MusicManager.cavaValues
anchors.centerIn: parent
innerRadius: 30 // Position just outside 60x60 album art
outerRadius: 48 // Extend bars outward from album art
innerRadius: 30 * Theme.uiScale // Position just outside 60x60 album art
outerRadius: 48 * Theme.uiScale // Extend bars outward from album art
fillColor: Theme.accentPrimary
strokeColor: Theme.accentPrimary
strokeWidth: 0
strokeWidth: 0 * Theme.uiScale
z: 0
}
// Album art image
Rectangle {
id: albumArtwork
width: 60
height: 60
width: 60 * Theme.uiScale
height: 60 * Theme.uiScale
anchors.centerIn: parent
radius: 30 // circle
radius: 30 * Theme.uiScale // circle
color: Qt.darker(Theme.surface, 1.1)
border.color: Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.3)
border.width: 1
border.width: 1 * Theme.uiScale
Image {
id: albumArt
anchors.fill: parent
anchors.margins: 2
anchors.margins: 2 * Theme.uiScale
fillMode: Image.PreserveAspectCrop
smooth: true
mipmap: true
cache: false
asynchronous: true
sourceSize.width: 60
sourceSize.height: 60
sourceSize.width: 60 * Theme.uiScale
sourceSize.height: 60 * Theme.uiScale
source: MusicManager.trackArtUrl
visible: source.toString() !== ""
@ -213,7 +213,7 @@ Rectangle {
anchors.centerIn: parent
text: "album"
font.family: "Material Symbols Outlined"
font.pixelSize: Theme.fontSizeBody
font.pixelSize: Theme.fontSizeBody * Theme.uiScale
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.4)
visible: !albumArt.visible
}
@ -223,13 +223,13 @@ Rectangle {
// Track metadata
ColumnLayout {
Layout.fillWidth: true
spacing: 4
spacing: 4 * Theme.uiScale
Text {
text: MusicManager.trackTitle
color: Theme.textPrimary
font.family: Theme.fontFamily
font.pixelSize: Theme.fontSizeSmall
font.pixelSize: Theme.fontSizeSmall * Theme.uiScale
font.bold: true
elide: Text.ElideRight
wrapMode: Text.Wrap
@ -241,7 +241,7 @@ Rectangle {
text: MusicManager.trackArtist
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.8)
font.family: Theme.fontFamily
font.pixelSize: Theme.fontSizeCaption
font.pixelSize: Theme.fontSizeCaption * Theme.uiScale
elide: Text.ElideRight
Layout.fillWidth: true
}
@ -250,7 +250,7 @@ Rectangle {
text: MusicManager.trackAlbum
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.6)
font.family: Theme.fontFamily
font.pixelSize: Theme.fontSizeCaption
font.pixelSize: Theme.fontSizeCaption * Theme.uiScale
elide: Text.ElideRight
Layout.fillWidth: true
}
@ -261,8 +261,8 @@ Rectangle {
Rectangle {
id: progressBarBackground
width: parent.width
height: 6
radius: 3
height: 6 * Theme.uiScale
radius: 3 * Theme.uiScale
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.15)
Layout.fillWidth: true
@ -290,12 +290,12 @@ Rectangle {
// Interactive progress handle
Rectangle {
id: progressHandle
width: 12
height: 12
radius: 6
width: 12 * Theme.uiScale
height: 12 * Theme.uiScale
radius: 6 * Theme.uiScale
color: Theme.accentPrimary
border.color: Qt.lighter(Theme.accentPrimary, 1.3)
border.width: 1
border.width: 1 * Theme.uiScale
x: Math.max(0, Math.min(parent.width - width, progressFill.width - width / 2))
anchors.verticalCenter: parent.verticalCenter
@ -334,18 +334,18 @@ Rectangle {
// Media controls
RowLayout {
spacing: 4
spacing: 4 * Theme.uiScale
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
// Previous button
Rectangle {
width: 28
height: 28
radius: 14
width: 28 * Theme.uiScale
height: 28 * Theme.uiScale
radius: 14 * Theme.uiScale
color: previousButton.containsMouse ? Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.2) : Qt.darker(Theme.surface, 1.1)
border.color: Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.3)
border.width: 1
border.width: 1 * Theme.uiScale
MouseArea {
id: previousButton
@ -360,19 +360,19 @@ Rectangle {
anchors.centerIn: parent
text: "skip_previous"
font.family: "Material Symbols Outlined"
font.pixelSize: Theme.fontSizeCaption
font.pixelSize: Theme.fontSizeCaption * Theme.uiScale
color: previousButton.enabled ? Theme.accentPrimary : Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.3)
}
}
// Play/Pause button
Rectangle {
width: 36
height: 36
radius: 18
width: 36 * Theme.uiScale
height: 36 * Theme.uiScale
radius: 18 * Theme.uiScale
color: playButton.containsMouse ? Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.2) : Qt.darker(Theme.surface, 1.1)
border.color: Theme.accentPrimary
border.width: 2
border.width: 2 * Theme.uiScale
MouseArea {
id: playButton
@ -387,19 +387,19 @@ Rectangle {
anchors.centerIn: parent
text: MusicManager.isPlaying ? "pause" : "play_arrow"
font.family: "Material Symbols Outlined"
font.pixelSize: Theme.fontSizeBody
font.pixelSize: Theme.fontSizeBody * Theme.uiScale
color: playButton.enabled ? Theme.accentPrimary : Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.3)
}
}
// Next button
Rectangle {
width: 28
height: 28
radius: 14
width: 28 * Theme.uiScale
height: 28 * Theme.uiScale
radius: 14 * Theme.uiScale
color: nextButton.containsMouse ? Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.2) : Qt.darker(Theme.surface, 1.1)
border.color: Qt.rgba(Theme.accentPrimary.r, Theme.accentPrimary.g, Theme.accentPrimary.b, 0.3)
border.width: 1
border.width: 1 * Theme.uiScale
MouseArea {
id: nextButton
@ -414,7 +414,7 @@ Rectangle {
anchors.centerIn: parent
text: "skip_next"
font.family: "Material Symbols Outlined"
font.pixelSize: Theme.fontSizeCaption
font.pixelSize: Theme.fontSizeCaption * Theme.uiScale
color: nextButton.enabled ? Theme.accentPrimary : Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.3)
}
}

View file

@ -45,11 +45,28 @@ PanelWithOverlay {
property real slideOffset: width
property bool isAnimating: false
property int leftPadding: 20
property int bottomPadding: 20
property int leftPadding: 20 * Theme.uiScale
property int bottomPadding: 20 * Theme.uiScale
// Recording properties
property bool isRecording: false
Process {
id: checkRecordingProcess
command: ["pgrep", "-f", "gpu-screen-recorder.*portal"]
onExited: function(exitCode, exitStatus) {
var isActuallyRecording = exitCode === 0
if (isRecording && !isActuallyRecording) {
isRecording = isActuallyRecording
}
}
}
function checkRecordingStatus() {
if (isRecording) {
checkRecordingProcess.running = true
}
}
function showAt() {
if (!sidebarPopup.visible) {
sidebarPopup.visible = true;
@ -73,11 +90,7 @@ PanelWithOverlay {
if (shell && shell.settingsWindow && shell.settingsWindow.visible)
shell.settingsWindow.visible = false;
if (wifiPanelLoader.active && wifiPanelLoader.item && wifiPanelLoader.item.visible)
wifiPanelLoader.item.visible = false;
if (bluetoothPanelLoader.active && bluetoothPanelLoader.item && bluetoothPanelLoader.item.visible)
bluetoothPanelLoader.item.visible = false;
if (sidebarPopup.visible) {
slideAnim.from = 0;
@ -119,8 +132,8 @@ PanelWithOverlay {
quickAccessWidget.isRecording = false;
}
implicitWidth: 500
implicitHeight: 800
implicitWidth: 500 * Theme.uiScale
implicitHeight: 700 * Theme.uiScale
visible: parent.visible
color: "transparent"
anchors.top: parent.top
@ -173,7 +186,7 @@ PanelWithOverlay {
x: sidebarPopupRect.leftPadding + sidebarPopupRect.slideOffset
y: 0
color: Theme.backgroundPrimary
bottomLeftRadius: 20
bottomLeftRadius: 20 * Theme.uiScale
z: 0
Behavior on x {
@ -188,27 +201,7 @@ PanelWithOverlay {
}
// LazyLoader for WifiPanel
LazyLoader {
id: wifiPanelLoader
loading: false
component: WifiPanel {
}
}
// LazyLoader for BluetoothPanel
LazyLoader {
id: bluetoothPanelLoader
loading: false
component: BluetoothPanel {
}
}
// SettingsIcon component
SettingsIcon {
@ -228,11 +221,12 @@ PanelWithOverlay {
ColumnLayout {
anchors.fill: parent
anchors.margins: 20
spacing: 16
anchors.margins: 20 * Theme.uiScale
spacing: 4 * Theme.uiScale
PowerMenu {
id: systemWidget
settingsModal: settingsModal
Layout.alignment: Qt.AlignHCenter
z: 3
@ -240,14 +234,13 @@ PanelWithOverlay {
Weather {
id: weather
Layout.alignment: Qt.AlignHCenter
z: 2
}
// Music and System Monitor row
RowLayout {
spacing: 12
spacing: 12 * Theme.uiScale
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
@ -257,123 +250,118 @@ PanelWithOverlay {
SystemMonitor {
id: systemMonitor
z: 2
}
}
// Power profile, Wifi and Bluetooth row
// Power profile, Record and Wallpaper row
RowLayout {
Layout.alignment: Qt.AlignLeft
Layout.preferredHeight: 80
spacing: 16
Layout.alignment: Qt.AlignVCenter
spacing: 10 * Theme.uiScale
Layout.preferredHeight: 80 * Theme.uiScale
z: 3
PowerProfile {
Layout.alignment: Qt.AlignLeft
Layout.preferredHeight: 80
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: 80 * Theme.uiScale
}
// Network card containing Wifi and Bluetooth
// Record and Wallpaper card
Rectangle {
Layout.preferredHeight: 80
Layout.preferredWidth: 140
Layout.preferredHeight: 80 * Theme.uiScale
Layout.preferredWidth: 140 * Theme.uiScale
Layout.fillWidth: false
color: Theme.surface
radius: 18
radius: 18 * Theme.uiScale
Row {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
spacing: 20
spacing: 20 * Theme.uiScale
// Wifi button
// Record button
Rectangle {
id: wifiButton
id: recordButton
width: 36
height: 36
radius: 18
width: 36 * Theme.uiScale
height: 36 * Theme.uiScale
radius: 18 * Theme.uiScale
border.color: Theme.accentPrimary
border.width: 1
color: wifiButtonArea.containsMouse ? Theme.accentPrimary : "transparent"
border.width: 1 * Theme.uiScale
color: sidebarPopupRect.isRecording ? Theme.accentPrimary :
(recordButtonArea.containsMouse ? Theme.accentPrimary : "transparent")
Text {
anchors.centerIn: parent
text: "wifi"
text: "photo_camera"
font.family: "Material Symbols Outlined"
font.pixelSize: 22
color: wifiButtonArea.containsMouse ? Theme.backgroundPrimary : Theme.accentPrimary
font.pixelSize: 22 * Theme.uiScale
color: sidebarPopupRect.isRecording || recordButtonArea.containsMouse ? Theme.backgroundPrimary : Theme.accentPrimary
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
MouseArea {
id: wifiButtonArea
id: recordButtonArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
if (!wifiPanelLoader.active)
wifiPanelLoader.loading = true;
if (wifiPanelLoader.item)
wifiPanelLoader.item.showAt();
if (sidebarPopupRect.isRecording) {
sidebarPopupRect.stopRecording();
} else {
sidebarPopupRect.startRecording();
}
}
}
StyledTooltip {
text: "Wifi"
targetItem: wifiButtonArea
tooltipVisible: wifiButtonArea.containsMouse
text: sidebarPopupRect.isRecording ? "Stop Recording" : "Start Recording"
targetItem: recordButtonArea
tooltipVisible: recordButtonArea.containsMouse
}
}
// Bluetooth button
// Wallpaper button
Rectangle {
id: bluetoothButton
id: wallpaperButton
width: 36
height: 36
radius: 18
width: 36 * Theme.uiScale
height: 36 * Theme.uiScale
radius: 18 * Theme.uiScale
border.color: Theme.accentPrimary
border.width: 1
color: bluetoothButtonArea.containsMouse ? Theme.accentPrimary : "transparent"
border.width: 1 * Theme.uiScale
color: wallpaperButtonArea.containsMouse ? Theme.accentPrimary : "transparent"
Text {
anchors.centerIn: parent
text: "bluetooth"
text: "image"
font.family: "Material Symbols Outlined"
font.pixelSize: 22
color: bluetoothButtonArea.containsMouse ? Theme.backgroundPrimary : Theme.accentPrimary
font.pixelSize: 22 * Theme.uiScale
color: wallpaperButtonArea.containsMouse ? Theme.backgroundPrimary : Theme.accentPrimary
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
MouseArea {
id: bluetoothButtonArea
id: wallpaperButtonArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
if (!bluetoothPanelLoader.active)
bluetoothPanelLoader.loading = true;
if (bluetoothPanelLoader.item)
bluetoothPanelLoader.item.showAt();
if (typeof settingsModal !== 'undefined' && settingsModal && settingsModal.openSettings)
settingsModal.openSettings(6);
}
}
StyledTooltip {
text: "Bluetooth"
targetItem: bluetoothButtonArea
tooltipVisible: bluetoothButtonArea.containsMouse
text: "Wallpaper"
targetItem: wallpaperButtonArea
tooltipVisible: wallpaperButtonArea.containsMouse
}
}
@ -384,43 +372,7 @@ PanelWithOverlay {
}
Item {
Layout.fillHeight: true
}
// QuickAccess widget
QuickAccess {
// 6 is the wallpaper tab index
id: quickAccessWidget
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: -16
z: 2
isRecording: sidebarPopupRect.isRecording
onRecordingRequested: {
sidebarPopupRect.startRecording();
}
onStopRecordingRequested: {
sidebarPopupRect.stopRecording();
}
onRecordingStateMismatch: function(actualState) {
isRecording = actualState;
quickAccessWidget.isRecording = actualState;
}
onSettingsRequested: {
// Use the SettingsModal's openSettings function
if (typeof settingsModal !== 'undefined' && settingsModal && settingsModal.openSettings)
settingsModal.openSettings();
}
onWallpaperSelectorRequested: {
// Use the SettingsModal's openSettings function with wallpaper tab (index 6)
if (typeof settingsModal !== 'undefined' && settingsModal && settingsModal.openSettings)
settingsModal.openSettings(6);
}
}
}
@ -448,7 +400,7 @@ PanelWithOverlay {
size: 1.1
fillColor: Theme.backgroundPrimary
anchors.top: parent.top
offsetX: -447 + sidebarPopupRect.slideOffset
offsetX: -464 + sidebarPopupRect.slideOffset
offsetY: 0
Behavior on offsetX {

View file

@ -17,6 +17,7 @@ Rectangle {
property string uptimeText: "--:--"
property bool panelVisible: false
property var settingsModal: null
function logout() {
if (WorkspaceManager.isNiri)
@ -43,8 +44,8 @@ Rectangle {
uptimeProcess.running = true;
}
width: 440
height: 80
width: 440 * Theme.uiScale
height: 80 * Theme.uiScale
color: "transparent"
anchors.horizontalCenterOffset: -2
onPanelVisibleChanged: {
@ -61,29 +62,29 @@ Rectangle {
anchors.fill: parent
color: Theme.surface
radius: 18
radius: 18 * Theme.uiScale
ColumnLayout {
anchors.fill: parent
anchors.margins: 18
spacing: 12
anchors.margins: 18 * Theme.uiScale
spacing: 12 * Theme.uiScale
RowLayout {
Layout.fillWidth: true
spacing: 12
spacing: 12 * Theme.uiScale
Rectangle {
width: 48
height: 48
radius: 24
width: 48 * Theme.uiScale
height: 48 * Theme.uiScale
radius: 24 * Theme.uiScale
color: Theme.accentPrimary
Rectangle {
anchors.fill: parent
color: "transparent"
radius: 24
radius: 24 * Theme.uiScale
border.color: Theme.accentPrimary
border.width: 2
border.width: 2 * Theme.uiScale
z: 2
}
@ -93,13 +94,13 @@ Rectangle {
}
ColumnLayout {
spacing: 4
spacing: 4 * Theme.uiScale
Layout.fillWidth: true
Text {
text: Quickshell.env("USER")
font.family: Theme.fontFamily
font.pixelSize: 16
font.pixelSize: 16 * Theme.uiScale
font.bold: true
color: Theme.textPrimary
}
@ -107,7 +108,7 @@ Rectangle {
Text {
text: "System Uptime: " + uptimeText
font.family: Theme.fontFamily
font.pixelSize: 12
font.pixelSize: 12 * Theme.uiScale
color: Theme.textSecondary
}
@ -117,21 +118,62 @@ Rectangle {
Layout.fillWidth: true
}
Rectangle {
id: settingsButton
width: 32 * Theme.uiScale
height: 32 * Theme.uiScale
radius: 16 * Theme.uiScale
color: settingsButtonArea.containsMouse || settingsButtonArea.pressed ? Theme.accentPrimary : "transparent"
border.color: Theme.accentPrimary
border.width: 1 * Theme.uiScale
Text {
anchors.centerIn: parent
anchors.horizontalCenterOffset: -1
text: "settings"
font.family: "Material Symbols Outlined"
font.pixelSize: 16 * Theme.uiScale
color: settingsButtonArea.containsMouse || settingsButtonArea.pressed ? Theme.backgroundPrimary : Theme.accentPrimary
}
MouseArea {
id: settingsButtonArea
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onClicked: {
if (typeof settingsModal !== 'undefined' && settingsModal && settingsModal.openSettings)
settingsModal.openSettings();
}
}
StyledTooltip {
id: settingsTooltip
text: "Settings"
targetItem: settingsButton
tooltipVisible: settingsButtonArea.containsMouse
}
}
Rectangle {
id: systemButton
width: 32
height: 32
radius: 16
width: 32 * Theme.uiScale
height: 32 * Theme.uiScale
radius: 16 * Theme.uiScale
color: systemButtonArea.containsMouse || systemButtonArea.pressed ? Theme.accentPrimary : "transparent"
border.color: Theme.accentPrimary
border.width: 1
border.width: 1 * Theme.uiScale
Text {
anchors.centerIn: parent
text: "power_settings_new"
font.family: "Material Symbols Outlined"
font.pixelSize: 16
font.pixelSize: 16 * Theme.uiScale
color: systemButtonArea.containsMouse || systemButtonArea.pressed ? Theme.backgroundPrimary : Theme.accentPrimary
}
@ -169,18 +211,18 @@ Rectangle {
anchors.right: systemButton.right
Rectangle {
width: 160
height: 220
width: 160 * Theme.uiScale
height: 220 * Theme.uiScale
color: Theme.surface
radius: 8
radius: 8 * Theme.uiScale
border.color: Theme.outline
border.width: 1
border.width: 1 * Theme.uiScale
visible: true
z: 9999
anchors.top: parent.top
anchors.right: parent.right
anchors.rightMargin: 32
anchors.topMargin: systemButton.y + systemButton.height + 48
anchors.rightMargin: 32 * Theme.uiScale
anchors.topMargin: systemButton.y + systemButton.height + 48 * Theme.uiScale
// Prevent closing when clicking in the panel bg
MouseArea {
@ -189,31 +231,31 @@ Rectangle {
ColumnLayout {
anchors.fill: parent
anchors.margins: 8
spacing: 4
anchors.margins: 8 * Theme.uiScale
spacing: 4 * Theme.uiScale
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 36
radius: 6
Layout.preferredHeight: 36 * Theme.uiScale
radius: 6 * Theme.uiScale
color: lockButtonArea.containsMouse ? Theme.accentPrimary : "transparent"
RowLayout {
anchors.fill: parent
anchors.margins: 12
spacing: 8
anchors.margins: 12 * Theme.uiScale
spacing: 8 * Theme.uiScale
Text {
text: "lock_outline"
font.family: "Material Symbols Outlined"
font.pixelSize: 16
font.pixelSize: 16 * Theme.uiScale
color: lockButtonArea.containsMouse ? Theme.onAccent : Theme.textPrimary
}
Text {
text: "Lock Screen"
font.family: Theme.fontFamily
font.pixelSize: 14
font.pixelSize: 14 * Theme.uiScale
color: lockButtonArea.containsMouse ? Theme.onAccent : Theme.textPrimary
Layout.fillWidth: true
}
@ -236,25 +278,25 @@ Rectangle {
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 36
radius: 6
Layout.preferredHeight: 36 * Theme.uiScale
radius: 6 * Theme.uiScale
color: suspendButtonArea.containsMouse ? Theme.accentPrimary : "transparent"
RowLayout {
anchors.fill: parent
anchors.margins: 12
spacing: 8
anchors.margins: 12 * Theme.uiScale
spacing: 8 * Theme.uiScale
Text {
text: "bedtime"
font.family: "Material Symbols Outlined"
font.pixelSize: 16
font.pixelSize: 16 * Theme.uiScale
color: suspendButtonArea.containsMouse ? Theme.onAccent : Theme.textPrimary
}
Text {
text: "Suspend"
font.pixelSize: 14
font.pixelSize: 14 * Theme.uiScale
color: suspendButtonArea.containsMouse ? Theme.onAccent : Theme.textPrimary
Layout.fillWidth: true
}
@ -277,26 +319,26 @@ Rectangle {
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 36
radius: 6
Layout.preferredHeight: 36 * Theme.uiScale
radius: 6 * Theme.uiScale
color: rebootButtonArea.containsMouse ? Theme.accentPrimary : "transparent"
RowLayout {
anchors.fill: parent
anchors.margins: 12
spacing: 8
anchors.margins: 12 * Theme.uiScale
spacing: 8 * Theme.uiScale
Text {
text: "refresh"
font.family: "Material Symbols Outlined"
font.pixelSize: 16
font.pixelSize: 16 * Theme.uiScale
color: rebootButtonArea.containsMouse ? Theme.onAccent : Theme.textPrimary
}
Text {
text: "Reboot"
font.family: Theme.fontFamily
font.pixelSize: 14
font.pixelSize: 14 * Theme.uiScale
color: rebootButtonArea.containsMouse ? Theme.onAccent : Theme.textPrimary
Layout.fillWidth: true
}
@ -319,25 +361,25 @@ Rectangle {
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 36
radius: 6
Layout.preferredHeight: 36 * Theme.uiScale
radius: 6 * Theme.uiScale
color: logoutButtonArea.containsMouse ? Theme.accentPrimary : "transparent"
RowLayout {
anchors.fill: parent
anchors.margins: 12
spacing: 8
anchors.margins: 12 * Theme.uiScale
spacing: 8 * Theme.uiScale
Text {
text: "exit_to_app"
font.family: "Material Symbols Outlined"
font.pixelSize: 16
font.pixelSize: 16 * Theme.uiScale
color: logoutButtonArea.containsMouse ? Theme.onAccent : Theme.textPrimary
}
Text {
text: "Logout"
font.pixelSize: 14
font.pixelSize: 14 * Theme.uiScale
color: logoutButtonArea.containsMouse ? Theme.onAccent : Theme.textPrimary
Layout.fillWidth: true
}
@ -360,25 +402,25 @@ Rectangle {
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 36
radius: 6
Layout.preferredHeight: 36 * Theme.uiScale
radius: 6 * Theme.uiScale
color: shutdownButtonArea.containsMouse ? Theme.accentPrimary : "transparent"
RowLayout {
anchors.fill: parent
anchors.margins: 12
spacing: 8
anchors.margins: 12 * Theme.uiScale
spacing: 8 * Theme.uiScale
Text {
text: "power_settings_new"
font.family: "Material Symbols Outlined"
font.pixelSize: 16
font.pixelSize: 16 * Theme.uiScale
color: shutdownButtonArea.containsMouse ? Theme.onAccent : Theme.textPrimary
}
Text {
text: "Shutdown"
font.pixelSize: 14
font.pixelSize: 14 * Theme.uiScale
color: shutdownButtonArea.containsMouse ? Theme.onAccent : Theme.textPrimary
Layout.fillWidth: true
}

View file

@ -7,22 +7,22 @@ import qs.Components
Rectangle {
id: card
width: 200
height: 70
width: 200 * Theme.uiScale
height: 70 * Theme.uiScale
color: Theme.surface
radius: 18
radius: 18 * Theme.uiScale
Row {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
spacing: 20
spacing: 20 * Theme.uiScale
Rectangle {
width: 36; height: 36
radius: 18
width: 36 * Theme.uiScale; height: 36 * Theme.uiScale
radius: 18 * Theme.uiScale
border.color: Theme.accentPrimary
border.width: 1
border.width: 1 * Theme.uiScale
color: (typeof PowerProfiles !== 'undefined' && PowerProfiles.profile === PowerProfile.Performance)
? Theme.accentPrimary
: (perfMouseArea.containsMouse ? Theme.accentPrimary : "transparent")
@ -33,7 +33,7 @@ Rectangle {
anchors.centerIn: parent
text: "speed"
font.family: "Material Symbols Outlined"
font.pixelSize: 22
font.pixelSize: 22 * Theme.uiScale
color: (typeof PowerProfiles !== 'undefined' && PowerProfiles.profile === PowerProfile.Performance) || perfMouseArea.containsMouse
? Theme.backgroundPrimary
: Theme.accentPrimary
@ -65,10 +65,10 @@ Rectangle {
Rectangle {
width: 36; height: 36
radius: 18
width: 36 * Theme.uiScale; height: 36 * Theme.uiScale
radius: 18 * Theme.uiScale
border.color: Theme.accentPrimary
border.width: 1
border.width: 1 * Theme.uiScale
color: (typeof PowerProfiles !== 'undefined' && PowerProfiles.profile === PowerProfile.Balanced)
? Theme.accentPrimary
: (balMouseArea.containsMouse ? Theme.accentPrimary : "transparent")
@ -79,7 +79,7 @@ Rectangle {
anchors.centerIn: parent
text: "balance"
font.family: "Material Symbols Outlined"
font.pixelSize: 22
font.pixelSize: 22 * Theme.uiScale
color: (typeof PowerProfiles !== 'undefined' && PowerProfiles.profile === PowerProfile.Balanced) || balMouseArea.containsMouse
? Theme.backgroundPrimary
: Theme.accentPrimary
@ -111,10 +111,10 @@ Rectangle {
Rectangle {
width: 36; height: 36
radius: 18
width: 36 * Theme.uiScale; height: 36 * Theme.uiScale
radius: 18 * Theme.uiScale
border.color: Theme.accentPrimary
border.width: 1
border.width: 1 * Theme.uiScale
color: (typeof PowerProfiles !== 'undefined' && PowerProfiles.profile === PowerProfile.PowerSaver)
? Theme.accentPrimary
: (saveMouseArea.containsMouse ? Theme.accentPrimary : "transparent")
@ -125,7 +125,7 @@ Rectangle {
anchors.centerIn: parent
text: "eco"
font.family: "Material Symbols Outlined"
font.pixelSize: 22
font.pixelSize: 22 * Theme.uiScale
color: (typeof PowerProfiles !== 'undefined' && PowerProfiles.profile === PowerProfile.PowerSaver) || saveMouseArea.containsMouse
? Theme.backgroundPrimary
: Theme.accentPrimary

View file

@ -10,8 +10,8 @@ import qs.Components
PanelWindow {
id: settingsModal
implicitWidth: 480
implicitHeight: 780
implicitWidth: 480 * Theme.uiScale
implicitHeight: 780 * Theme.uiScale
visible: false
color: "transparent"
anchors.top: true

View file

@ -10,8 +10,8 @@ import qs.Components
PanelWindow {
id: settingsModal
implicitWidth: 480
implicitHeight: 780
implicitWidth: 480 * Theme.uiScale
implicitHeight: 780 * Theme.uiScale
visible: false
color: "transparent"
anchors.top: true

View file

@ -8,8 +8,8 @@ import qs.Settings
Rectangle {
id: systemMonitor
width: 70
height: 250
width: 70 * Theme.uiScale
height: 250 * Theme.uiScale
color: "transparent"
// Track visibility state for panel integration
@ -19,26 +19,26 @@ Rectangle {
id: card
anchors.fill: parent
color: Theme.surface
radius: 18
radius: 18 * Theme.uiScale
ColumnLayout {
anchors.fill: parent
anchors.margins: 8
spacing: 12
anchors.margins: 8 * Theme.uiScale
spacing: 12 * Theme.uiScale
Layout.alignment: Qt.AlignVCenter
// CPU usage indicator with circular progress bar
Item {
width: 50; height: 50
width: 50 * Theme.uiScale; height: 50 * Theme.uiScale
CircularProgressBar {
id: cpuBar
progress: Sysinfo.cpuUsage / 100
size: 50
strokeWidth: 4
size: 50 * Theme.uiScale
strokeWidth: 4 * Theme.uiScale
hasNotch: true
notchIcon: "speed"
notchIconSize: 14
notchIconSize: 14 * Theme.uiScale
Layout.alignment: Qt.AlignHCenter
}
MouseArea {
@ -60,16 +60,16 @@ Rectangle {
// CPU temperature indicator with circular progress bar
Item {
width: 50; height: 50
width: 50 * Theme.uiScale; height: 50 * Theme.uiScale
CircularProgressBar {
id: tempBar
progress: Sysinfo.cpuTemp / 100
size: 50
strokeWidth: 4
size: 50 * Theme.uiScale
strokeWidth: 4 * Theme.uiScale
hasNotch: true
units: "°C"
notchIcon: "thermometer"
notchIconSize: 14
notchIconSize: 14 * Theme.uiScale
Layout.alignment: Qt.AlignHCenter
}
MouseArea {
@ -91,15 +91,15 @@ Rectangle {
// Memory usage indicator with circular progress bar
Item {
width: 50; height: 50
width: 50 * Theme.uiScale; height: 50 * Theme.uiScale
CircularProgressBar {
id: memBar
progress: Sysinfo.memoryUsagePer / 100
size: 50
strokeWidth: 4
size: 50 * Theme.uiScale
strokeWidth: 4 * Theme.uiScale
hasNotch: true
notchIcon: "memory"
notchIconSize: 14
notchIconSize: 14 * Theme.uiScale
Layout.alignment: Qt.AlignHCenter
}
MouseArea {
@ -121,15 +121,15 @@ Rectangle {
// Disk usage indicator with circular progress bar
Item {
width: 50; height: 50
width: 50 * Theme.uiScale; height: 50 * Theme.uiScale
CircularProgressBar {
id: diskBar
progress: Sysinfo.diskUsage / 100
size: 50
strokeWidth: 4
size: 50 * Theme.uiScale
strokeWidth: 4 * Theme.uiScale
hasNotch: true
notchIcon: "storage"
notchIconSize: 14
notchIconSize: 14 * Theme.uiScale
Layout.alignment: Qt.AlignHCenter
}
MouseArea {

View file

@ -6,8 +6,8 @@ import "../../Helpers/Weather.js" as WeatherHelper
Rectangle {
id: weatherRoot
width: 440
height: 180
width: 440 * Theme.uiScale
height: 180 * Theme.uiScale
color: "transparent"
anchors.horizontalCenterOffset: -2
@ -83,29 +83,29 @@ Rectangle {
id: card
anchors.fill: parent
color: Theme.surface
radius: 18
radius: 18 * Theme.uiScale
ColumnLayout {
anchors.fill: parent
anchors.margins: 18
spacing: 12
anchors.margins: 18 * Theme.uiScale
spacing: 12 * Theme.uiScale
RowLayout {
spacing: 12
spacing: 12 * Theme.uiScale
Layout.fillWidth: true
RowLayout {
spacing: 12
Layout.preferredWidth: 140
spacing: 12 * Theme.uiScale
Layout.preferredWidth: 140 * Theme.uiScale
Text {
id: weatherIcon
text: isLoading ? "sync" : (weatherData && weatherData.current_weather ? materialSymbolForCode(weatherData.current_weather.weathercode) : "cloud")
font.family: "Material Symbols Outlined"
font.pixelSize: 28
font.pixelSize: 28 * Theme.uiScale
verticalAlignment: Text.AlignVCenter
color: isLoading ? Theme.accentPrimary : Theme.accentPrimary
Layout.alignment: Qt.AlignVCenter
@ -121,28 +121,28 @@ Rectangle {
}
ColumnLayout {
spacing: 2
spacing: 2 * Theme.uiScale
RowLayout {
spacing: 4
spacing: 4 * Theme.uiScale
Text {
text: city
font.family: Theme.fontFamily
font.pixelSize: 14
font.pixelSize: 14 * Theme.uiScale
font.bold: true
color: Theme.textPrimary
}
Text {
text: weatherData && weatherData.timezone_abbreviation ? `(${weatherData.timezone_abbreviation})` : ""
font.family: Theme.fontFamily
font.pixelSize: 10
font.pixelSize: 10 * Theme.uiScale
color: Theme.textSecondary
leftPadding: 2
leftPadding: 2 * Theme.uiScale
}
}
Text {
text: weatherData && weatherData.current_weather ? ((Settings.settings.useFahrenheit !== undefined ? Settings.settings.useFahrenheit : false) ? `${Math.round(weatherData.current_weather.temperature * 9/5 + 32)}°F` : `${Math.round(weatherData.current_weather.temperature)}°C`) : ((Settings.settings.useFahrenheit !== undefined ? Settings.settings.useFahrenheit : false) ? "--°F" : "--°C")
font.family: Theme.fontFamily
font.pixelSize: 24
font.pixelSize: 24 * Theme.uiScale
font.bold: true
color: Theme.textPrimary
}
@ -157,16 +157,16 @@ Rectangle {
Rectangle {
width: parent.width
height: 1
height: 1 * Theme.uiScale
color: Qt.rgba(Theme.textSecondary.g, Theme.textSecondary.g, Theme.textSecondary.b, 0.12)
Layout.fillWidth: true
Layout.topMargin: 2
Layout.bottomMargin: 2
Layout.topMargin: 2 * Theme.uiScale
Layout.bottomMargin: 2 * Theme.uiScale
}
RowLayout {
spacing: 12
spacing: 12 * Theme.uiScale
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
visible: weatherData && weatherData.daily && weatherData.daily.time
@ -174,13 +174,13 @@ Rectangle {
Repeater {
model: weatherData && weatherData.daily && weatherData.daily.time ? 5 : 0
delegate: ColumnLayout {
spacing: 2
spacing: 2 * Theme.uiScale
Layout.alignment: Qt.AlignHCenter
Text {
text: Qt.formatDateTime(new Date(weatherData.daily.time[index]), "ddd")
font.family: Theme.fontFamily
font.pixelSize: 12
font.pixelSize: 12 * Theme.uiScale
color: Theme.textSecondary
horizontalAlignment: Text.AlignHCenter
Layout.alignment: Qt.AlignHCenter
@ -189,7 +189,7 @@ Rectangle {
text: materialSymbolForCode(weatherData.daily.weathercode[index])
font.family: "Material Symbols Outlined"
font.pixelSize: 22
font.pixelSize: 22 * Theme.uiScale
color: Theme.accentPrimary
horizontalAlignment: Text.AlignHCenter
Layout.alignment: Qt.AlignHCenter
@ -198,7 +198,7 @@ Rectangle {
text: weatherData && weatherData.daily ? ((Settings.settings.useFahrenheit !== undefined ? Settings.settings.useFahrenheit : false) ? `${Math.round(weatherData.daily.temperature_2m_max[index] * 9/5 + 32)}° / ${Math.round(weatherData.daily.temperature_2m_min[index] * 9/5 + 32)}°` : `${Math.round(weatherData.daily.temperature_2m_max[index])}° / ${Math.round(weatherData.daily.temperature_2m_min[index])}°`) : ((Settings.settings.useFahrenheit !== undefined ? Settings.settings.useFahrenheit : false) ? "--° / --°" : "--° / --°")
font.family: Theme.fontFamily
font.pixelSize: 12
font.pixelSize: 12 * Theme.uiScale
color: Theme.textPrimary
horizontalAlignment: Text.AlignHCenter
Layout.alignment: Qt.AlignHCenter
@ -213,7 +213,7 @@ Rectangle {
color: Theme.error
visible: errorString !== ""
font.family: Theme.fontFamily
font.pixelSize: 10
font.pixelSize: 10 * Theme.uiScale
horizontalAlignment: Text.AlignHCenter
Layout.alignment: Qt.AlignHCenter
}