diff --git a/client/lib/screens/shell/app_shell.dart b/client/lib/screens/shell/app_shell.dart index d74d307..dda9e8c 100644 --- a/client/lib/screens/shell/app_shell.dart +++ b/client/lib/screens/shell/app_shell.dart @@ -162,31 +162,39 @@ class _AppShellState extends ConsumerState { padding: EdgeInsets.only(top: topInset, left: isMobile ? 6 : 18, right: 14), child: Row( children: [ - if (isMobile) ...[ - IconButton( - icon: Icon(Icons.menu, color: t.topFg), - tooltip: '菜单', - onPressed: () => _scaffoldKey.currentState?.openDrawer(), + // 左组(占满剩余空间,靠左):把右组(主题器+铃)挤到最右 + Expanded( + child: Row( + children: [ + if (isMobile) ...[ + IconButton( + icon: Icon(Icons.menu, color: t.topFg), + tooltip: '菜单', + onPressed: () => _scaffoldKey.currentState?.openDrawer(), + ), + const SizedBox(width: 2), + ], + // 软件品牌(岩美酒库)—— 桌面常显,窄屏让位给门店 + if (!isMobile) ...[ + const _SoftwareBrand(), + Container( + width: 1, + height: 20, + color: t.topBorder, + margin: const EdgeInsets.symmetric(horizontal: 8), + ), + ], + // 门店品牌(御品轩名酒坊)——点开门店信息;过长省略 + Flexible(child: _ShopBrand(user: user)), + if (WriteGuard.isReadonly(ref)) ...[ + const SizedBox(width: 10), + _readonlyBadge(t.topControl), + ], + ], ), - const SizedBox(width: 2), - ], - // 软件品牌(岩美酒库)—— 桌面常显,窄屏让位给门店 - if (!isMobile) ...[ - const _SoftwareBrand(), - Container( - width: 1, - height: 20, - color: t.topBorder, - margin: const EdgeInsets.symmetric(horizontal: 8), - ), - ], - // 门店品牌(鼎晟酒行)——点开门店信息 - Flexible(child: _ShopBrand(user: user)), - if (WriteGuard.isReadonly(ref)) ...[ - const SizedBox(width: 10), - _readonlyBadge(t.topControl), - ], - const Spacer(), + ), + // 右组:主题器 + 通知铃,紧贴右侧 + const SizedBox(width: 12), const ThemePickerPill(), const SizedBox(width: 14), const NotificationBell(), @@ -281,7 +289,9 @@ class _AppShellState extends ConsumerState { child: PopupMenuButton( tooltip: '账号菜单', position: PopupMenuPosition.over, - offset: const Offset(0, -8), + // 菜单与侧栏等宽(218),左对齐到侧栏左缘(抵消侧栏 12 内边距) + offset: const Offset(-12, -8), + constraints: const BoxConstraints.tightFor(width: 218), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), color: t.menuUserBg, diff --git a/client/test/golden/goldens/app_shell_a.png b/client/test/golden/goldens/app_shell_a.png index 7fa3218..53c5421 100644 Binary files a/client/test/golden/goldens/app_shell_a.png and b/client/test/golden/goldens/app_shell_a.png differ diff --git a/client/test/golden/goldens/app_shell_b.png b/client/test/golden/goldens/app_shell_b.png index 4798375..b0a290a 100644 Binary files a/client/test/golden/goldens/app_shell_b.png and b/client/test/golden/goldens/app_shell_b.png differ diff --git a/client/test/golden/goldens/app_shell_c.png b/client/test/golden/goldens/app_shell_c.png index 82008c5..efcce5d 100644 Binary files a/client/test/golden/goldens/app_shell_c.png and b/client/test/golden/goldens/app_shell_c.png differ