From 87c3a2850d5d6bc1a89c9ff541362e7e98edd0d4 Mon Sep 17 00:00:00 2001 From: NicKoehler Date: Thu, 18 May 2023 22:59:07 +0200 Subject: [PATCH] modernized header --- flutter/assets/audio.svg | 2 - flutter/assets/clipboard.svg | 2 - flutter/assets/restart.svg | 2 - flutter/lib/desktop/pages/server_page.dart | 147 +++++++++++++-------- 4 files changed, 89 insertions(+), 64 deletions(-) diff --git a/flutter/assets/audio.svg b/flutter/assets/audio.svg index baf0972db..ba12b34e6 100644 --- a/flutter/assets/audio.svg +++ b/flutter/assets/audio.svg @@ -1,3 +1 @@ - - \ No newline at end of file diff --git a/flutter/assets/clipboard.svg b/flutter/assets/clipboard.svg index ff3158752..d2230845d 100644 --- a/flutter/assets/clipboard.svg +++ b/flutter/assets/clipboard.svg @@ -1,3 +1 @@ - - \ No newline at end of file diff --git a/flutter/assets/restart.svg b/flutter/assets/restart.svg index bf74398a8..21a085569 100644 --- a/flutter/assets/restart.svg +++ b/flutter/assets/restart.svg @@ -1,3 +1 @@ - - \ No newline at end of file diff --git a/flutter/lib/desktop/pages/server_page.dart b/flutter/lib/desktop/pages/server_page.dart index ed00d2421..79aeaf896 100644 --- a/flutter/lib/desktop/pages/server_page.dart +++ b/flutter/lib/desktop/pages/server_page.dart @@ -329,70 +329,101 @@ class _CmHeaderState extends State<_CmHeader> @override Widget build(BuildContext context) { super.build(context); - return Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // icon - Container( - width: 90, - height: 90, - alignment: Alignment.center, - decoration: BoxDecoration(color: str2color(client.name)), - child: Text( - client.name[0], - style: TextStyle( - fontWeight: FontWeight.bold, color: Colors.white, fontSize: 65), - ), - ).marginOnly(left: 4.0, right: 8.0), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - FittedBox( - child: Text( - client.name, - style: TextStyle( - color: MyTheme.cmIdColor, - fontWeight: FontWeight.bold, - fontSize: 20, - overflow: TextOverflow.ellipsis, - ), - maxLines: 1, - )), - FittedBox( - child: Text("(${client.peerId})", - style: - TextStyle(color: MyTheme.cmIdColor, fontSize: 14))), - SizedBox( - height: 16.0, + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), + gradient: LinearGradient( + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: [ + Color(0xff00bfe1), + Color(0xff0071ff), + ], + ), + ), + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 70, + height: 70, + alignment: Alignment.center, + decoration: BoxDecoration( + color: str2color(client.name), + borderRadius: BorderRadius.circular(15.0), + ), + child: Text( + client.name[0], + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 55, ), - FittedBox( - child: Row( - children: [ - Text(client.authorized + ), + ).marginOnly(right: 10.0), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + FittedBox( + child: Text( + client.name, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 20, + overflow: TextOverflow.ellipsis, + ), + maxLines: 1, + )), + FittedBox( + child: Text( + "(${client.peerId})", + style: TextStyle(color: Colors.white, fontSize: 14), + ), + ).marginOnly(bottom: 10.0), + FittedBox( + child: Row( + children: [ + Text( + client.authorized ? client.disconnected ? translate("Disconnected") : translate("Connected") - : "${translate("Request access to your device")}...") - .marginOnly(right: 8.0), - if (client.authorized) - Obx(() => Text( - formatDurationToTime(Duration(seconds: _time.value)))) - ], - )) - ], + : "${translate("Request access to your device")}...", + style: TextStyle(color: Colors.white), + ).marginOnly(right: 8.0), + if (client.authorized) + Obx( + () => Text( + formatDurationToTime( + Duration(seconds: _time.value), + ), + style: TextStyle(color: Colors.white), + ), + ) + ], + )) + ], + ), ), - ), - Offstage( - offstage: !client.authorized || client.type_() != ClientType.remote, - child: IconButton( + Offstage( + offstage: !client.authorized || client.type_() != ClientType.remote, + child: IconButton( onPressed: () => checkClickTime( client.id, () => gFFI.chatModel.toggleCMChatPage(client.id)), - icon: Icon(Icons.message_outlined), - splashRadius: kDesktopIconButtonSplashRadius), - ) - ], + icon: Icon( + Icons.message_rounded, + color: Colors.white, + ), + splashRadius: kDesktopIconButtonSplashRadius, + ), + ) + ], + ), ); } @@ -452,7 +483,7 @@ class _PrivilegeBoardState extends State<_PrivilegeBoard> { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(top: 16.0, bottom: 8.0, left: 5.0, right: 5.0), + margin: EdgeInsets.all(5.0), padding: EdgeInsets.all(5.0), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.0),