Skip to content

Commit

Permalink
Drop transparent titlebar on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
domesticmouse committed Feb 12, 2025
1 parent 1016cc6 commit 91bb911
Show file tree
Hide file tree
Showing 37 changed files with 27 additions and 306 deletions.
33 changes: 3 additions & 30 deletions intro_flutter_gpu/codelab_rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ steps:
rmdir: step_01
- name: Create project
flutter: create --empty intro_flutter_gpu --platforms android,ios,macos,windows,linux
- name: Make the macOS titlebar transparent, content full window, and hide the title bar.
full-screen-macos-main-menu-xib: intro_flutter_gpu/macos/Runner/Base.lproj/MainMenu.xib
- name: Strip DEVELOPMENT_TEAM
strip-lines-containing: DEVELOPMENT_TEAM =
path: intro_flutter_gpu/ios/Runner.xcodeproj/project.pbxproj
Expand Down Expand Up @@ -52,13 +50,13 @@ steps:
flutter: pub add flutter_gpu --sdk=flutter
- name: Add dependencies
path: intro_flutter_gpu
flutter: pub add flutter_gpu_shaders native_assets_cli vector_math xml
flutter: pub add flutter_gpu_shaders native_assets_cli vector_math
- name: Patch pubspec.yaml
path: intro_flutter_gpu/pubspec.yaml
patch-u : |
--- b/intro_flutter_gpu/step_01/pubspec.yaml
+++ a/intro_flutter_gpu/step_01/pubspec.yaml
@@ -23,3 +23,6 @@ dev_dependencies:
@@ -22,3 +22,6 @@ dev_dependencies:
flutter:
uses-material-design: true
Expand Down Expand Up @@ -195,31 +193,6 @@ steps:
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}
- name: mkdir bin
mkdir: intro_flutter_gpu/bin
- name: Add bin/modify_macos_config.dart
path: intro_flutter_gpu/bin/modify_macos_config.dart
replace-contents: |
// Copyright 2024 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import 'package:xml/xml.dart';
import 'package:xml/xpath.dart';
void main() {
final file = File('macos/Runner/Base.lproj/MainMenu.xib');
var document = XmlDocument.parse(file.readAsStringSync());
document.xpath('//document/objects/window').first
..setAttribute('titlebarAppearsTransparent', 'YES')
..setAttribute('titleVisibility', 'hidden');
document
.xpath('//document/objects/window/windowStyleMask')
.first
.setAttribute('fullSizeContentView', 'YES');
file.writeAsStringSync(document.toString());
}
- name: Add my_first_triangle.shaderbundle.json
path: intro_flutter_gpu/my_first_triangle.shaderbundle.json
replace-contents: |
Expand Down Expand Up @@ -1162,7 +1135,7 @@ steps:
patch-u: |
--- b/intro_flutter_gpu/step_12/pubspec.yaml
+++ a/intro_flutter_gpu/step_12/pubspec.yaml
@@ -24,4 +24,4 @@ flutter:
@@ -23,4 +23,4 @@ flutter:
uses-material-design: true
assets:
Expand Down
20 changes: 0 additions & 20 deletions intro_flutter_gpu/step_01/bin/modify_macos_config.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@
</items>
<point key="canvasLocation" x="142" y="-258"/>
</menu>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target" titlebarAppearsTransparent="YES" titleVisibility="hidden">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
Expand Down
1 change: 0 additions & 1 deletion intro_flutter_gpu/step_01/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
flutter_gpu_shaders: ^0.2.0
native_assets_cli: ^0.9.0
vector_math: ^2.1.4
xml: ^6.5.0

dev_dependencies:
flutter_test:
Expand Down
20 changes: 0 additions & 20 deletions intro_flutter_gpu/step_02/bin/modify_macos_config.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@
</items>
<point key="canvasLocation" x="142" y="-258"/>
</menu>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target" titlebarAppearsTransparent="YES" titleVisibility="hidden">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
Expand Down
1 change: 0 additions & 1 deletion intro_flutter_gpu/step_02/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
flutter_gpu_shaders: ^0.2.0
native_assets_cli: ^0.9.0
vector_math: ^2.1.4
xml: ^6.5.0

dev_dependencies:
flutter_test:
Expand Down
20 changes: 0 additions & 20 deletions intro_flutter_gpu/step_03/bin/modify_macos_config.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@
</items>
<point key="canvasLocation" x="142" y="-258"/>
</menu>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target" titlebarAppearsTransparent="YES" titleVisibility="hidden">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
Expand Down
1 change: 0 additions & 1 deletion intro_flutter_gpu/step_03/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
flutter_gpu_shaders: ^0.2.0
native_assets_cli: ^0.9.0
vector_math: ^2.1.4
xml: ^6.5.0

dev_dependencies:
flutter_test:
Expand Down
20 changes: 0 additions & 20 deletions intro_flutter_gpu/step_04/bin/modify_macos_config.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@
</items>
<point key="canvasLocation" x="142" y="-258"/>
</menu>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target" titlebarAppearsTransparent="YES" titleVisibility="hidden">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
Expand Down
1 change: 0 additions & 1 deletion intro_flutter_gpu/step_04/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
flutter_gpu_shaders: ^0.2.0
native_assets_cli: ^0.9.0
vector_math: ^2.1.4
xml: ^6.5.0

dev_dependencies:
flutter_test:
Expand Down
20 changes: 0 additions & 20 deletions intro_flutter_gpu/step_05/bin/modify_macos_config.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@
</items>
<point key="canvasLocation" x="142" y="-258"/>
</menu>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target" titlebarAppearsTransparent="YES" titleVisibility="hidden">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
Expand Down
1 change: 0 additions & 1 deletion intro_flutter_gpu/step_05/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
flutter_gpu_shaders: ^0.2.0
native_assets_cli: ^0.9.0
vector_math: ^2.1.4
xml: ^6.5.0

dev_dependencies:
flutter_test:
Expand Down
20 changes: 0 additions & 20 deletions intro_flutter_gpu/step_06/bin/modify_macos_config.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@
</items>
<point key="canvasLocation" x="142" y="-258"/>
</menu>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target" titlebarAppearsTransparent="YES" titleVisibility="hidden">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
Expand Down
1 change: 0 additions & 1 deletion intro_flutter_gpu/step_06/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
flutter_gpu_shaders: ^0.2.0
native_assets_cli: ^0.9.0
vector_math: ^2.1.4
xml: ^6.5.0

dev_dependencies:
flutter_test:
Expand Down
20 changes: 0 additions & 20 deletions intro_flutter_gpu/step_07/bin/modify_macos_config.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@
</items>
<point key="canvasLocation" x="142" y="-258"/>
</menu>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target" titlebarAppearsTransparent="YES" titleVisibility="hidden">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
Expand Down
1 change: 0 additions & 1 deletion intro_flutter_gpu/step_07/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
flutter_gpu_shaders: ^0.2.0
native_assets_cli: ^0.9.0
vector_math: ^2.1.4
xml: ^6.5.0

dev_dependencies:
flutter_test:
Expand Down
20 changes: 0 additions & 20 deletions intro_flutter_gpu/step_08/bin/modify_macos_config.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@
</items>
<point key="canvasLocation" x="142" y="-258"/>
</menu>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target" titlebarAppearsTransparent="YES" titleVisibility="hidden">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
Expand Down
1 change: 0 additions & 1 deletion intro_flutter_gpu/step_08/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
flutter_gpu_shaders: ^0.2.0
native_assets_cli: ^0.9.0
vector_math: ^2.1.4
xml: ^6.5.0

dev_dependencies:
flutter_test:
Expand Down
Loading

0 comments on commit 91bb911

Please sign in to comment.