Skip to content

Conversation

ItsEeleeya
Copy link

@ItsEeleeya ItsEeleeya commented Aug 29, 2024

This is a WIP.

Window buttons (macOS):

  • Fixes visible artifact on window resize
  • Window specific window buttons inset
  • Window buttons stay in place when the system theme changes
  • Adds the respecting command to the bindings API

Webview transparency (macOS):

  • It now only makes the webview transparent and does not change the window itself.

This is still using an Apple internal implementation (private API) like before and the same as Tauri.
The difference here is that by not modifying the window background, we can use a material on the window and have shadows enabled since shadows for transparent windows cause artifacts and performance issues.

Window level (macOS):

  • Adds corresponding enum for NSWindowLevel

TODOs:

  • Implement window buttons inset for Windows 11 (22H2 and newer)
  • Implement native support for Snap Layouts using the recommended methods and APIs
  • Add plugin config
  • Support RTL layout on macOS

Configuration example:

 {
   "all": {
     "windowButtons": {
       "insetX": 15.0,
       "insetY": 20.0,
       "supportRTL": true, // (Windows/macOS) Move the window controls to the opposite direction
       "hide": [], // "minimize"/"close"/"zoom/maximize"
     },
     "hideOnClose": true // (macOS only) Hides the window when close button is clicked.
     "transparentWebViews": ["main"], // Values: `true` or a list of webview labels to make transparent.
     "createOverlayTitlebar": ["onboarding"] // Values: `true` or a list of webview labels to create the overlay titlebar for.
   },
   "windows": [
     {
       "label": "main",
       "windowButtons": {
         "insetX": 15.0,
         "insetY": 20.0,
         "supportRTL": true,
         "hide": []
       },
       "hideOnClose": true
       "transparentWebViews": true,
       "createOverlayTitlebar": ["main"],
     }
   ]
 }

Window specific configuration merge with the default all config. Specific configs have priority over the defaults.


Side note: I'm not sure if this is accepted, but some files were using tabs over spaces, yarn and pnpm were also both used. I'd appreciate if I could get some guidance on which one to use for this project!

@clearlysid
Copy link
Owner

I love the changes! The PR is a little tricky to review give its size, possible to break it down into smaller ones? 😅

@ItsEeleeya
Copy link
Author

Of course! I didn't realize it got this large, how should we go about doing that?
I'm still focusing on finishing the implementation on macOS, then I'll look into Windows and Linux

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

Successfully merging this pull request may close these issues.

2 participants