@@ -61,6 +61,9 @@ class GeneralSettingScreenState extends State<GeneralSettingScreen>
6161 String _cacheSize = "" ;
6262 String _logSize = "" ;
6363 bool inAppBrowser = ChewieHiveUtil .getBool (ChewieHiveUtil .inappWebviewKey);
64+ Locale ? _lastLocale;
65+
66+ late SelectionItemModel <int > _currentTrayOption;
6467
6568 @override
6669 void initState () {
@@ -69,6 +72,7 @@ class GeneralSettingScreenState extends State<GeneralSettingScreen>
6972 fetchReleases (false );
7073 getLogSize ();
7174 filterLocale ();
75+ _currentTrayOption = getTrayOption ();
7276 }
7377
7478 refreshLauchAtStartup () {
@@ -78,6 +82,17 @@ class GeneralSettingScreenState extends State<GeneralSettingScreen>
7882 });
7983 }
8084
85+ @override
86+ void didChangeDependencies () {
87+ super .didChangeDependencies ();
88+ final currentLocale = Localizations .localeOf (context);
89+ if (_lastLocale != currentLocale) {
90+ _lastLocale = currentLocale;
91+ _currentTrayOption = getTrayOption ();
92+ setState (() {});
93+ }
94+ }
95+
8196 @override
8297 @override
8398 Widget build (BuildContext context) {
@@ -245,11 +260,7 @@ class GeneralSettingScreenState extends State<GeneralSettingScreen>
245260 SelectionItemModel (S .current.exitApp, 1 ),
246261 ],
247262 hint: S .current.chooseCloseWindowOption,
248- selected: SelectionItemModel (
249- enableMinimizeToTray
250- ? S .current.minimizeToTray
251- : S .current.exitApp,
252- enableMinimizeToTray ? 0 : 1 ),
263+ selected: _currentTrayOption,
253264 onChanged: (item) {
254265 if (item? .value == 0 ) {
255266 setState (() {
@@ -284,6 +295,13 @@ class GeneralSettingScreenState extends State<GeneralSettingScreen>
284295 );
285296 }
286297
298+ SelectionItemModel <int > getTrayOption () {
299+ return SelectionItemModel (
300+ enableMinimizeToTray ? S .current.minimizeToTray : S .current.exitApp,
301+ enableMinimizeToTray ? 0 : 1 ,
302+ );
303+ }
304+
287305 _mobileSettings () {
288306 return SearchableCaptionItem (
289307 title: S .current.mobileSetting,
0 commit comments