fix connection status style

This commit is contained in:
rustdesk 2022-09-19 19:24:51 +08:00
parent e0d759c3bb
commit 0679d01a63

View File

@ -94,8 +94,8 @@ class _ConnectionPageState extends State<ConnectionPage> {
).marginSymmetric(horizontal: 22),
),
const Divider(),
SizedBox(height: 50, child: Obx(() => buildStatus()))
.paddingSymmetric(horizontal: 12.0)
SizedBox(child: Obx(() => buildStatus()))
.paddingOnly(bottom: 12, top: 6),
]),
);
}
@ -303,6 +303,8 @@ class _ConnectionPageState extends State<ConnectionPage> {
var svcIsUsingPublicServer = true.obs;
Widget buildStatus() {
final fontSize = 14.0;
final textStyle = TextStyle(fontSize: fontSize);
final light = Container(
height: 8,
width: 8,
@ -310,13 +312,13 @@ class _ConnectionPageState extends State<ConnectionPage> {
borderRadius: BorderRadius.circular(20),
color: svcStopped.value ? Colors.redAccent : Colors.green,
),
).paddingSymmetric(horizontal: 10.0);
).paddingSymmetric(horizontal: 12.0);
if (svcStopped.value) {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
light,
Text(translate("Service is not running")),
Text(translate("Service is not running"), style: textStyle),
TextButton(
onPressed: () async {
bool checked = await bind.mainCheckSuperUserPermission();
@ -324,19 +326,25 @@ class _ConnectionPageState extends State<ConnectionPage> {
bind.mainSetOption(key: "stop-service", value: "");
}
},
child: Text(translate("Start Service")))
child: Text(translate("Start Service"), style: textStyle))
],
);
} else {
if (svcStatusCode.value == 0) {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [light, Text(translate("connecting_status"))],
children: [
light,
Text(translate("connecting_status"), style: textStyle)
],
);
} else if (svcStatusCode.value == -1) {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [light, Text(translate("not_ready_status"))],
children: [
light,
Text(translate("not_ready_status"), style: textStyle)
],
);
}
}
@ -344,13 +352,15 @@ class _ConnectionPageState extends State<ConnectionPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
light,
Text(translate('Ready')),
Text(translate('Ready'), style: textStyle),
Text(', ', style: textStyle),
svcIsUsingPublicServer.value
? InkWell(
onTap: onUsePublicServerGuide,
child: Text(
', ${translate('setup_server_tip')}',
style: TextStyle(decoration: TextDecoration.underline),
translate('setup_server_tip'),
style: TextStyle(
decoration: TextDecoration.underline, fontSize: fontSize),
),
)
: Offstage()
@ -424,7 +434,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(translate("${model.abError}")),
Text(translate(model.abError)),
TextButton(
onPressed: () {
setState(() {});