mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-18 03:41:29 +03:00
Fix/custom client styles (#7373)
* Fix. qs styles Signed-off-by: fufesou <shuanglongchen@yeah.net> * custom client, options Signed-off-by: fufesou <shuanglongchen@yeah.net> * Move logo.svg to icon.svg Signed-off-by: fufesou <shuanglongchen@yeah.net> * Refact. Custom client, connection status ui. Signed-off-by: fufesou <shuanglongchen@yeah.net> * Custom client ui. Disable settings, hide "Change password" Signed-off-by: fufesou <shuanglongchen@yeah.net> * Custom client, logo align center Signed-off-by: fufesou <shuanglongchen@yeah.net> * Custom client, refact, outgoing ui Signed-off-by: fufesou <shuanglongchen@yeah.net> * Custom client, outgoing, settings icon Signed-off-by: fufesou <shuanglongchen@yeah.net> * Custom client, powered by RustDesk Signed-off-by: fufesou <shuanglongchen@yeah.net> * Custom client, remove unused SizeBox Signed-off-by: fufesou <shuanglongchen@yeah.net> * Update config.rs * Update flutter_ffi.rs --------- Signed-off-by: fufesou <shuanglongchen@yeah.net> Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
@@ -21,7 +21,10 @@ import '../../models/platform_model.dart';
|
||||
import '../widgets/button.dart';
|
||||
|
||||
class OnlineStatusWidget extends StatefulWidget {
|
||||
const OnlineStatusWidget({Key? key}) : super(key: key);
|
||||
const OnlineStatusWidget({Key? key, this.onSvcStatusChanged})
|
||||
: super(key: key);
|
||||
|
||||
final VoidCallback? onSvcStatusChanged;
|
||||
|
||||
@override
|
||||
State<OnlineStatusWidget> createState() => _OnlineStatusWidgetState();
|
||||
@@ -34,7 +37,7 @@ class _OnlineStatusWidgetState extends State<OnlineStatusWidget> {
|
||||
Timer? _updateTimer;
|
||||
|
||||
double get em => 14.0;
|
||||
double get height => em * 3;
|
||||
double? get height => bind.isIncomingOnly() ? null : em * 3;
|
||||
|
||||
void onUsePublicServerGuide() {
|
||||
const url = "https://rustdesk.com/pricing.html";
|
||||
@@ -79,15 +82,10 @@ class _OnlineStatusWidgetState extends State<OnlineStatusWidget> {
|
||||
: Color.fromARGB(255, 224, 79, 95)),
|
||||
),
|
||||
).marginSymmetric(horizontal: em),
|
||||
Text(
|
||||
_svcStopped.value
|
||||
? translate("Service is not running")
|
||||
: stateGlobal.svcStatus.value == SvcStatus.connecting
|
||||
? translate("connecting_status")
|
||||
: stateGlobal.svcStatus.value == SvcStatus.notReady
|
||||
? translate("not_ready_status")
|
||||
: translate('Ready'),
|
||||
style: TextStyle(fontSize: em)),
|
||||
Container(
|
||||
width: bind.isIncomingOnly() ? 240 : null,
|
||||
child: _buildConnStatusMsg(),
|
||||
),
|
||||
// stop
|
||||
Offstage(
|
||||
offstage: !_svcStopped.value,
|
||||
@@ -102,7 +100,8 @@ class _OnlineStatusWidgetState extends State<OnlineStatusWidget> {
|
||||
.marginOnly(left: em),
|
||||
),
|
||||
// ready && public
|
||||
Flexible(
|
||||
// No need to show the guide if is custom client.
|
||||
if (!bind.isIncomingOnly()) Flexible(
|
||||
child: Offstage(
|
||||
offstage: !(!_svcStopped.value &&
|
||||
stateGlobal.svcStatus.value == SvcStatus.ready &&
|
||||
@@ -137,6 +136,20 @@ class _OnlineStatusWidgetState extends State<OnlineStatusWidget> {
|
||||
).paddingOnly(right: bind.isIncomingOnly() ? 8 : 0);
|
||||
}
|
||||
|
||||
_buildConnStatusMsg() {
|
||||
widget.onSvcStatusChanged?.call();
|
||||
return Text(
|
||||
_svcStopped.value
|
||||
? translate("Service is not running")
|
||||
: stateGlobal.svcStatus.value == SvcStatus.connecting
|
||||
? translate("connecting_status")
|
||||
: stateGlobal.svcStatus.value == SvcStatus.notReady
|
||||
? translate("not_ready_status")
|
||||
: translate('Ready'),
|
||||
style: TextStyle(fontSize: em),
|
||||
);
|
||||
}
|
||||
|
||||
updateStatus() async {
|
||||
final status =
|
||||
jsonDecode(await bind.mainGetConnectStatus()) as Map<String, dynamic>;
|
||||
@@ -260,8 +273,8 @@ class _ConnectionPageState extends State<ConnectionPage>
|
||||
Expanded(child: PeerTabPage()),
|
||||
],
|
||||
).paddingOnly(left: 12.0)),
|
||||
const Divider(height: 1),
|
||||
OnlineStatusWidget()
|
||||
if (!bind.isOutgoingOnly()) const Divider(height: 1),
|
||||
if (!bind.isOutgoingOnly()) OnlineStatusWidget()
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user