Merge pull request #210 from ThatOneCalculator/feat/caffeine-widget
feat: keep awake bar widget
This commit is contained in:
commit
5d11e37687
2 changed files with 28 additions and 0 deletions
24
Modules/Bar/Widgets/KeepAwake.qml
Normal file
24
Modules/Bar/Widgets/KeepAwake.qml
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
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: "coffee"
|
||||||
|
tooltipText: IdleInhibitorService.isInhibited ? "Disable keep awake" : "Enable keep awake"
|
||||||
|
colorBg: Color.mSurfaceVariant
|
||||||
|
colorFg: IdleInhibitorService.isInhibited ? Color.mPrimary : Color.mOnSurface
|
||||||
|
colorBorder: Color.transparent
|
||||||
|
onClicked: {
|
||||||
|
IdleInhibitorService.manualToggle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,7 @@ Singleton {
|
||||||
"Clock": clockComponent,
|
"Clock": clockComponent,
|
||||||
"CustomButton": customButtonComponent,
|
"CustomButton": customButtonComponent,
|
||||||
"DarkModeToggle": darkModeToggle,
|
"DarkModeToggle": darkModeToggle,
|
||||||
|
"KeepAwake": keepAwakeComponent,
|
||||||
"KeyboardLayout": keyboardLayoutComponent,
|
"KeyboardLayout": keyboardLayoutComponent,
|
||||||
"MediaMini": mediaMiniComponent,
|
"MediaMini": mediaMiniComponent,
|
||||||
"Microphone": microphoneComponent,
|
"Microphone": microphoneComponent,
|
||||||
|
|
@ -73,6 +74,9 @@ Singleton {
|
||||||
property Component keyboardLayoutComponent: Component {
|
property Component keyboardLayoutComponent: Component {
|
||||||
KeyboardLayout {}
|
KeyboardLayout {}
|
||||||
}
|
}
|
||||||
|
property Component keepAwakeComponent: Component {
|
||||||
|
KeepAwake {}
|
||||||
|
}
|
||||||
property Component mediaMiniComponent: Component {
|
property Component mediaMiniComponent: Component {
|
||||||
MediaMini {}
|
MediaMini {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue