mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 02:57:22 +00:00
windows, custom resolution
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -12,12 +12,14 @@ class StateGlobal {
|
||||
bool _maximize = false;
|
||||
bool grabKeyboard = false;
|
||||
final RxBool _showTabBar = true.obs;
|
||||
final RxBool _showResizeEdge = true.obs;
|
||||
final RxDouble _resizeEdgeSize = RxDouble(kWindowEdgeSize);
|
||||
final RxDouble _windowBorderWidth = RxDouble(kWindowBorderWidth);
|
||||
final RxBool showRemoteMenuBar = false.obs;
|
||||
final RxInt displaysCount = 0.obs;
|
||||
|
||||
// Use for desktop -> remote toolbar -> resolution
|
||||
final Map<String, Map<int, String?>> _lastResolutionGroupValues = {};
|
||||
|
||||
int get windowId => _windowId;
|
||||
bool get fullscreen => _fullscreen;
|
||||
bool get maximize => _maximize;
|
||||
@@ -26,6 +28,22 @@ class StateGlobal {
|
||||
RxDouble get resizeEdgeSize => _resizeEdgeSize;
|
||||
RxDouble get windowBorderWidth => _windowBorderWidth;
|
||||
|
||||
resetLastResolutionGroupValues(String peerId) {
|
||||
_lastResolutionGroupValues[peerId] = {};
|
||||
}
|
||||
|
||||
setLastResolutionGroupValue(
|
||||
String peerId, int currentDisplay, String? value) {
|
||||
if (!_lastResolutionGroupValues.containsKey(peerId)) {
|
||||
_lastResolutionGroupValues[peerId] = {};
|
||||
}
|
||||
_lastResolutionGroupValues[peerId]![currentDisplay] = value;
|
||||
}
|
||||
|
||||
String? getLastResolutionGroupValue(String peerId, int currentDisplay) {
|
||||
return _lastResolutionGroupValues[peerId]?[currentDisplay];
|
||||
}
|
||||
|
||||
setWindowId(int id) => _windowId = id;
|
||||
setMaximize(bool v) {
|
||||
if (_maximize != v && !_fullscreen) {
|
||||
@@ -33,12 +51,12 @@ class StateGlobal {
|
||||
_resizeEdgeSize.value = _maximize ? kMaximizeEdgeSize : kWindowEdgeSize;
|
||||
}
|
||||
}
|
||||
|
||||
setFullscreen(bool v) {
|
||||
if (_fullscreen != v) {
|
||||
_fullscreen = v;
|
||||
_showTabBar.value = !_fullscreen;
|
||||
_resizeEdgeSize.value =
|
||||
fullscreen
|
||||
_resizeEdgeSize.value = fullscreen
|
||||
? kFullScreenEdgeSize
|
||||
: _maximize
|
||||
? kMaximizeEdgeSize
|
||||
|
||||
Reference in New Issue
Block a user