Files
z-bar-qt/Modules/HyprsunsetWidget.qml

37 lines
764 B
QML

import QtQuick
import qs.Components
import qs.Helpers
import ZShell.Config
import qs.Services
CustomRect {
id: root
property bool tempEnabled: Hyprsunset.enabled
color: root.tempEnabled ? Colors.palette.m3primary : Colors.tPalette.m3surfaceContainer
implicitHeight: Config.bar.height + Tokens.padding.smallest * 2
implicitWidth: implicitHeight
radius: Tokens.rounding.full
StateLayer {
onClicked: {
Hyprsunset.toggleNightLight();
Hyprsunset.manualToggle = true;
}
}
MaterialIcon {
anchors.centerIn: parent
animate: true
color: root.tempEnabled ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
fill: root.tempEnabled ? 1 : 0
text: root.tempEnabled ? "lightbulb" : "light_off"
Behavior on fill {
Anim {
}
}
}
}