mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 16:02:51 -05:00
minor tweaks
This commit is contained in:
@@ -614,6 +614,13 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
color: Theme.outline
|
||||||
|
opacity: 0.2
|
||||||
|
}
|
||||||
|
|
||||||
DankToggle {
|
DankToggle {
|
||||||
id: nightModeToggle
|
id: nightModeToggle
|
||||||
|
|
||||||
@@ -652,18 +659,11 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Theme.outline
|
|
||||||
opacity: 0.2
|
|
||||||
}
|
|
||||||
|
|
||||||
DankToggle {
|
DankToggle {
|
||||||
id: automaticToggle
|
id: automaticToggle
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: "Automatic Control"
|
text: "Automatic Control"
|
||||||
description: "Let the system automatically turn night mode on and off"
|
description: "Only adjust gamma based on time or location rules."
|
||||||
checked: SessionData.nightModeAutoEnabled
|
checked: SessionData.nightModeAutoEnabled
|
||||||
onToggled: (checked) => {
|
onToggled: (checked) => {
|
||||||
SessionData.setNightModeAutoEnabled(checked);
|
SessionData.setNightModeAutoEnabled(checked);
|
||||||
|
|||||||
@@ -341,8 +341,7 @@ Singleton {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const now = new Date()
|
const currentTime = systemClock.hours * 60 + systemClock.minutes
|
||||||
const currentTime = now.getHours() * 60 + now.getMinutes()
|
|
||||||
|
|
||||||
const startMinutes = SessionData.nightModeStartHour * 60 + SessionData.nightModeStartMinute
|
const startMinutes = SessionData.nightModeStartHour * 60 + SessionData.nightModeStartMinute
|
||||||
const endMinutes = SessionData.nightModeEndHour * 60 + SessionData.nightModeEndMinute
|
const endMinutes = SessionData.nightModeEndHour * 60 + SessionData.nightModeEndMinute
|
||||||
@@ -371,13 +370,10 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setNightModeAutomationMode(mode) {
|
function setNightModeAutomationMode(mode) {
|
||||||
console.log("DisplayService: Setting night mode automation mode to:", mode)
|
|
||||||
SessionData.setNightModeAutoMode(mode)
|
SessionData.setNightModeAutoMode(mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
function evaluateNightMode() {
|
function evaluateNightMode() {
|
||||||
console.log("DisplayService: Evaluating night mode state - enabled:", nightModeEnabled, "auto:", SessionData.nightModeAutoEnabled)
|
|
||||||
|
|
||||||
// Always stop all processes first to clean slate
|
// Always stop all processes first to clean slate
|
||||||
stopAutomation()
|
stopAutomation()
|
||||||
|
|
||||||
@@ -424,6 +420,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SystemClock {
|
SystemClock {
|
||||||
|
id: systemClock
|
||||||
precision: SystemClock.Minutes
|
precision: SystemClock.Minutes
|
||||||
onDateChanged: {
|
onDateChanged: {
|
||||||
if (nightModeEnabled && SessionData.nightModeAutoEnabled && SessionData.nightModeAutoMode === "time") {
|
if (nightModeEnabled && SessionData.nightModeAutoEnabled && SessionData.nightModeAutoMode === "time") {
|
||||||
@@ -441,7 +438,6 @@ Singleton {
|
|||||||
onExited: function (exitCode) {
|
onExited: function (exitCode) {
|
||||||
ddcAvailable = (exitCode === 0)
|
ddcAvailable = (exitCode === 0)
|
||||||
if (ddcAvailable) {
|
if (ddcAvailable) {
|
||||||
console.log("DisplayService: ddcutil detected")
|
|
||||||
ddcDisplayDetectionProcess.running = true
|
ddcDisplayDetectionProcess.running = true
|
||||||
} else {
|
} else {
|
||||||
console.log("DisplayService: ddcutil not available")
|
console.log("DisplayService: ddcutil not available")
|
||||||
@@ -458,7 +454,6 @@ Singleton {
|
|||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
if (!text.trim()) {
|
if (!text.trim()) {
|
||||||
console.log("DisplayService: No DDC displays found")
|
|
||||||
ddcDevices = []
|
ddcDevices = []
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -718,7 +713,6 @@ Singleton {
|
|||||||
onExited: function(exitCode) {
|
onExited: function(exitCode) {
|
||||||
automationAvailable = (exitCode === 0)
|
automationAvailable = (exitCode === 0)
|
||||||
if (automationAvailable) {
|
if (automationAvailable) {
|
||||||
console.log("DisplayService: gammastep available")
|
|
||||||
detectLocationProviders()
|
detectLocationProviders()
|
||||||
|
|
||||||
// If night mode should be enabled on startup
|
// If night mode should be enabled on startup
|
||||||
|
|||||||
Reference in New Issue
Block a user