@@ -330,53 +330,134 @@ class _MyHomePageState extends State<MyHomePage> {
330330class CustomTitleBar extends StatelessWidget {
331331 @override
332332 Widget build (BuildContext context) {
333+ final colorScheme = Theme .of (context).colorScheme;
333334 return GestureDetector (
334335 behavior: HitTestBehavior .translucent,
335336 onPanStart: (_) {
336337 windowManager.startDragging ();
337338 },
338339 child: Container (
339- height: 36 ,
340+ height: 40 ,
340341 decoration: BoxDecoration (
341- color: Theme .of (context).colorScheme.surfaceContainerHighest,
342- border: Border (bottom: BorderSide (color: Theme .of (context).dividerColor)),
342+ gradient: LinearGradient (
343+ colors: [
344+ colorScheme.surfaceContainerHighest.withOpacity (0.95 ),
345+ colorScheme.primary.withOpacity (0.08 ),
346+ ],
347+ begin: Alignment .topLeft,
348+ end: Alignment .bottomRight,
349+ ),
350+ border: Border (bottom: BorderSide (color: colorScheme.outlineVariant, width: 1 )),
351+ boxShadow: [
352+ BoxShadow (
353+ color: colorScheme.shadow.withOpacity (0.08 ),
354+ blurRadius: 8 ,
355+ offset: Offset (0 , 2 ),
356+ ),
357+ ],
343358 ),
344359 child: Row (
345360 children: [
361+ SizedBox (width: 12 ),
362+ ClipRRect (
363+ borderRadius: BorderRadius .circular (6 ),
364+ child: Image .asset ('assets/NamePicker.png' , width: 28 , height: 28 ),
365+ ),
366+ SizedBox (width: 10 ),
367+ Text (
368+ 'NamePicker' ,
369+ style: TextStyle (
370+ fontSize: 18 ,
371+ fontWeight: FontWeight .w700,
372+ fontFamily: "HarmonyOS_Sans_SC" ,
373+ color: colorScheme.primary,
374+ letterSpacing: 1.2 ,
375+ ),
376+ ),
346377 SizedBox (width: 8 ),
347- SafeArea (child: Image (image: AssetImage ('assets/NamePicker.png' ,),width: 20 ,height: 20 ,)),
348- SizedBox (width: 8 ),
349- Text ('NamePicker' , style: TextStyle (fontSize: 16 , fontWeight: FontWeight .w600)),
378+ Container (
379+ width: 1 , height: 20 ,
380+ color: colorScheme.outlineVariant,
381+ ),
350382 Spacer (),
351- IconButton (
352- icon: Icon ( Icons .minimize, size : 18 ) ,
383+ _TitleBarButton (
384+ icon: Icons .minimize,
353385 tooltip: '最小化' ,
354- onPressed: () => windowManager.minimize (),
386+ onTap: () => windowManager.minimize (),
387+ color: colorScheme.onSurfaceVariant,
355388 ),
356- IconButton (
357- icon: Icon ( Icons .crop_square, size : 18 ) ,
389+ _TitleBarButton (
390+ icon: Icons .crop_square,
358391 tooltip: '最大化/还原' ,
359- onPressed : () async {
392+ onTap : () async {
360393 bool isMax = await windowManager.isMaximized ();
361394 if (isMax) {
362395 await windowManager.unmaximize ();
363396 } else {
364397 await windowManager.maximize ();
365398 }
366399 },
400+ color: colorScheme.onSurfaceVariant,
367401 ),
368- IconButton (
369- icon: Icon ( Icons .close, size : 18 ) ,
402+ _TitleBarButton (
403+ icon: Icons .close,
370404 tooltip: '关闭' ,
371- onPressed: () => windowManager.close (),
405+ onTap: () => windowManager.close (),
406+ color: colorScheme.error,
407+ hoverColor: colorScheme.errorContainer,
372408 ),
409+ SizedBox (width: 8 ),
373410 ],
374411 ),
375412 ),
376413 );
377414 }
378415}
379416
417+ class _TitleBarButton extends StatefulWidget {
418+ final IconData icon;
419+ final String tooltip;
420+ final VoidCallback onTap;
421+ final Color color;
422+ final Color ? hoverColor;
423+ const _TitleBarButton ({
424+ required this .icon,
425+ required this .tooltip,
426+ required this .onTap,
427+ required this .color,
428+ this .hoverColor,
429+ });
430+
431+ @override
432+ State <_TitleBarButton > createState () => _TitleBarButtonState ();
433+ }
434+
435+ class _TitleBarButtonState extends State <_TitleBarButton > {
436+ bool _hovering = false ;
437+ @override
438+ Widget build (BuildContext context) {
439+ return MouseRegion (
440+ onEnter: (_) => setState (() => _hovering = true ),
441+ onExit: (_) => setState (() => _hovering = false ),
442+ child: GestureDetector (
443+ onTap: widget.onTap,
444+ child: Container (
445+ margin: EdgeInsets .symmetric (horizontal: 2 ),
446+ decoration: BoxDecoration (
447+ color: _hovering
448+ ? (widget.hoverColor ?? Theme .of (context).colorScheme.primary.withOpacity (0.08 ))
449+ : Colors .transparent,
450+ borderRadius: BorderRadius .circular (6 ),
451+ ),
452+ width: 32 ,
453+ height: 32 ,
454+ child: Icon (widget.icon, size: 18 , color: widget.color),
455+ ),
456+ ),
457+ );
458+ }
459+ }
460+
380461class GeneratorPage extends StatefulWidget {
381462 @override
382463 State <GeneratorPage > createState () => _GeneratorPageState ();
@@ -492,7 +573,7 @@ class SettingsPage extends StatelessWidget {
492573 var theme = Theme .of (context);
493574 var appState = context.watch <MyAppState >();
494575 return Column (
495- spacing: 20 ,
576+ spacing: 5 ,
496577 children: [
497578 SizedBox (width: 10 ,),
498579 SettingsCard (
@@ -561,33 +642,82 @@ class SettingsPage extends StatelessWidget {
561642class AboutPage extends StatelessWidget {
562643 @override
563644 Widget build (BuildContext context) {
564- // 已经夹私货夹到不知天地为何物了
565- var theme = Theme .of (context);
566- var appState = context.watch <MyAppState >();
567- return Column (
568- crossAxisAlignment: CrossAxisAlignment .center,
569- mainAxisAlignment: MainAxisAlignment .center,
570- spacing: 20 ,
571- children: [
572- SafeArea (child: Image (image: AssetImage ('assets/NamePicker.png' ,),width: 200 ,height: 200 ,)),
573- Center (
574- child: Text (
575- sprintf ("NamePicker %s - Codename %s" ,[version,codename]),
576- textAlign: TextAlign .center,
577- style: TextStyle (fontFamily: "HarmonyOS_Sans_SC" ,fontSize: 20 ,fontWeight: FontWeight .w600),
578- )
579- ),
580- Text (
581- "「云间城邦随岁月离析,昏光庭院再度敞开门扉,为永夜捎来微光」" ,
582- textAlign: TextAlign .center,
583- style: TextStyle (fontFamily: "HarmonyOS_Sans_SC" ,fontSize: 15 ,fontWeight: FontWeight .w400),
584- ),
585- Text (
586- "开发者 灵魂歌手er" ,
587- textAlign: TextAlign .center,
588- style: TextStyle (fontFamily: "HarmonyOS_Sans_SC" ,fontSize: 15 ,fontWeight: FontWeight .w400),
645+ final colorScheme = Theme .of (context).colorScheme;
646+ return Center (
647+ child: SingleChildScrollView (
648+ child: Padding (
649+ padding: const EdgeInsets .symmetric (horizontal: 24.0 , vertical: 32.0 ),
650+ child: Card (
651+ elevation: 4 ,
652+ shape: RoundedRectangleBorder (borderRadius: BorderRadius .circular (24 )),
653+ color: colorScheme.surfaceContainer,
654+ child: Padding (
655+ padding: const EdgeInsets .all (32.0 ),
656+ child: Column (
657+ mainAxisSize: MainAxisSize .min,
658+ crossAxisAlignment: CrossAxisAlignment .center,
659+ children: [
660+ ClipRRect (
661+ borderRadius: BorderRadius .circular (16 ),
662+ child: Image .asset ('assets/NamePicker.png' , width: 120 , height: 120 ),
663+ ),
664+ SizedBox (height: 24 ),
665+ Row (
666+ mainAxisAlignment: MainAxisAlignment .center,
667+ children: [
668+ Icon (Icons .apps, color: colorScheme.primary, size: 28 ),
669+ SizedBox (width: 8 ),
670+ Text (
671+ sprintf ("NamePicker %s" , [version]),
672+ style: TextStyle (fontFamily: "HarmonyOS_Sans_SC" , fontSize: 22 , fontWeight: FontWeight .bold, color: colorScheme.onSurface),
673+ ),
674+ ],
675+ ),
676+ SizedBox (height: 8 ),
677+ Text (
678+ 'Codename $codename ' ,
679+ style: TextStyle (fontFamily: "HarmonyOS_Sans_SC" , fontSize: 15 , color: colorScheme.onSurfaceVariant),
680+ ),
681+ SizedBox (height: 16 ),
682+ Divider (height: 32 , thickness: 1 , color: colorScheme.outlineVariant),
683+ Padding (
684+ padding: const EdgeInsets .symmetric (horizontal: 8.0 ),
685+ child: Text (
686+ "「云间城邦随岁月离析,昏光庭院再度敞开门扉,为永夜捎来微光」" ,
687+ textAlign: TextAlign .center,
688+ style: TextStyle (fontFamily: "HarmonyOS_Sans_SC" , fontSize: 16 , fontWeight: FontWeight .w400, color: colorScheme.primary),
689+ ),
690+ ),
691+ SizedBox (height: 24 ),
692+ Row (
693+ mainAxisAlignment: MainAxisAlignment .center,
694+ children: [
695+ CircleAvatar (
696+ radius: 18 ,
697+ backgroundColor: colorScheme.primaryContainer,
698+ child: ClipRRect (
699+ borderRadius: BorderRadius .circular (18 ),
700+ child: Image .asset ('assets/avaters/lhgser.jpg' , width: 60 , height: 60 ),
701+ ),
702+ ),
703+ SizedBox (width: 10 ),
704+ Text (
705+ "开发者 灵魂歌手er" ,
706+ style: TextStyle (fontFamily: "HarmonyOS_Sans_SC" , fontSize: 16 , fontWeight: FontWeight .w500, color: colorScheme.onSurface),
707+ ),
708+ ],
709+ ),
710+ SizedBox (height: 12 ),
711+ Text (
712+ "© 2022-2025 NamePickerOrg" ,
713+ style: TextStyle (fontSize: 13 , color: colorScheme.onSurfaceVariant),
714+ ),
715+ ],
716+ ),
717+ ),
718+ ),
589719 ),
590- ]
720+ ),
591721 );
592722 }
593723}
0 commit comments