Merge pull request #3555 from grummbeer/mobile-fix-rdp-settings-dialog

Fix. Mobile. Remove left label in RDP dialog
This commit is contained in:
RustDesk 2023-03-08 21:31:30 +08:00 committed by GitHub
commit f38f912c28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1126,56 +1126,67 @@ void _rdpDialog(String id) async {
), ),
Row( Row(
children: [ children: [
ConstrainedBox( isDesktop
constraints: const BoxConstraints(minWidth: 140), ? ConstrainedBox(
child: Text( constraints: const BoxConstraints(minWidth: 140),
"${translate('Port')}:", child: Text(
textAlign: TextAlign.right, "${translate('Port')}:",
).marginOnly(right: 10)), textAlign: TextAlign.right,
).marginOnly(right: 10))
: SizedBox.shrink(),
Expanded( Expanded(
child: TextField( child: TextField(
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow(RegExp( FilteringTextInputFormatter.allow(RegExp(
r'^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$')) r'^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$'))
], ],
decoration: const InputDecoration( decoration: InputDecoration(
border: OutlineInputBorder(), hintText: '3389'), labelText: isDesktop ? null : translate('Port'),
border: isDesktop ? const OutlineInputBorder() : null,
hintText: '3389'),
controller: portController, controller: portController,
autofocus: true, autofocus: true,
), ),
), ),
], ],
).marginOnly(bottom: 8), ).marginOnly(bottom: isDesktop ? 8 : 0),
Row( Row(
children: [ children: [
ConstrainedBox( isDesktop
constraints: const BoxConstraints(minWidth: 140), ? ConstrainedBox(
child: Text( constraints: const BoxConstraints(minWidth: 140),
"${translate('Username')}:", child: Text(
textAlign: TextAlign.right, "${translate('Username')}:",
).marginOnly(right: 10)), textAlign: TextAlign.right,
).marginOnly(right: 10))
: SizedBox.shrink(),
Expanded( Expanded(
child: TextField( child: TextField(
decoration: decoration: InputDecoration(
const InputDecoration(border: OutlineInputBorder()), labelText: isDesktop ? null : translate('Username'),
border: isDesktop ? const OutlineInputBorder() : null),
controller: userController, controller: userController,
), ),
), ),
], ],
).marginOnly(bottom: 8), ).marginOnly(bottom: isDesktop ? 8 : 0),
Row( Row(
children: [ children: [
ConstrainedBox( isDesktop
constraints: const BoxConstraints(minWidth: 140), ? ConstrainedBox(
child: Text( constraints: const BoxConstraints(minWidth: 140),
"${translate('Password')}:", child: Text(
textAlign: TextAlign.right, "${translate('Password')}:",
).marginOnly(right: 10)), textAlign: TextAlign.right,
).marginOnly(right: 10))
: SizedBox.shrink(),
Expanded( Expanded(
child: Obx(() => TextField( child: Obx(() => TextField(
obscureText: secure.value, obscureText: secure.value,
decoration: InputDecoration( decoration: InputDecoration(
border: const OutlineInputBorder(), labelText: isDesktop ? null : translate('Password'),
border:
isDesktop ? const OutlineInputBorder() : null,
suffixIcon: IconButton( suffixIcon: IconButton(
onPressed: () => secure.value = !secure.value, onPressed: () => secure.value = !secure.value,
icon: Icon(secure.value icon: Icon(secure.value
@ -1185,7 +1196,7 @@ void _rdpDialog(String id) async {
)), )),
), ),
], ],
).marginOnly(bottom: 8), ).marginOnly(bottom: isDesktop ? 8 : 0),
], ],
), ),
), ),