mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-12 16:01:28 +03:00
confirm connection tab close
This commit is contained in:
@@ -10,6 +10,8 @@ import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart';
|
||||
import 'package:flutter_hbb/utils/multi_window_manager.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../mobile/widgets/dialog.dart';
|
||||
|
||||
class ConnectionTabPage extends StatefulWidget {
|
||||
final Map<String, dynamic> params;
|
||||
|
||||
@@ -37,6 +39,11 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
label: peerId,
|
||||
selectedIcon: selectedIcon,
|
||||
unselectedIcon: unselectedIcon,
|
||||
onTabCloseButton: () {
|
||||
debugPrint("onTabCloseButton");
|
||||
tabController.jumpBy(peerId);
|
||||
clientClose(ffi(peerId).dialogManager);
|
||||
},
|
||||
page: Obx(() => RemotePage(
|
||||
key: ValueKey(peerId),
|
||||
id: peerId,
|
||||
@@ -69,6 +76,11 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
label: id,
|
||||
selectedIcon: selectedIcon,
|
||||
unselectedIcon: unselectedIcon,
|
||||
onTabCloseButton: () {
|
||||
debugPrint("onTabCloseButton");
|
||||
tabController.jumpBy(id);
|
||||
clientClose(ffi(id).dialogManager);
|
||||
},
|
||||
page: Obx(() => RemotePage(
|
||||
key: ValueKey(id),
|
||||
id: id,
|
||||
@@ -95,7 +107,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
body: Obx(() => DesktopTab(
|
||||
controller: tabController,
|
||||
showTabBar: fullscreen.isFalse,
|
||||
onClose: () {
|
||||
onWindowCloseButton: () {
|
||||
tabController.clear();
|
||||
},
|
||||
tail: AddButton().paddingOnly(left: 10),
|
||||
|
||||
@@ -71,10 +71,10 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
|
||||
backgroundColor: MyTheme.color(context).bg,
|
||||
body: DesktopTab(
|
||||
controller: tabController,
|
||||
onClose: () {
|
||||
onWindowCloseButton: () {
|
||||
tabController.clear();
|
||||
},
|
||||
tail: AddButton().paddingOnly(left: 10),
|
||||
tail: const AddButton().paddingOnly(left: 10),
|
||||
)),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -78,7 +78,7 @@ class _PortForwardTabPageState extends State<PortForwardTabPage> {
|
||||
backgroundColor: MyTheme.color(context).bg,
|
||||
body: DesktopTab(
|
||||
controller: tabController,
|
||||
onClose: () {
|
||||
onWindowCloseButton: () {
|
||||
tabController.clear();
|
||||
},
|
||||
tail: AddButton().paddingOnly(left: 10),
|
||||
@@ -88,7 +88,6 @@ class _PortForwardTabPageState extends State<PortForwardTabPage> {
|
||||
}
|
||||
|
||||
void onRemoveId(String id) {
|
||||
ffi("pf_$id").close();
|
||||
if (tabController.state.value.tabs.isEmpty) {
|
||||
WindowController.fromWindowId(windowId()).hide();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user