fix desktop dark mode
This commit is contained in:
parent
42f27922bf
commit
dd8812dd88
@ -118,7 +118,9 @@ void window_on_top(int? id) {
|
||||
windowManager.show();
|
||||
windowManager.focus();
|
||||
} else {
|
||||
WindowController.fromWindowId(id)..focus()..show();
|
||||
WindowController.fromWindowId(id)
|
||||
..focus()
|
||||
..show();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -479,6 +479,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
Get.changeTheme(MyTheme.lightTheme);
|
||||
}
|
||||
Get.find<SharedPreferences>().setString("darkTheme", choice);
|
||||
Get.forceAppUpdate();
|
||||
}
|
||||
|
||||
void onSelectMenu(String key) async {
|
||||
@ -489,7 +490,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
final option = await bind.mainGetOption(key: key);
|
||||
final choice = option == "Y" ? "" : "Y";
|
||||
bind.mainSetOption(key: key, value: choice);
|
||||
changeTheme(choice);
|
||||
if (key == "allow-darktheme") changeTheme(choice);
|
||||
} else if (key == "stop-service") {
|
||||
final option = await bind.mainGetOption(key: key);
|
||||
bind.mainSetOption(key: key, value: option == "Y" ? "" : "Y");
|
||||
@ -516,6 +517,8 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
bool enable;
|
||||
if (key == "stop-service") {
|
||||
enable = v != "Y";
|
||||
} else if (key.startsWith("allow-")) {
|
||||
enable = v == "Y";
|
||||
} else {
|
||||
enable = v != "N";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user