Merge pull request #208 from ThatOneCalculator/feat/power-toggle-widget
feat: power toggle bar widget
This commit is contained in:
commit
4ea903b333
2 changed files with 27 additions and 0 deletions
23
Modules/Bar/Widgets/PowerToggle.qml
Normal file
23
Modules/Bar/Widgets/PowerToggle.qml
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
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: 1.0
|
||||||
|
|
||||||
|
sizeRatio: 0.8
|
||||||
|
|
||||||
|
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