fix(theme): disable dynamic colors by default to preserve curated preset aesthetics (#1054)
This commit is contained in:
6 files changed
+7
-7
No files matched your search
@@ -55,7 +55,7 @@ class ServerStoreMigration(
|
|||||||
runCatching { ThemePreference.valueOf(themePrefString!!) }
|
runCatching { ThemePreference.valueOf(themePrefString!!) }
|
||||||
.getOrDefault(ThemePreference.SYSTEM)
|
.getOrDefault(ThemePreference.SYSTEM)
|
||||||
|
|
||||||
val useDynamicColors = prefs.getBoolean("use_dynamic_colors", true)
|
val useDynamicColors = prefs.getBoolean("use_dynamic_colors", false)
|
||||||
|
|
||||||
val themePresetString = prefs.getString("theme_preset", ThemePreset.DEFAULT.name)
|
val themePresetString = prefs.getString("theme_preset", ThemePreset.DEFAULT.name)
|
||||||
val themePreset =
|
val themePreset =
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ data class ServerStoreState(
|
|||||||
val baseUrl: String? = null,
|
val baseUrl: String? = null,
|
||||||
val autoReconnect: Boolean = true,
|
val autoReconnect: Boolean = true,
|
||||||
val themePreference: ThemePreference = ThemePreference.SYSTEM,
|
val themePreference: ThemePreference = ThemePreference.SYSTEM,
|
||||||
val useDynamicColors: Boolean = true,
|
val useDynamicColors: Boolean = false,
|
||||||
val themePreset: ThemePreset = ThemePreset.DEFAULT,
|
val themePreset: ThemePreset = ThemePreset.DEFAULT,
|
||||||
val connectionProfiles: List<ConnectionProfile> = emptyList(),
|
val connectionProfiles: List<ConnectionProfile> = emptyList(),
|
||||||
val selectedProfileId: String? = null,
|
val selectedProfileId: String? = null,
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ object AuthManager {
|
|||||||
private val _themePreferenceFlow = MutableStateFlow<ThemePreference>(ThemePreference.SYSTEM)
|
private val _themePreferenceFlow = MutableStateFlow<ThemePreference>(ThemePreference.SYSTEM)
|
||||||
val themePreferenceFlow: StateFlow<ThemePreference> = _themePreferenceFlow.asStateFlow()
|
val themePreferenceFlow: StateFlow<ThemePreference> = _themePreferenceFlow.asStateFlow()
|
||||||
|
|
||||||
private val _useDynamicColorsFlow = MutableStateFlow<Boolean>(true)
|
private val _useDynamicColorsFlow = MutableStateFlow<Boolean>(false)
|
||||||
val useDynamicColorsFlow: StateFlow<Boolean> = _useDynamicColorsFlow.asStateFlow()
|
val useDynamicColorsFlow: StateFlow<Boolean> = _useDynamicColorsFlow.asStateFlow()
|
||||||
|
|
||||||
private val _themePresetFlow = MutableStateFlow<ThemePreset>(ThemePreset.DEFAULT)
|
private val _themePresetFlow = MutableStateFlow<ThemePreset>(ThemePreset.DEFAULT)
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ private fun themeFor(preset: ThemePreset): ThemePalette = when (preset) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Dynamic (Material You) color on API 31+ overrides the preset scheme when
|
Dynamic (Material You) color on API 31+ can optionally override the preset scheme when
|
||||||
`useDynamicColors = true`. Semantic status colors are always resolved from the
|
`useDynamicColors = true` (defaults to `false`). Semantic status colors are always resolved from the
|
||||||
active preset via `LocalHermesStatusColors`.
|
active preset via `LocalHermesStatusColors`.
|
||||||
|
|
||||||
## Adding a new theme
|
## Adding a new theme
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ internal fun resolveStatusColors(
|
|||||||
@Composable
|
@Composable
|
||||||
fun HermesControlTheme(
|
fun HermesControlTheme(
|
||||||
themePreference: ThemePreference = LocalThemePreference.current,
|
themePreference: ThemePreference = LocalThemePreference.current,
|
||||||
useDynamicColors: Boolean = true,
|
useDynamicColors: Boolean = false,
|
||||||
themePreset: ThemePreset = ThemePreset.DEFAULT,
|
themePreset: ThemePreset = ThemePreset.DEFAULT,
|
||||||
chatFontScale: Float = LocalChatFontScale.current,
|
chatFontScale: Float = LocalChatFontScale.current,
|
||||||
content: @Composable () -> Unit,
|
content: @Composable () -> Unit,
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ data class SettingsUiState(
|
|||||||
val token: String = "",
|
val token: String = "",
|
||||||
val autoReconnect: Boolean = true,
|
val autoReconnect: Boolean = true,
|
||||||
val themePreference: ThemePreference = ThemePreference.SYSTEM,
|
val themePreference: ThemePreference = ThemePreference.SYSTEM,
|
||||||
val useDynamicColors: Boolean = true,
|
val useDynamicColors: Boolean = false,
|
||||||
val themePreset: ThemePreset = ThemePreset.DEFAULT,
|
val themePreset: ThemePreset = ThemePreset.DEFAULT,
|
||||||
val isTesting: Boolean = false,
|
val isTesting: Boolean = false,
|
||||||
val testResult: String? = null,
|
val testResult: String? = null,
|
||||||
|
|||||||
Reference in new issue
Block a user