mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 14:59:02 +08:00
fix theme radio update (#9647)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
ae1c1a56e6
commit
55187e9243
@ -555,7 +555,7 @@ class MyTheme {
|
||||
return themeModeFromString(bind.mainGetLocalOption(key: kCommConfKeyTheme));
|
||||
}
|
||||
|
||||
static void changeDarkMode(ThemeMode mode) async {
|
||||
static Future<void> changeDarkMode(ThemeMode mode) async {
|
||||
Get.changeThemeMode(mode);
|
||||
if (desktopType == DesktopType.main || isAndroid || isIOS || isWeb) {
|
||||
if (mode == ThemeMode.system) {
|
||||
|
@ -369,8 +369,8 @@ class _GeneralState extends State<_General> {
|
||||
|
||||
Widget theme() {
|
||||
final current = MyTheme.getThemeModePreference().toShortString();
|
||||
onChanged(String value) {
|
||||
MyTheme.changeDarkMode(MyTheme.themeModeFromString(value));
|
||||
onChanged(String value) async {
|
||||
await MyTheme.changeDarkMode(MyTheme.themeModeFromString(value));
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
|
@ -507,7 +507,7 @@ _registerEventHandler() {
|
||||
platformFFI.registerEventHandler('theme', 'theme', (evt) async {
|
||||
String? dark = evt['dark'];
|
||||
if (dark != null) {
|
||||
MyTheme.changeDarkMode(MyTheme.themeModeFromString(dark));
|
||||
await MyTheme.changeDarkMode(MyTheme.themeModeFromString(dark));
|
||||
}
|
||||
});
|
||||
platformFFI.registerEventHandler('language', 'language', (_) async {
|
||||
|
Loading…
Reference in New Issue
Block a user