mirror of
https://github.com/fmhy/edit.git
synced 2026-01-11 19:06:17 +00:00
Make Amoled Default (#4412)
* like attempt 4 uhghgh * ok got it to default to amoled, now just make it not fall back if u select another theme * attempt like 6? * 7 ufhfhfhf * yo kill evb rn * attempt like 9?
This commit is contained in:
@@ -40,7 +40,7 @@ export class ThemeHandler {
|
||||
// Load saved preferences
|
||||
const savedTheme = localStorage.getItem(STORAGE_KEY_THEME) || 'christmas'
|
||||
const savedMode = localStorage.getItem(STORAGE_KEY_MODE) as DisplayMode | null
|
||||
const savedAmoled = localStorage.getItem(STORAGE_KEY_AMOLED) === 'true'
|
||||
const savedAmoledPref = localStorage.getItem(STORAGE_KEY_AMOLED)
|
||||
|
||||
// Set theme
|
||||
if (themeRegistry[savedTheme]) {
|
||||
@@ -49,7 +49,7 @@ export class ThemeHandler {
|
||||
}
|
||||
|
||||
// Set amoled preference
|
||||
this.amoledEnabled.value = savedAmoled
|
||||
this.amoledEnabled.value = savedAmoledPref === null ? true : savedAmoledPref === 'true'
|
||||
|
||||
// Set mode
|
||||
if (savedMode) {
|
||||
@@ -60,6 +60,7 @@ export class ThemeHandler {
|
||||
this.state.value.currentMode = prefersDark ? 'dark' : 'light'
|
||||
}
|
||||
|
||||
|
||||
this.applyTheme()
|
||||
|
||||
// Listen for system theme changes (only if user hasn't set a preference)
|
||||
@@ -99,6 +100,11 @@ export class ThemeHandler {
|
||||
if (mode === 'dark') {
|
||||
root.classList.add('dark')
|
||||
}
|
||||
|
||||
// Remove amoled class if current mode is not 'dark'
|
||||
if (mode !== 'dark') {
|
||||
root.classList.remove('amoled')
|
||||
}
|
||||
}
|
||||
|
||||
private applyCSSVariables(colors: ModeColors, theme: Theme) {
|
||||
|
||||
Reference in New Issue
Block a user