Skip to content

Commit

Permalink
(fix) fixed night light component for Plasma 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SadColourfulHues committed Jun 21, 2024
1 parent 23907e7 commit ebcaac7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 30 deletions.
20 changes: 8 additions & 12 deletions package/contents/ui/components/RedShift.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,18 @@ Lib.CardButton {

Kirigami.Icon {
anchors.fill: parent
source: monitor.running ? "redshift-status-on" : "redshift-status-off"
}
onClicked: {
Funcs.toggleNightLight();
source: control.running ? "redshift-status-on" : "redshift-status-off"
}
onClicked: control.toggleInhibition()

// Components //

NightColorInhibitor {
id: inhibitor
}

NightColorMonitor {
id: redMonitor
/// Plasma 6.1 ///
NightLightControl {
id: control

readonly property bool transitioning: monitor.currentTemperature != monitor.targetTemperature
readonly property bool hasSwitchingTimes: monitor.mode != 3
readonly property bool transitioning: control.currentTemperature != control.targetTemperature
readonly property bool hasSwitchingTimes: control.mode != 3
readonly property bool togglable: !control.inhibited || control.inhibitedFromApplet
}
}
18 changes: 0 additions & 18 deletions package/contents/ui/js/funcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,6 @@ function toggleDoNotDisturb() {
notificationSettings.save()
}

function toggleNightLight() {
if (!monitor.available) {
return;
}

switch (inhibitor.state) {
case NightColorInhibitor.Inhibiting:
case NightColorInhibitor.Inhibited:
inhibitor.uninhibit();
break;

case NightColorInhibitor.Uninhibiting:
case NightColorInhibitor.Uninhibited:
inhibitor.inhibit();
break;
}
}

function volumePercent(volume) {
return volume / Vol.PulseAudio.NormalVolume * 100
}
Expand Down

0 comments on commit ebcaac7

Please sign in to comment.