diff --git a/.dart_tool/flutter_gen/gen_l10n/l10n.dart b/.dart_tool/flutter_gen/gen_l10n/l10n.dart index ea00e08be..bfad4aecf 100644 --- a/.dart_tool/flutter_gen/gen_l10n/l10n.dart +++ b/.dart_tool/flutter_gen/gen_l10n/l10n.dart @@ -371,7 +371,7 @@ abstract class S { /// No description provided for @deleteScripts. /// /// In en, this message translates to: - /// **'Delete scripts'** + /// **'Delete server scripts at the same time'** String get deleteScripts; /// No description provided for @deleteServers. diff --git a/.dart_tool/flutter_gen/gen_l10n/l10n_de.dart b/.dart_tool/flutter_gen/gen_l10n/l10n_de.dart index 4e7716fa5..9a98ee797 100644 --- a/.dart_tool/flutter_gen/gen_l10n/l10n_de.dart +++ b/.dart_tool/flutter_gen/gen_l10n/l10n_de.dart @@ -142,7 +142,7 @@ class SDe extends S { String get delete => 'Löschen'; @override - String get deleteScripts => 'Skripte löschen'; + String get deleteScripts => 'Gleichzeitiges Löschen von Server-Skripten'; @override String get deleteServers => 'Batch-Löschung von Servern'; diff --git a/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart b/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart index fd602602f..daf352071 100644 --- a/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart +++ b/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart @@ -142,7 +142,7 @@ class SEn extends S { String get delete => 'Delete'; @override - String get deleteScripts => 'Delete scripts'; + String get deleteScripts => 'Delete server scripts at the same time'; @override String get deleteServers => 'Batch delete servers'; diff --git a/.dart_tool/flutter_gen/gen_l10n/l10n_id.dart b/.dart_tool/flutter_gen/gen_l10n/l10n_id.dart index ef9818882..2a0c9c0f9 100644 --- a/.dart_tool/flutter_gen/gen_l10n/l10n_id.dart +++ b/.dart_tool/flutter_gen/gen_l10n/l10n_id.dart @@ -142,7 +142,7 @@ class SId extends S { String get delete => 'Menghapus'; @override - String get deleteScripts => 'Menghapus skrip'; + String get deleteScripts => 'Menghapus skrip server secara bersamaan'; @override String get deleteServers => 'Penghapusan server secara batch'; diff --git a/lib/app.dart b/lib/app.dart index a01640cb8..a3f37377e 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -39,10 +39,16 @@ class MyApp extends StatelessWidget { listenable: RebuildNodes.app, build: () { final tMode = Stores.setting.themeMode.fetch(); - final isAMOLED = tMode >= 0 && tMode <= ThemeMode.values.length - 1; // Issue #57 - // if not [ok] -> [AMOLED] mode, use [ThemeMode.dark] - final themeMode = isAMOLED ? ThemeMode.values[tMode] : ThemeMode.dark; + var themeMode = ThemeMode.system; + switch (tMode) { + case 1 || 2: + themeMode = ThemeMode.values[tMode]; + break; + case 3: + themeMode = ThemeMode.dark; + break; + } final locale = Stores.setting.locale.fetch().toLocale; final darkTheme = ThemeData( useMaterial3: true, @@ -62,7 +68,7 @@ class MyApp extends StatelessWidget { useMaterial3: true, colorSchemeSeed: primaryColor, ), - darkTheme: isAMOLED ? darkTheme : _getAmoledTheme(darkTheme), + darkTheme: tMode < 3 ? darkTheme : _getAmoledTheme(darkTheme), home: Stores.setting.fullScreen.fetch() ? const FullScreenPage() : const HomePage(), diff --git a/lib/data/store/setting.dart b/lib/data/store/setting.dart index ab53ea5a1..3402c3ef8 100644 --- a/lib/data/store/setting.dart +++ b/lib/data/store/setting.dart @@ -82,7 +82,7 @@ class SettingStore extends PersistentStore { // Max retry count when connect to server late final maxRetryCount = StoreProperty(box, 'maxRetryCount', 2); - // Night mode: 0 -> auto, 1 -> light, 2 -> dark + // Night mode: 0 -> auto, 1 -> light, 2 -> dark, 3 -> AMOLED, 4 -> AUTO-AMOLED late final themeMode = StoreProperty(box, 'themeMode', 0); // Font file path diff --git a/lib/view/page/setting/entry.dart b/lib/view/page/setting/entry.dart index 406d44a9e..1040fa596 100644 --- a/lib/view/page/setting/entry.dart +++ b/lib/view/page/setting/entry.dart @@ -480,8 +480,15 @@ class _SettingPageState extends State { .toList(); // Issue #57 final len = ThemeMode.values.length; + + /// Add AMOLED theme items.add(PopupMenuItem(value: len, child: Text(_buildThemeModeStr(len)))); + /// Add AUTO-AMOLED theme + items.add( + PopupMenuItem(value: len + 1, child: Text(_buildThemeModeStr(len + 1))), + ); + return ListTile( title: Text( l10n.themeMode, @@ -518,6 +525,8 @@ class _SettingPageState extends State { return l10n.dark; case 3: return 'AMOLED'; + case 4: + return '${l10n.auto} AMOLED'; default: return l10n.auto; }