mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-13 11:35:56 +00:00
button widget and preparing help cards
This commit is contained in:
@@ -14,6 +14,7 @@ import '../../common/formatter/id_formatter.dart';
|
||||
import '../../common/widgets/peer_tab_page.dart';
|
||||
import '../../common/widgets/peers_view.dart';
|
||||
import '../../models/platform_model.dart';
|
||||
import '../widgets/button.dart';
|
||||
|
||||
/// Connection page for connecting to a remote peer.
|
||||
class ConnectionPage extends StatefulWidget {
|
||||
@@ -109,10 +110,6 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
||||
/// UI for the remote ID TextField.
|
||||
/// Search for a peer and connect to it if the id exists.
|
||||
Widget _buildRemoteIDTextField(BuildContext context) {
|
||||
RxBool ftHover = false.obs;
|
||||
RxBool ftPressed = false.obs;
|
||||
RxBool connHover = false.obs;
|
||||
RxBool connPressed = false.obs;
|
||||
RxBool inputFocused = false.obs;
|
||||
FocusNode focusNode = FocusNode();
|
||||
focusNode.addListener(() {
|
||||
@@ -189,84 +186,17 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Obx(() => InkWell(
|
||||
onTapDown: (_) => ftPressed.value = true,
|
||||
onTapUp: (_) => ftPressed.value = false,
|
||||
onTapCancel: () => ftPressed.value = false,
|
||||
onHover: (value) => ftHover.value = value,
|
||||
onTap: () {
|
||||
onConnect(isFileTransfer: true);
|
||||
},
|
||||
child: Container(
|
||||
height: 27,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: ftPressed.value
|
||||
? MyTheme.accent
|
||||
: Colors.transparent,
|
||||
border: Border.all(
|
||||
color: ftPressed.value
|
||||
? MyTheme.accent
|
||||
: ftHover.value
|
||||
? MyTheme.hoverBorder
|
||||
: MyTheme.border,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Text(
|
||||
translate(
|
||||
"Transfer File",
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: ftPressed.value
|
||||
? MyTheme.color(context).bg
|
||||
: MyTheme.color(context).text),
|
||||
).marginSymmetric(horizontal: 12),
|
||||
),
|
||||
)),
|
||||
Button(
|
||||
isOutline: true,
|
||||
onTap: () {
|
||||
onConnect(isFileTransfer: true);
|
||||
},
|
||||
text: "Transfer File",
|
||||
),
|
||||
const SizedBox(
|
||||
width: 17,
|
||||
),
|
||||
Obx(
|
||||
() => InkWell(
|
||||
onTapDown: (_) => connPressed.value = true,
|
||||
onTapUp: (_) => connPressed.value = false,
|
||||
onTapCancel: () => connPressed.value = false,
|
||||
onHover: (value) => connHover.value = value,
|
||||
onTap: onConnect,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 80.0,
|
||||
),
|
||||
child: Container(
|
||||
height: 27,
|
||||
decoration: BoxDecoration(
|
||||
color: connPressed.value
|
||||
? MyTheme.accent
|
||||
: MyTheme.button,
|
||||
border: Border.all(
|
||||
color: connPressed.value
|
||||
? MyTheme.accent
|
||||
: connHover.value
|
||||
? MyTheme.hoverBorder
|
||||
: MyTheme.button,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
translate(
|
||||
"Connect",
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: MyTheme.color(context).bg),
|
||||
),
|
||||
).marginSymmetric(horizontal: 12),
|
||||
)),
|
||||
),
|
||||
),
|
||||
Button(onTap: onConnect, text: "Connect"),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user