support logo.png

This commit is contained in:
rustdesk 2024-02-26 17:49:12 +08:00
parent 2920e33d71
commit 749a1d2da2
3 changed files with 15 additions and 11 deletions

View File

@ -3071,3 +3071,14 @@ Color? disabledTextColor(BuildContext context, bool enabled) {
? null ? null
: Theme.of(context).textTheme.titleLarge?.color?.withOpacity(0.6); : Theme.of(context).textTheme.titleLarge?.color?.withOpacity(0.6);
} }
Widget loadLogo(double size) {
return Image.asset('assets/logo.png',
width: size,
height: size,
errorBuilder: (ctx, error, stackTrace) => SvgPicture.asset(
'assets/logo.svg',
width: size,
height: size,
));
}

View File

@ -327,11 +327,7 @@ class _AppIcon extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.symmetric(horizontal: 4.0), margin: EdgeInsets.symmetric(horizontal: 4.0),
child: SvgPicture.asset( child: loadLogo(30),
'assets/logo.svg',
width: 30,
height: 30,
),
); );
} }
} }

View File

@ -399,12 +399,9 @@ class DesktopTab extends StatelessWidget {
offstage: kUseCompatibleUiMode || Platform.isMacOS, offstage: kUseCompatibleUiMode || Platform.isMacOS,
child: Row(children: [ child: Row(children: [
Offstage( Offstage(
offstage: !showLogo, offstage: !showLogo,
child: SvgPicture.asset( child: loadLogo(16),
'assets/logo.svg', ),
width: 16,
height: 16,
)),
Offstage( Offstage(
offstage: !showTitle, offstage: !showTitle,
child: const Text( child: const Text(