feat: power toggle bar widget
This commit is contained in:
parent
5f1f3dce4a
commit
1f9c54438a
2 changed files with 25 additions and 0 deletions
21
Modules/Bar/Widgets/PowerToggle.qml
Normal file
21
Modules/Bar/Widgets/PowerToggle.qml
Normal 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)
|
||||||
|
}
|
||||||
|
|
@ -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 {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue