File tree Expand file tree Collapse file tree
test/features/main_screen Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import 'dart:io' show Platform;
2+
13import 'package:bitsdojo_window/bitsdojo_window.dart' ;
24import 'package:flutter/material.dart' as material;
35import 'package:querya_desktop/core/layout/ui_scale.dart' ;
@@ -57,6 +59,15 @@ class QueryaWindowTitleBar extends StatelessWidget {
5759 );
5860 }
5961
62+ @visibleForTesting
63+ static double titleBarLeadingInset ({
64+ required bool isMacOS,
65+ required double Function (double designPx) scale,
66+ }) {
67+ // macOS traffic lights sit in the transparent titlebar (bitsdojo custom frame).
68+ return scale (isMacOS ? 72 : 16 );
69+ }
70+
6071 @visibleForTesting
6172 static WindowButtonColors closeButtonColors (BuildContext context) {
6273 final wb = context.workbench;
@@ -85,7 +96,12 @@ class QueryaWindowTitleBar extends StatelessWidget {
8596 child: MoveWindow (
8697 child: Row (
8798 children: [
88- const SizedBox (width: 16 ),
99+ SizedBox (
100+ width: QueryaWindowTitleBar .titleBarLeadingInset (
101+ isMacOS: Platform .isMacOS,
102+ scale: context.scaled,
103+ ),
104+ ),
89105 material.Icon (
90106 material.Icons .storage_rounded,
91107 size: 18 ,
Original file line number Diff line number Diff line change 11import Cocoa
22import FlutterMacOS
3+ import bitsdojo_window_macos
4+
5+ class MainFlutterWindow : BitsdojoWindow {
6+ override func bitsdojo_window_configure( ) -> UInt {
7+ return BDW_CUSTOM_FRAME | BDW_HIDE_ON_STARTUP
8+ }
39
4- class MainFlutterWindow : NSWindow {
510 override func awakeFromNib( ) {
611 let flutterViewController = FlutterViewController ( )
712 let windowFrame = self . frame
Original file line number Diff line number Diff line change @@ -97,6 +97,24 @@ void main() {
9797 expect (background, _customSurface);
9898 });
9999
100+ testWidgets ('title bar leading inset reserves macOS traffic-light space' ,
101+ (tester) async {
102+ expect (
103+ QueryaWindowTitleBar .titleBarLeadingInset (
104+ isMacOS: true ,
105+ scale: (v) => v,
106+ ),
107+ 72 ,
108+ );
109+ expect (
110+ QueryaWindowTitleBar .titleBarLeadingInset (
111+ isMacOS: false ,
112+ scale: (v) => v,
113+ ),
114+ 16 ,
115+ );
116+ });
117+
100118 testWidgets ('read-only state is persistently visible in title bar' ,
101119 (tester) async {
102120 await tester.pumpWidget (
You can’t perform that action at this time.
0 commit comments