mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
niri: do screen transition when changing themes
This commit is contained in:
@@ -220,6 +220,7 @@ Singleton {
|
|||||||
saveSettings()
|
saveSettings()
|
||||||
|
|
||||||
if (typeof Theme !== "undefined") {
|
if (typeof Theme !== "undefined") {
|
||||||
|
Theme.screenTransition()
|
||||||
if (Theme.currentTheme === Theme.dynamic) {
|
if (Theme.currentTheme === Theme.dynamic) {
|
||||||
Theme.extractColors()
|
Theme.extractColors()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,12 @@ Singleton {
|
|||||||
property real widgetTransparency: typeof SettingsData !== "undefined" && SettingsData.topBarWidgetTransparency !== undefined ? SettingsData.topBarWidgetTransparency : 0.85
|
property real widgetTransparency: typeof SettingsData !== "undefined" && SettingsData.topBarWidgetTransparency !== undefined ? SettingsData.topBarWidgetTransparency : 0.85
|
||||||
property real popupTransparency: typeof SettingsData !== "undefined" && SettingsData.popupTransparency !== undefined ? SettingsData.popupTransparency : 0.92
|
property real popupTransparency: typeof SettingsData !== "undefined" && SettingsData.popupTransparency !== undefined ? SettingsData.popupTransparency : 0.92
|
||||||
|
|
||||||
|
function screenTransition() {
|
||||||
|
CompositorService.isNiri && NiriService.doScreenTransition()
|
||||||
|
}
|
||||||
|
|
||||||
function switchTheme(themeName, savePrefs = true) {
|
function switchTheme(themeName, savePrefs = true) {
|
||||||
|
screenTransition()
|
||||||
if (themeName === dynamic) {
|
if (themeName === dynamic) {
|
||||||
currentTheme = dynamic
|
currentTheme = dynamic
|
||||||
currentThemeCategory = dynamic
|
currentThemeCategory = dynamic
|
||||||
@@ -233,6 +238,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setLightMode(light, savePrefs = true) {
|
function setLightMode(light, savePrefs = true) {
|
||||||
|
screenTransition()
|
||||||
isLightMode = light
|
isLightMode = light
|
||||||
if (savePrefs && typeof SessionData !== "undefined")
|
if (savePrefs && typeof SessionData !== "undefined")
|
||||||
SessionData.setLightMode(isLightMode)
|
SessionData.setLightMode(isLightMode)
|
||||||
@@ -245,6 +251,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function forceGenerateSystemThemes() {
|
function forceGenerateSystemThemes() {
|
||||||
|
screenTransition()
|
||||||
if (!matugenAvailable) {
|
if (!matugenAvailable) {
|
||||||
if (typeof ToastService !== "undefined") {
|
if (typeof ToastService !== "undefined") {
|
||||||
ToastService.showWarning("matugen not available - cannot generate system themes")
|
ToastService.showWarning("matugen not available - cannot generate system themes")
|
||||||
@@ -296,6 +303,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadCustomTheme(themeData) {
|
function loadCustomTheme(themeData) {
|
||||||
|
screenTransition()
|
||||||
if (themeData.dark || themeData.light) {
|
if (themeData.dark || themeData.light) {
|
||||||
const colorMode = (typeof SessionData !== "undefined" && SessionData.isLightMode) ? "light" : "dark"
|
const colorMode = (typeof SessionData !== "undefined" && SessionData.isLightMode) ? "light" : "dark"
|
||||||
const selectedTheme = themeData[colorMode] || themeData.dark || themeData.light
|
const selectedTheme = themeData[colorMode] || themeData.dark || themeData.light
|
||||||
@@ -453,8 +461,6 @@ Singleton {
|
|||||||
if (currentTheme === "custom" && customThemeFileView.path) {
|
if (currentTheme === "custom" && customThemeFileView.path) {
|
||||||
customThemeFileView.reload()
|
customThemeFileView.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
generateSystemThemesFromCurrentTheme()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setDesiredTheme(kind, value, isLight, iconTheme) {
|
function setDesiredTheme(kind, value, isLight, iconTheme) {
|
||||||
|
|||||||
@@ -406,6 +406,16 @@ Singleton {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doScreenTransition() {
|
||||||
|
return send({
|
||||||
|
"Action": {
|
||||||
|
"DoScreenTransition": {
|
||||||
|
"delay_ms": 100,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function switchToWorkspace(workspaceIndex) {
|
function switchToWorkspace(workspaceIndex) {
|
||||||
return send({
|
return send({
|
||||||
"Action": {
|
"Action": {
|
||||||
|
|||||||
Reference in New Issue
Block a user