feat: power toggle bar widget

This commit is contained in:
Kainoa Kanter 2025-09-04 12:00:17 -07:00
parent 5f1f3dce4a
commit 1f9c54438a
No known key found for this signature in database
GPG key ID: 8703CACD01000000
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,21 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import qs.Commons
import qs.Services
import qs.Widgets
NIconButton {
id: root
property ShellScreen screen
property real scaling: ScalingService.scale(screen)
icon: "power_settings_new"
tooltipText: "Power Settings"
colorBg: Color.mSurfaceVariant
colorFg: Color.mError
colorBorder: Color.transparent
colorBorderHover: Color.transparent
onClicked: PanelService.getPanel("powerPanel")?.toggle(screen)
}

View file

@ -24,6 +24,7 @@ Singleton {
"NightLight": nightLightComponent, "NightLight": nightLightComponent,
"NotificationHistory": notificationHistoryComponent, "NotificationHistory": notificationHistoryComponent,
"PowerProfile": powerProfileComponent, "PowerProfile": powerProfileComponent,
"PowerToggle": powerToggleComponent,
"ScreenRecorderIndicator": screenRecorderIndicatorComponent, "ScreenRecorderIndicator": screenRecorderIndicatorComponent,
"SidePanelToggle": sidePanelToggleComponent, "SidePanelToggle": sidePanelToggleComponent,
"SystemMonitor": systemMonitorComponent, "SystemMonitor": systemMonitorComponent,
@ -87,6 +88,9 @@ Singleton {
property Component powerProfileComponent: Component { property Component powerProfileComponent: Component {
PowerProfile {} PowerProfile {}
} }
property Component powerToggleComponent: Component {
PowerToggle {}
}
property Component screenRecorderIndicatorComponent: Component { property Component screenRecorderIndicatorComponent: Component {
ScreenRecorderIndicator {} ScreenRecorderIndicator {}
} }