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
725c0689
Commit
725c0689
authored
Sep 21, 2022
by
csf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mobile id text format
parent
285d415a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
13 deletions
+15
-13
peercard_widget.dart
flutter/lib/common/widgets/peercard_widget.dart
+1
-1
connection_page.dart
flutter/lib/desktop/pages/connection_page.dart
+3
-3
connection_page.dart
flutter/lib/mobile/pages/connection_page.dart
+11
-9
No files found.
flutter/lib/common/widgets/peercard_widget.dart
View file @
725c0689
...
...
@@ -77,7 +77,7 @@ class _PeerCardState extends State<_PeerCard>
child:
ListTile
(
contentPadding:
const
EdgeInsets
.
only
(
left:
12
),
subtitle:
Text
(
'
${peer.username}
@
${peer.hostname}
'
),
title:
Text
(
peer
.
id
),
title:
Text
(
formatID
(
peer
.
id
)
),
leading:
Container
(
padding:
const
EdgeInsets
.
all
(
6
),
color:
str2color
(
'
${peer.id}${peer.platform}
'
,
0x7f
),
...
...
flutter/lib/desktop/pages/connection_page.dart
View file @
725c0689
...
...
@@ -60,7 +60,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
children:
[
Row
(
children:
[
getSearchBarUI
(
context
),
_buildRemoteIDTextField
(
context
),
],
).
marginOnly
(
top:
22
),
SizedBox
(
height:
12
),
...
...
@@ -97,9 +97,9 @@ class _ConnectionPageState extends State<ConnectionPage> {
connect
(
context
,
id
,
isFileTransfer:
isFileTransfer
);
}
/// UI for the
search bar
.
/// UI for the
remote ID TextField
.
/// Search for a peer and connect to it if the id exists.
Widget
getSearchBarUI
(
BuildContext
context
)
{
Widget
_buildRemoteIDTextField
(
BuildContext
context
)
{
RxBool
ftHover
=
false
.
obs
;
RxBool
ftPressed
=
false
.
obs
;
RxBool
connHover
=
false
.
obs
;
...
...
flutter/lib/mobile/pages/connection_page.dart
View file @
725c0689
import
'dart:async'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_hbb/common/formatter/id_formatter.dart'
;
import
'package:flutter_hbb/mobile/pages/file_manager_page.dart'
;
import
'package:get/get.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -38,7 +39,7 @@ class ConnectionPage extends StatefulWidget implements PageShape {
/// State for the connection page.
class
_ConnectionPageState
extends
State
<
ConnectionPage
>
{
/// Controller for the id input bar.
final
_idController
=
TextEditingController
();
final
_idController
=
ID
TextEditingController
();
/// Update url. If it's not null, means an update is available.
var
_updateUrl
=
''
;
...
...
@@ -49,9 +50,9 @@ class _ConnectionPageState extends State<ConnectionPage> {
if
(
_idController
.
text
.
isEmpty
)
{
()
async
{
final
lastRemoteId
=
await
bind
.
mainGetLastRemoteId
();
if
(
lastRemoteId
!=
_idController
.
text
)
{
if
(
lastRemoteId
!=
_idController
.
id
)
{
setState
(()
{
_idController
.
text
=
lastRemoteId
;
_idController
.
id
=
lastRemoteId
;
});
}
}();
...
...
@@ -72,8 +73,8 @@ class _ConnectionPageState extends State<ConnectionPage> {
mainAxisSize:
MainAxisSize
.
max
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
<
Widget
>[
get
UpdateUI
(),
getSearchBarUI
(),
_build
UpdateUI
(),
_buildRemoteIDTextField
(),
Expanded
(
child:
PeerTabPage
(
tabs:
[
...
...
@@ -95,7 +96,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
/// Callback for the connect button.
/// Connects to the selected peer.
void
onConnect
()
{
var
id
=
_idController
.
text
.
trim
()
;
var
id
=
_idController
.
id
;
connect
(
id
);
}
...
...
@@ -132,7 +133,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
/// UI for software update.
/// If [_updateUrl] is not empty, shows a button to update the software.
Widget
get
UpdateUI
()
{
Widget
_build
UpdateUI
()
{
return
_updateUrl
.
isEmpty
?
const
SizedBox
(
height:
0
)
:
InkWell
(
...
...
@@ -152,9 +153,9 @@ class _ConnectionPageState extends State<ConnectionPage> {
color:
Colors
.
white
,
fontWeight:
FontWeight
.
bold
))));
}
/// UI for the
search bar
.
/// UI for the
remote ID TextField
.
/// Search for a peer and connect to it if the id exists.
Widget
getSearchBarUI
()
{
Widget
_buildRemoteIDTextField
()
{
final
w
=
SizedBox
(
height:
84
,
child:
Padding
(
...
...
@@ -197,6 +198,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
),
),
controller:
_idController
,
inputFormatters:
[
IDTextInputFormatter
()],
),
),
),
...
...
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