mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 11:06:57 +00:00
refact: custom client, more advanced settings (#8085)
* refact: custom client, more advanced settings Signed-off-by: fufesou <shuanglongchen@yeah.net> * feat: custom client, more advanced settings Signed-off-by: fufesou <shuanglongchen@yeah.net> --------- Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -27,12 +27,11 @@ import './popup_menu.dart';
|
||||
import './kb_layout_type_chooser.dart';
|
||||
|
||||
class ToolbarState {
|
||||
final kStoreKey = 'remoteMenubarState';
|
||||
late RxBool show;
|
||||
late RxBool _pin;
|
||||
|
||||
ToolbarState() {
|
||||
final s = bind.getLocalFlutterOption(k: kStoreKey);
|
||||
final s = bind.getLocalFlutterOption(k: kOptionRemoteMenubarState);
|
||||
if (s.isEmpty) {
|
||||
_initSet(false, false);
|
||||
return;
|
||||
@@ -53,8 +52,8 @@ class ToolbarState {
|
||||
|
||||
_initSet(bool s, bool p) {
|
||||
// Show remubar when connection is established.
|
||||
show =
|
||||
RxBool(bind.mainGetUserDefaultOption(key: kOptionCollapseToolbar) != 'Y');
|
||||
show = RxBool(
|
||||
bind.mainGetUserDefaultOption(key: kOptionCollapseToolbar) != 'Y');
|
||||
_pin = RxBool(p);
|
||||
}
|
||||
|
||||
@@ -86,7 +85,7 @@ class ToolbarState {
|
||||
|
||||
_savePin() async {
|
||||
bind.setLocalFlutterOption(
|
||||
k: kStoreKey, v: jsonEncode({'pin': _pin.value}));
|
||||
k: kOptionRemoteMenubarState, v: jsonEncode({'pin': _pin.value}));
|
||||
}
|
||||
|
||||
save() async {
|
||||
@@ -1875,7 +1874,7 @@ class _KeyboardMenu extends StatelessWidget {
|
||||
? (value) async {
|
||||
if (value == null) return;
|
||||
await bind.sessionToggleOption(
|
||||
sessionId: ffi.sessionId, value: kOptionViewOnly);
|
||||
sessionId: ffi.sessionId, value: kOptionToggleViewOnly);
|
||||
ffiModel.setViewOnly(id, value);
|
||||
}
|
||||
: null,
|
||||
@@ -2019,6 +2018,7 @@ class _VoiceCallMenu extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _RecordMenu extends StatelessWidget {
|
||||
const _RecordMenu({Key? key}) : super(key: key);
|
||||
|
||||
@@ -2372,18 +2372,18 @@ class _DraggableShowHideState extends State<_DraggableShowHide> {
|
||||
super.initState();
|
||||
|
||||
final confLeft = double.tryParse(
|
||||
bind.mainGetLocalOption(key: 'remote-menubar-drag-left'));
|
||||
bind.mainGetLocalOption(key: kOptionRemoteMenubarDragLeft));
|
||||
if (confLeft == null) {
|
||||
bind.mainSetLocalOption(
|
||||
key: 'remote-menubar-drag-left', value: left.toString());
|
||||
key: kOptionRemoteMenubarDragLeft, value: left.toString());
|
||||
} else {
|
||||
left = confLeft;
|
||||
}
|
||||
final confRight = double.tryParse(
|
||||
bind.mainGetLocalOption(key: 'remote-menubar-drag-right'));
|
||||
bind.mainGetLocalOption(key: kOptionRemoteMenubarDragRight));
|
||||
if (confRight == null) {
|
||||
bind.mainSetLocalOption(
|
||||
key: 'remote-menubar-drag-right', value: right.toString());
|
||||
key: kOptionRemoteMenubarDragRight, value: right.toString());
|
||||
} else {
|
||||
right = confRight;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user