mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
33 lines
1.0 KiB
QML
33 lines
1.0 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import Quickshell
|
|
import Quickshell.Services.UPower
|
|
import qs.Commons
|
|
import qs.Services.Power
|
|
import qs.Services.UI
|
|
import qs.Widgets
|
|
|
|
NIconButton {
|
|
id: root
|
|
|
|
property ShellScreen screen
|
|
|
|
baseSize: Style.capsuleHeight
|
|
applyUiScale: false
|
|
customRadius: Style.radiusL
|
|
visible: PowerProfileService.available
|
|
icon: PowerProfileService.getIcon()
|
|
tooltipText: I18n.tr("tooltips.power-profile", {
|
|
"profile": PowerProfileService.getName()
|
|
})
|
|
tooltipDirection: BarService.getTooltipDirection()
|
|
colorBg: (PowerProfileService.profile === PowerProfile.Balanced) ? Style.capsuleColor : Color.mPrimary
|
|
colorFg: (PowerProfileService.profile === PowerProfile.Balanced) ? Color.mOnSurface : Color.mOnPrimary
|
|
colorBorder: "transparent"
|
|
colorBorderHover: "transparent"
|
|
border.color: Style.capsuleBorderColor
|
|
border.width: Style.capsuleBorderWidth
|
|
onClicked: PowerProfileService.cycleProfile()
|
|
onRightClicked: PowerProfileService.cycleProfileReverse()
|
|
}
|