二次开发源码提交
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import '../../config/app_config.dart';
|
||||
|
||||
class DesktopTitleBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
const DesktopTitleBar({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WindowCaption(
|
||||
brightness: Theme.of(context).brightness,
|
||||
backgroundColor: Colors.transparent, // 透明背景,露出下面的组件颜色
|
||||
title: Row(
|
||||
children: [
|
||||
// 可以在这里放一个小 Logo
|
||||
Image.asset(
|
||||
'assets/icons/tray_icon.png',
|
||||
width: 20,
|
||||
height: 20,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
const Text(
|
||||
AppConfig.appName,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontFamily: 'NotoSansSC',
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Size get preferredSize => const Size.fromHeight(32); // Windows 标准标题栏高度
|
||||
}
|
||||
Reference in New Issue
Block a user