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
: 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) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 4.0),
child: SvgPicture.asset(
'assets/logo.svg',
width: 30,
height: 30,
),
child: loadLogo(30),
);
}
}

View File

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