adjust logo and statusbar

This commit is contained in:
rustdesk 2024-03-15 09:04:49 +08:00
parent 411384f0e7
commit 2bbc13ccf6
2 changed files with 18 additions and 21 deletions

View File

@ -3103,7 +3103,7 @@ Widget? loadLogo() {
return Container( return Container(
constraints: BoxConstraints(maxWidth: 300, maxHeight: 60), constraints: BoxConstraints(maxWidth: 300, maxHeight: 60),
child: image, child: image,
).marginOnly(bottom: 16); ).marginOnly(left: 12, right: 12, top: 12);
} else { } else {
return null; return null;
} }

View File

@ -78,6 +78,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
Widget buildLeftPane(BuildContext context) { Widget buildLeftPane(BuildContext context) {
final isIncomingOnly = bind.isIncomingOnly(); final isIncomingOnly = bind.isIncomingOnly();
final isOutgoingOnly = bind.isOutgoingOnly(); final isOutgoingOnly = bind.isOutgoingOnly();
final logo = loadLogo();
final children = <Widget>[ final children = <Widget>[
if (bind.isCustomClient()) if (bind.isCustomClient())
Align( Align(
@ -99,7 +100,12 @@ class _DesktopHomePageState extends State<DesktopHomePage>
), ),
).marginOnly(top: 6), ).marginOnly(top: 6),
), ),
buildTip(context), if (logo != null)
Align(
alignment: Alignment.center,
child: logo.marginOnly(bottom: 0.0),
),
buildTip(context, logo),
if (!isOutgoingOnly) buildIDBoard(context), if (!isOutgoingOnly) buildIDBoard(context),
if (!isOutgoingOnly) buildPasswordBoard(context), if (!isOutgoingOnly) buildPasswordBoard(context),
FutureBuilder<Widget>( FutureBuilder<Widget>(
@ -123,19 +129,15 @@ class _DesktopHomePageState extends State<DesktopHomePage>
]; ];
if (isIncomingOnly) { if (isIncomingOnly) {
children.addAll([ children.addAll([
Divider(), OnlineStatusWidget(
Container( onSvcStatusChanged: () {
margin: EdgeInsets.fromLTRB(0, 0, 8, 6), if (_isInHomePage()) {
child: OnlineStatusWidget( Future.delayed(Duration(milliseconds: 300), () {
onSvcStatusChanged: () { _updateWindowSize();
if (_isInHomePage()) { });
Future.delayed(Duration(milliseconds: 300), () { }
_updateWindowSize(); },
}); ).marginOnly(bottom: 6, right: 6)
}
},
),
),
]); ]);
} }
final textColor = Theme.of(context).textTheme.titleLarge?.color; final textColor = Theme.of(context).textTheme.titleLarge?.color;
@ -377,9 +379,8 @@ class _DesktopHomePageState extends State<DesktopHomePage>
); );
} }
buildTip(BuildContext context) { buildTip(BuildContext context, Widget? logo) {
final isOutgoingOnly = bind.isOutgoingOnly(); final isOutgoingOnly = bind.isOutgoingOnly();
final logo = loadLogo();
return Padding( return Padding(
padding: padding:
const EdgeInsets.only(left: 20.0, right: 16, top: 16.0, bottom: 5), const EdgeInsets.only(left: 20.0, right: 16, top: 16.0, bottom: 5),
@ -387,10 +388,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Align(
alignment: Alignment.center,
child: logo == null ? Offstage() : logo.marginOnly(bottom: 0.0),
),
Column( Column(
children: [ children: [
if (!isOutgoingOnly) if (!isOutgoingOnly)