Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rustdesk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李朝发
rustdesk
Commits
63cb816b
Commit
63cb816b
authored
Sep 08, 2022
by
csf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: close one connection tab will dispose all tabs (Obx)
parent
b93e59df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
63 deletions
+59
-63
connection_tab_page.dart
flutter/lib/desktop/pages/connection_tab_page.dart
+59
-63
No files found.
flutter/lib/desktop/pages/connection_tab_page.dart
View file @
63cb816b
...
...
@@ -44,12 +44,11 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
tabController
.
jumpBy
(
peerId
);
clientClose
(
ffi
(
peerId
).
dialogManager
);
},
page:
Obx
(()
=>
RemotePage
(
key:
ValueKey
(
peerId
),
id:
peerId
,
tabBarHeight:
fullscreen
.
isTrue
?
0
:
kDesktopRemoteTabBarHeight
,
))));
page:
RemotePage
(
key:
ValueKey
(
peerId
),
id:
peerId
,
tabBarHeight:
fullscreen
.
isTrue
?
0
:
kDesktopRemoteTabBarHeight
,
)));
}
}
...
...
@@ -81,12 +80,11 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
tabController
.
jumpBy
(
id
);
clientClose
(
ffi
(
id
).
dialogManager
);
},
page:
Obx
(()
=>
RemotePage
(
key:
ValueKey
(
id
),
id:
id
,
tabBarHeight:
fullscreen
.
isTrue
?
0
:
kDesktopRemoteTabBarHeight
,
))));
page:
RemotePage
(
key:
ValueKey
(
id
),
id:
id
,
tabBarHeight:
fullscreen
.
isTrue
?
0
:
kDesktopRemoteTabBarHeight
,
)));
}
else
if
(
call
.
method
==
"onDestroy"
)
{
tabController
.
clear
();
}
...
...
@@ -104,57 +102,55 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
border:
Border
.
all
(
color:
MyTheme
.
color
(
context
).
border
!)),
child:
Scaffold
(
backgroundColor:
MyTheme
.
color
(
context
).
bg
,
body:
Obx
(()
=>
DesktopTab
(
controller:
tabController
,
showTabBar:
fullscreen
.
isFalse
,
onWindowCloseButton:
()
{
tabController
.
clear
();
},
tail:
AddButton
().
paddingOnly
(
left:
10
),
pageViewBuilder:
(
pageView
)
{
WindowController
.
fromWindowId
(
windowId
())
.
setFullscreen
(
fullscreen
.
isTrue
);
return
pageView
;
},
tabBuilder:
(
key
,
icon
,
label
,
themeConf
)
=>
Obx
(()
{
final
connectionType
=
ConnectionTypeState
.
find
(
key
);
if
(!
connectionType
.
isValid
())
{
return
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
icon
,
label
,
],
);
}
else
{
final
msgDirect
=
translate
(
connectionType
.
direct
.
value
==
ConnectionType
.
strDirect
?
'Direct Connection'
:
'Relay Connection'
);
final
msgSecure
=
translate
(
connectionType
.
secure
.
value
==
ConnectionType
.
strSecure
?
'Secure Connection'
:
'Insecure Connection'
);
return
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
icon
,
Tooltip
(
message:
'
$msgDirect
\n
$msgSecure
'
,
child:
Image
.
asset
(
'assets/
${connectionType.secure.value}${connectionType.direct.value}
.png'
,
width:
themeConf
.
iconSize
,
height:
themeConf
.
iconSize
,
).
paddingOnly
(
right:
5
),
),
label
,
],
);
}
}),
))),
body:
DesktopTab
(
controller:
tabController
,
showTabBar:
fullscreen
.
isFalse
,
onWindowCloseButton:
()
{
tabController
.
clear
();
},
tail:
AddButton
().
paddingOnly
(
left:
10
),
pageViewBuilder:
(
pageView
)
{
WindowController
.
fromWindowId
(
windowId
())
.
setFullscreen
(
fullscreen
.
isTrue
);
return
pageView
;
},
tabBuilder:
(
key
,
icon
,
label
,
themeConf
)
=>
Obx
(()
{
final
connectionType
=
ConnectionTypeState
.
find
(
key
);
if
(!
connectionType
.
isValid
())
{
return
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
icon
,
label
,
],
);
}
else
{
final
msgDirect
=
translate
(
connectionType
.
direct
.
value
==
ConnectionType
.
strDirect
?
'Direct Connection'
:
'Relay Connection'
);
final
msgSecure
=
translate
(
connectionType
.
secure
.
value
==
ConnectionType
.
strSecure
?
'Secure Connection'
:
'Insecure Connection'
);
return
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
icon
,
Tooltip
(
message:
'
$msgDirect
\n
$msgSecure
'
,
child:
Image
.
asset
(
'assets/
${connectionType.secure.value}${connectionType.direct.value}
.png'
,
width:
themeConf
.
iconSize
,
height:
themeConf
.
iconSize
,
).
paddingOnly
(
right:
5
),
),
label
,
],
);
}
}),
)),
),
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment