more on custom client

This commit is contained in:
rustdesk
2024-03-12 21:47:29 +08:00
parent f644053811
commit fc875f7ad6
13 changed files with 159 additions and 47 deletions

View File

@@ -1522,7 +1522,7 @@ class LastWindowPosition {
}
String get windowFramePrefix =>
bind.isQs() ? "${kWindowPrefix}qs_" : kWindowPrefix;
bind.isIncomingOnly() ? "${kWindowPrefix}qs_" : kWindowPrefix;
/// Save window position and size on exit
/// Note that windowId must be provided if it's subwindow
@@ -1793,11 +1793,11 @@ Future<bool> restoreWindowPosition(WindowType type,
}
if (lpos.isMaximized == true) {
await restorePos();
if (!bind.isQs()) {
if (!bind.isIncomingOnly()) {
await windowManager.maximize();
}
} else {
if (!bind.isQs()) {
if (!bind.isIncomingOnly()) {
await windowManager.setSize(size);
}
await restorePos();

View File

@@ -134,7 +134,7 @@ class _OnlineStatusWidgetState extends State<OnlineStatusWidget> {
)
],
)),
).paddingOnly(right: bind.isQs() ? 8 : 0);
).paddingOnly(right: bind.isIncomingOnly() ? 8 : 0);
}
updateStatus() async {

View File

@@ -58,7 +58,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
super.build(context);
final children = [buildLeftPane(context)];
if (!bind.isQs()) {
if (!bind.isIncomingOnly()) {
children.addAll([
const VerticalDivider(width: 1),
Expanded(child: buildRightPane(context)),
@@ -79,7 +79,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
future: buildHelpCards(),
builder: (_, data) {
if (data.hasData) {
if (bind.isQs()) {
if (bind.isIncomingOnly()) {
Future.delayed(Duration(milliseconds: 300), () {
_updateWindowSize();
});
@@ -92,7 +92,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
),
buildPluginEntry(),
];
if (bind.isQs()) {
if (bind.isIncomingOnly()) {
children.addAll([
Divider(),
Container(
@@ -104,7 +104,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
return ChangeNotifierProvider.value(
value: gFFI.serverModel,
child: Container(
width: bind.isQs() ? 280.0 : 200.0,
width: bind.isIncomingOnly() ? 280.0 : 200.0,
color: Theme.of(context).colorScheme.background,
child: DesktopScrollWrapper(
scrollController: _leftPaneScrollController,
@@ -474,7 +474,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
children: [
Container(
margin:
EdgeInsets.fromLTRB(0, marginTop, 0, bind.isQs() ? marginTop : 0),
EdgeInsets.fromLTRB(0, marginTop, 0, bind.isIncomingOnly() ? marginTop : 0),
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
@@ -693,7 +693,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
});
_uniLinksSubscription = listenUniLinks();
if (bind.isQs()) {
if (bind.isIncomingOnly()) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_updateWindowSize();
});

View File

@@ -112,7 +112,7 @@ class _DesktopSettingPageState extends State<DesktopSettingPage>
_TabInfo('Account', Icons.person_outline, Icons.person),
_TabInfo('About', Icons.info_outline, Icons.info)
];
if (!bind.isQs()) {
if (!bind.isIncomingOnly()) {
settingTabs.insert(
3,
_TabInfo('Display', Icons.desktop_windows_outlined,
@@ -133,7 +133,7 @@ class _DesktopSettingPageState extends State<DesktopSettingPage>
_Account(),
_About(),
];
if (!bind.isQs()) {
if (!bind.isIncomingOnly()) {
children.insert(3, _Display());
if (bind.pluginFeatureIsEnabled()) {
children.insert(4, _Plugin());
@@ -325,7 +325,7 @@ class _GeneralState extends State<_General> {
Widget other() {
final children = <Widget>[];
if (!bind.isQs()) {
if (!bind.isIncomingOnly()) {
children.add(_OptionCheckBox(context,
'Confirm before closing multiple tabs', 'enable-confirm-closing-tabs',
isServer: false));
@@ -334,7 +334,7 @@ class _GeneralState extends State<_General> {
_OptionCheckBox(context, 'Adaptive bitrate', 'enable-abr'),
wallpaper()
]);
if (!bind.isQs()) {
if (!bind.isIncomingOnly()) {
children.addAll([
_OptionCheckBox(
context,

View File

@@ -54,7 +54,7 @@ class _DesktopTabPageState extends State<DesktopTabPage> {
page: DesktopHomePage(
key: const ValueKey(kTabLabelHomePage),
)));
if (bind.isQs()) {
if (bind.isIncomingOnly()) {
tabController.onSelected = (key) {
if (key == kTabLabelHomePage) {
windowManager.setSize(getDesktopQsHomeSize());
@@ -81,7 +81,7 @@ class _DesktopTabPageState extends State<DesktopTabPage> {
body: DesktopTab(
controller: tabController,
tail: Offstage(
offstage: bind.isQs(),
offstage: bind.isIncomingOnly(),
child: ActionIcon(
message: 'Settings',
icon: IconFont.menu,

View File

@@ -165,7 +165,7 @@ class DesktopTabController {
}));
}
});
if ((isDesktop && bind.isQs()) || callOnSelected) {
if ((isDesktop && bind.isIncomingOnly()) || callOnSelected) {
if (state.value.tabs.length > index) {
final key = state.value.tabs[index].key;
onSelected?.call(key);

View File

@@ -142,7 +142,7 @@ void runMainApp(bool startService) async {
}
windowManager.setOpacity(1);
windowManager.setTitle(getWindowName());
windowManager.setResizable(!bind.isQs());
windowManager.setResizable(!bind.isIncomingOnly());
});
}