Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customising the title bar on macOS #74

Closed
wilsonowilson opened this issue Aug 28, 2021 · 2 comments
Closed

Customising the title bar on macOS #74

wilsonowilson opened this issue Aug 28, 2021 · 2 comments

Comments

@wilsonowilson
Copy link

Related to #67.

Screenshot 2021-08-28 at 17 05 53

Making the title bar transparent can usually be achieved by editing the MainMenu.xib file.

How can I achieve this with nativeshell?

@knopp
Copy link
Contributor

knopp commented Aug 28, 2021

The NativeShell approach would be to put this in initializeWindow:

    await window.setStyle(WindowStyle(
      frame: WindowFrame.noTitle,
      trafficLightOffset: const Offset(16, 18), // move the standard window buttons
    ));

This should give you window without the title bar. After that, for any area where you want your window to be draggable, use GestureDetector and on panStart call Window.of(context).performDrag();.

This should work across all platforms (except of trafficLightOffset which is ignored on linux and windows).

@wilsonowilson
Copy link
Author

Awesome! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants