mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
Fix initial light/dark mode state in cc
This commit is contained in:
@@ -539,7 +539,7 @@ Column {
|
|||||||
iconRotation: {
|
iconRotation: {
|
||||||
if (widgetData.id !== "darkMode") return 0
|
if (widgetData.id !== "darkMode") return 0
|
||||||
if (darkModeTransitionPending) {
|
if (darkModeTransitionPending) {
|
||||||
return SessionData.isLightMode ? 0 : 180
|
return SessionData.isLightMode ? 180 : 0
|
||||||
}
|
}
|
||||||
return SessionData.isLightMode ? 180 : 0
|
return SessionData.isLightMode ? 180 : 0
|
||||||
}
|
}
|
||||||
@@ -549,7 +549,7 @@ Column {
|
|||||||
case "nightMode":
|
case "nightMode":
|
||||||
return DisplayService.nightModeEnabled || false
|
return DisplayService.nightModeEnabled || false
|
||||||
case "darkMode":
|
case "darkMode":
|
||||||
return !SessionData.isLightMode
|
return SessionData.isLightMode
|
||||||
case "doNotDisturb":
|
case "doNotDisturb":
|
||||||
return SessionData.doNotDisturb || false
|
return SessionData.doNotDisturb || false
|
||||||
case "idleInhibitor":
|
case "idleInhibitor":
|
||||||
@@ -561,14 +561,6 @@ Column {
|
|||||||
|
|
||||||
enabled: !root.editMode
|
enabled: !root.editMode
|
||||||
|
|
||||||
onIconRotationCompleted: {
|
|
||||||
if (root.darkModeTransitionPending && widgetData.id === "darkMode") {
|
|
||||||
root.darkModeTransitionPending = false
|
|
||||||
Theme.screenTransition()
|
|
||||||
Theme.toggleLightMode()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (root.editMode)
|
if (root.editMode)
|
||||||
return
|
return
|
||||||
@@ -581,7 +573,7 @@ enabled: !root.editMode
|
|||||||
}
|
}
|
||||||
case "darkMode":
|
case "darkMode":
|
||||||
{
|
{
|
||||||
root.darkModeTransitionPending = true
|
Theme.setLightMode(!SessionData.isLightMode)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case "doNotDisturb":
|
case "doNotDisturb":
|
||||||
@@ -625,7 +617,7 @@ enabled: !root.editMode
|
|||||||
iconRotation: {
|
iconRotation: {
|
||||||
if (widgetData.id !== "darkMode") return 0
|
if (widgetData.id !== "darkMode") return 0
|
||||||
if (darkModeTransitionPending) {
|
if (darkModeTransitionPending) {
|
||||||
return SessionData.isLightMode ? 0 : 180
|
return SessionData.isLightMode ? 180 : 0
|
||||||
}
|
}
|
||||||
return SessionData.isLightMode ? 180 : 0
|
return SessionData.isLightMode ? 180 : 0
|
||||||
}
|
}
|
||||||
@@ -635,7 +627,7 @@ enabled: !root.editMode
|
|||||||
case "nightMode":
|
case "nightMode":
|
||||||
return DisplayService.nightModeEnabled || false
|
return DisplayService.nightModeEnabled || false
|
||||||
case "darkMode":
|
case "darkMode":
|
||||||
return !SessionData.isLightMode
|
return SessionData.isLightMode
|
||||||
case "doNotDisturb":
|
case "doNotDisturb":
|
||||||
return SessionData.doNotDisturb || false
|
return SessionData.doNotDisturb || false
|
||||||
case "idleInhibitor":
|
case "idleInhibitor":
|
||||||
@@ -647,14 +639,6 @@ enabled: !root.editMode
|
|||||||
|
|
||||||
enabled: !root.editMode
|
enabled: !root.editMode
|
||||||
|
|
||||||
onIconRotationCompleted: {
|
|
||||||
if (root.darkModeTransitionPending && widgetData.id === "darkMode") {
|
|
||||||
root.darkModeTransitionPending = false
|
|
||||||
Theme.screenTransition()
|
|
||||||
Theme.toggleLightMode()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (root.editMode)
|
if (root.editMode)
|
||||||
return
|
return
|
||||||
@@ -667,7 +651,7 @@ enabled: !root.editMode
|
|||||||
}
|
}
|
||||||
case "darkMode":
|
case "darkMode":
|
||||||
{
|
{
|
||||||
root.darkModeTransitionPending = true
|
Theme.setLightMode(!SessionData.isLightMode)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case "doNotDisturb":
|
case "doNotDisturb":
|
||||||
|
|||||||
Reference in New Issue
Block a user