feat: usar a cor escolhida tal e qual e opcao de suavizar
- TatuPalette.scheme aceita softenPrimary e passa a usar a seed como primary, onPrimary por contraste e surfaceTint, em vez da paleta tonal do Material 3 - nova opcao AppSettings.softenThemeColor (default false, ou seja cor exacta) - interruptor 'Suavizar cor do tema' em Configuracoes > Aparencia, com l10n en/pt - a opcao e sincronizada via account data (soften_theme_color) e mantida localmente como fallback, tal como a cor do tema - setApplicationAccountColor e updateApplicationAccountConfig preservam o novo campo - um unico sync de account data actualiza cor e opcao - testes de serializacao e round-trip para o novo campo
This commit is contained in:
@@ -130,6 +130,13 @@ class SettingsStyleController extends State<SettingsStyle> {
|
||||
ThemeMode get currentTheme => ThemeController.of(context).themeMode;
|
||||
Color? get currentColor => ThemeController.of(context).primaryColor;
|
||||
|
||||
bool get softenThemeColor => ThemeController.of(context).softenPrimaryColor;
|
||||
|
||||
Future<void> setSoftenThemeColor(bool soften) async {
|
||||
await ThemeController.of(context).setSoftenPrimaryColor(soften);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
void switchTheme(ThemeMode? newTheme) {
|
||||
if (newTheme == null) return;
|
||||
switch (newTheme) {
|
||||
|
||||
@@ -136,6 +136,13 @@ class SettingsStyleView extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
SwitchListTile(
|
||||
secondary: const Icon(Icons.palette_outlined),
|
||||
title: Text(L10n.of(context).softenThemeColor),
|
||||
subtitle: Text(L10n.of(context).softenThemeColorSubtitle),
|
||||
value: controller.softenThemeColor,
|
||||
onChanged: controller.setSoftenThemeColor,
|
||||
),
|
||||
Divider(color: theme.dividerColor),
|
||||
ListTile(
|
||||
title: Text(
|
||||
|
||||
Reference in New Issue
Block a user