dotfiles
bugabingas dorkfiles
owned by bugabinga
fix nuguland power popup proportions
91a1be81b5ddc775b28ae5553c828b769ea6ddf8
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (3)
quickshell/nuguland/PowerPanel.qml
Modified 18 18 readonly property var devices: panelState.externalDevices
|| []
19 19 readonly property
var sessionActions: panelState.sessionActions
|| [
"lock",
"suspend",
"monitor-off",
"monitor-on",
"logout",
"reboot",
"poweroff"]
20 20 readonly property bool hasMainBattery:
!!(battery
&& battery.present)
21 - readonly property
var safeActionNames: [
"lock",
"suspend",
"monitor-off",
"monitor-on"]
21 + readonly property
var safeActionNames: [
"lock",
"suspend",
"monitor-off"]
22 22 readonly property
var destructiveActionNames: [
"logout",
"reboot",
"poweroff"]
23 23 readonly property
var safeActions:
actionSubset(safeActionNames)
24 24 readonly property
var destructiveActions:
actionSubset(destructiveActionNames)
70 70 function actionLabel(action) {
71 + if (action
=== "suspend")
71 74 if (action
=== "monitor-off")
72 75 return "display off";
74 - if (action
=== "monitor-on")
75 - return "display on";
77 77 if (action
=== "poweroff")
78 78 return "power off";
216 216 objectName:
"safeActionGrid" 217 217 width: parent.width
quickshell/nuguland/SurfaceManager.qml
Modified 20 20 property int screenHeight:
0 21 21 property int barHeight:
34 22 22 property string orientation:
"horizontal" 23 + property
var powerService
23 24 readonly property bool vertical: orientation
=== "vertical" 24 25 property
var anchorRegistry: ({})
25 26 readonly property int closeRetentionMs:
0 60 61 return Math.min(maxHeight,
Math.
max(
220,
Number(wanted)));
64 + function powerContentSize() {
65 + const state
= powerService
? JSON.
parse(powerService.stateJson())
: ({
67 + "externalDevices": []
69 + const hasBattery
= !!(state.battery
&& state.battery.present);
70 + const hasDevices
= (state.externalDevices
|| []).length
> 0;
72 + "width": hasBattery
? 376 : 326,
73 + "height": hasBattery
? (hasDevices
? 334 : 290)
: (hasDevices
? 206 : 174)
63 77 function popoutContentSize(name) {
64 78 const width
= popoutWidth();
65 79 switch (
String(name)) {
122 136 "height":
heightBudget(
540)
127 - "height": heightBudget(
480)
139 + return powerContentSize();
quickshell/nuguland/shell.qml
Modified 158 158 id: surfaceManager
160 + powerService: power