opt: titlebar height autofit

Signed-off-by: Kingtous <kingtous@qq.com>
This commit is contained in:
Kingtous 2022-06-02 14:51:09 +08:00
parent aefc968246
commit 1f9655d632
3 changed files with 48 additions and 55 deletions

View File

@ -64,9 +64,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage>
animationDuration: Duration.zero, animationDuration: Duration.zero,
child: Column( child: Column(
children: [ children: [
SizedBox( DesktopTitleBar(
height: 50,
child: DesktopTitleBar(
child: TabBar( child: TabBar(
isScrollable: true, isScrollable: true,
labelColor: Colors.white, labelColor: Colors.white,
@ -95,7 +93,6 @@ class _ConnectionTabPageState extends State<ConnectionTabPage>
)) ))
.toList()), .toList()),
), ),
),
Expanded( Expanded(
child: TabBarView( child: TabBarView(
children: connectionIds children: connectionIds

View File

@ -19,8 +19,6 @@ class _DesktopHomePageState extends State<DesktopHomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: Column( body: Column(
children: [
Row(
children: [ children: [
DesktopTitleBar( DesktopTitleBar(
child: Center( child: Center(
@ -32,8 +30,6 @@ class _DesktopHomePageState extends State<DesktopHomePage> {
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
), ),
)
],
), ),
Expanded( Expanded(
child: Container( child: Container(

View File

@ -12,8 +12,7 @@ class DesktopTitleBar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Expanded( return Container(
child: Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.topCenter, begin: Alignment.topCenter,
@ -22,6 +21,7 @@ class DesktopTitleBar extends StatelessWidget {
stops: [0.0, 1.0]), stops: [0.0, 1.0]),
), ),
child: WindowTitleBarBox( child: WindowTitleBarBox(
child: SizedBox(
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(