4 changed files with 26 additions and 24 deletions
+1
View File
@@ -47,6 +47,7 @@ Column {
CustomText { CustomText {
Layout.fillWidth: true Layout.fillWidth: true
elide: CustomText.ElideRight
text: layout.modelData.model text: layout.modelData.model
} }
+5 -4
View File
@@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import QtQuick
import ZShell.Internal import ZShell.Internal
import ZShell.Config import ZShell.Config
import qs.Helpers import qs.Helpers
@@ -30,12 +31,12 @@ Scope {
Quickshell.execDetached(action); Quickshell.execDetached(action);
} }
LidWatcher { LidWatcher {
onAboutToSleep: root.lock.lock.locked = true onAboutToSleep: root.lock.lock.locked = true
} }
Variants { Variants {
model: Config.general.idle.timeouts model: Config.general.idle.timeouts.values
IdleMonitor { IdleMonitor {
required property var modelData required property var modelData
+15 -18
View File
@@ -73,20 +73,21 @@ Scope {
// mask: Region { item: inputPanel } // mask: Region { item: inputPanel }
Rectangle { CustomRect {
id: inputPanel id: inputPanel
anchors.centerIn: parent anchors.centerIn: parent
color: Colors.tPalette.m3surface color: Colors.tPalette.m3surface
implicitHeight: layout.childrenRect.height + 28 implicitHeight: layout.implicitHeight + layout.anchors.margins * 2
implicitWidth: layout.childrenRect.width + 32 implicitWidth: Math.max(layout.implicitWidth + layout.anchors.margins * 2, 450)
opacity: 0 opacity: 0
radius: Tokens.rounding.small * 2 radius: Tokens.rounding.small * 2
ColumnLayout { ColumnLayout {
id: layout id: layout
anchors.centerIn: parent anchors.fill: parent
anchors.margins: Tokens.padding.medium
RowLayout { RowLayout {
id: contentRow id: contentRow
@@ -147,8 +148,8 @@ Scope {
TextField { TextField {
id: passInput id: passInput
Layout.fillWidth: true
Layout.preferredHeight: 40 Layout.preferredHeight: 40
Layout.preferredWidth: contentColumn.implicitWidth
color: Colors.palette.m3onSurfaceVariant color: Colors.palette.m3onSurfaceVariant
echoMode: polkitAgent.flow?.responseVisible ? TextInput.Normal : TextInput.Password echoMode: polkitAgent.flow?.responseVisible ? TextInput.Normal : TextInput.Password
placeholderText: polkitAgent.flow?.failed ? " Incorrect Password" : " Input Password" placeholderText: polkitAgent.flow?.failed ? " Incorrect Password" : " Input Password"
@@ -189,7 +190,8 @@ Scope {
clip: true clip: true
color: Colors.tPalette.m3surfaceContainerLow color: Colors.tPalette.m3surfaceContainerLow
implicitHeight: 0 implicitHeight: 0
radius: 16 implicitWidth: textDetailsColumn.implicitWidth + textDetailsColumn.anchors.margins * 2
radius: Tokens.rounding.medium
visible: true visible: true
Behavior on open { Behavior on open {
@@ -197,7 +199,8 @@ Scope {
Anim { Anim {
property: "implicitHeight" property: "implicitHeight"
target: detailsPanel target: detailsPanel
to: !detailsPanel.open ? textDetailsColumn.childrenRect.height + 16 : 0 to: !detailsPanel.open ? textDetailsColumn.implicitHeight + Tokens.padding.small * 2 : 0
type: Anim.DefaultEffects
} }
Anim { Anim {
@@ -205,12 +208,6 @@ Scope {
target: textDetailsColumn target: textDetailsColumn
to: !detailsPanel.open ? 1 : 0 to: !detailsPanel.open ? 1 : 0
} }
Anim {
property: "scale"
target: textDetailsColumn
to: !detailsPanel.open ? 1 : 0.9
}
} }
} }
@@ -218,10 +215,9 @@ Scope {
id: textDetailsColumn id: textDetailsColumn
anchors.fill: parent anchors.fill: parent
anchors.margins: 8 anchors.margins: Tokens.padding.small
opacity: 0 opacity: 0
scale: 0.9 spacing: Tokens.spacing.small
spacing: 8
CustomText { CustomText {
text: `actionId: ${polkitAgent.flow?.actionId}` text: `actionId: ${polkitAgent.flow?.actionId}`
@@ -239,16 +235,17 @@ Scope {
Layout.preferredWidth: contentRow.implicitWidth Layout.preferredWidth: contentRow.implicitWidth
spacing: 8 spacing: 8
IconTextButton { IconButton {
id: detailsButton id: detailsButton
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
horizontalPadding: Tokens.padding.medium
icon: "info" icon: "info"
inactiveColor: Colors.palette.m3surfaceContainer inactiveColor: Colors.palette.m3surfaceContainer
inactiveOnColor: Colors.palette.m3onSurface inactiveOnColor: Colors.palette.m3onSurface
isRound: true isRound: true
shapeMorph: true shapeMorph: true
text: "Details" verticalPadding: Tokens.padding.medium
onClicked: { onClicked: {
panelWindow.detailsOpen = !panelWindow.detailsOpen; panelWindow.detailsOpen = !panelWindow.detailsOpen;
+5 -2
View File
@@ -163,6 +163,7 @@ void Gpu::tick() {
const Type t = type(); const Type t = type();
if (t == Generic) { if (t == Generic) {
readGenericUsage(); readGenericUsage();
readGenericMemory();
readGpuTemperature(); readGpuTemperature();
} else if (t == Nvidia) { } else if (t == Nvidia) {
startNvidiaUsage(); startNvidiaUsage();
@@ -334,8 +335,10 @@ void Gpu::startNvidiaUsage() {
const qreal usage = const qreal usage =
parts.at(0).trimmed().toDouble(&ok1) / 100.0; parts.at(0).trimmed().toDouble(&ok1) / 100.0;
const qreal temp = parts.at(1).trimmed().toDouble(&ok2); const qreal temp = parts.at(1).trimmed().toDouble(&ok2);
const qreal memUsed = parts.at(2).trimmed().toDouble(&ok3); const qreal memUsed =
const qreal memTotal = parts.at(3).trimmed().toDouble(&ok4); parts.at(2).trimmed().toDouble(&ok3) * 1024;
const qreal memTotal =
parts.at(3).trimmed().toDouble(&ok4) * 1024;
if (ok1 && std::abs(usage - m_percentage) > 0.0001) { if (ok1 && std::abs(usage - m_percentage) > 0.0001) {
m_percentage = usage; m_percentage = usage;