tmp commit

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-11-28 23:57:48 +08:00
parent 19e8ca6c06
commit f11104fcb5
49 changed files with 296 additions and 46 deletions

View File

@@ -5,12 +5,12 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../consts.dart';
import './platform_model.dart';
enum SvcStatus { notReady, connecting, ready }
class StateGlobal {
int _windowId = -1;
bool grabKeyboard = false;
final RxBool _fullscreen = false.obs;
bool _isMinimized = false;
final RxBool isMaximized = false.obs;
@@ -22,6 +22,8 @@ class StateGlobal {
// Only used for macOS
bool? closeOnFullscreen;
String _inputSource = '';
// Use for desktop -> remote toolbar -> resolution
final Map<String, Map<int, String?>> _lastResolutionGroupValues = {};
@@ -94,6 +96,18 @@ class StateGlobal {
}
}
String getInputSource({bool force = false}) {
if (force || _inputSource.isEmpty) {
_inputSource = bind.mainGetLocalOption(key: kOptionInputSource);
}
return _inputSource;
}
void setInputSource(String v) async {
await bind.mainSetLocalOption(key: kOptionInputSource, value: v);
_inputSource = bind.mainGetLocalOption(key: kOptionInputSource);
}
StateGlobal._();
static final StateGlobal instance = StateGlobal._();