ColorScheme: fix for predefined colorscheme not always applying after using matugen

This commit is contained in:
LemmyCook 2025-08-22 08:51:46 -04:00
parent 84f8735008
commit 7a826bf93f

View file

@ -78,7 +78,7 @@ Singleton {
} }
} }
writeColorsToDisk(variant) writeColorsToDisk(variant)
Logger.log("ColorScheme", "Applied color scheme:", path) Logger.log("ColorScheme", "Applying color scheme:", path)
} catch (e) { } catch (e) {
Logger.error("ColorScheme", "Failed to parse scheme JSON:", e) Logger.error("ColorScheme", "Failed to parse scheme JSON:", e)
} }
@ -90,7 +90,7 @@ Singleton {
id: colorsWriter id: colorsWriter
path: colorsJsonFilePath path: colorsJsonFilePath
onSaved: { onSaved: {
Logger.log("ColorScheme", "Colors saved") // Logger.log("ColorScheme", "Colors saved")
} }
JsonAdapter { JsonAdapter {
id: out id: out
@ -130,6 +130,9 @@ Singleton {
out.mOutline = pick(obj, "mOutline", "outline", out.mOutline) out.mOutline = pick(obj, "mOutline", "outline", out.mOutline)
out.mShadow = pick(obj, "mShadow", "shadow", out.mShadow) out.mShadow = pick(obj, "mShadow", "shadow", out.mShadow)
// Force a rewrite by updating the path
colorsWriter.path = ""
colorsWriter.path = colorsJsonFilePath
colorsWriter.writeAdapter() colorsWriter.writeAdapter()
} }