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

Frameless design for Mac #13

Open
adarshv90 opened this issue Jun 29, 2018 · 8 comments
Open

Frameless design for Mac #13

adarshv90 opened this issue Jun 29, 2018 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@adarshv90
Copy link

adarshv90 commented Jun 29, 2018

I believe electron allows this:
let win = new BrowserWindow({width: 800, height: 600, frame: false})

Here is a quick design mock-up:

screenshot 2018-06-29 at 10 34 16 am_00000

Hope it helps

@Armaldio
Copy link
Contributor

Hello, thanks for the proposal 👍
However, I see some problems:

  • On your mockup, buttons are too near to the "Messages" word. I don"t know how it integrate for real but currently it's not design friendly
  • Allowing custom element on the page require embeding the website inside a webview (see this as an enhanced iframe). Inside webview, notifications are not propagated and it will be difficult to bypass this behaviour (correct me if i'm wrong)
  • This style is only for MacOS, however we support the 3 main OS. We should support the three different desings

@Armaldio Armaldio added the enhancement New feature or request label Jun 29, 2018
@antoineraulin
Copy link

I think Electron-JS allows code injection into the page, either DOM elements or JavaScript code. Nevertheless, to introduce these elements characteristic of each OS in the page is, in my opinion, not a good idea.

@adarshv90
Copy link
Author

@Armaldio regarding your concerns:

  • I thought there was enough clearance between the edge and the word Messages to fit the buttons but I agree that it's not ideal
  • As @antoineguilbert said, Electron does allow code injection but you would have to constantly monitor the website for changes in case they introduce any breaking code or design changes.
  • I agree, I only created the design for Mac

However, since I'm only using it on Mac I went ahead and forked your repo and built a Mac only frameless version. Here is a working screenshot:

screenshot 2018-07-02 at 2 20 17 pm_00000

I used titleBarStyle: 'hidden' to achieve this. Thanks for making this possible 😀.

Here is the branch in case anybody wants to use it frameless-mac

@Armaldio
Copy link
Contributor

Armaldio commented Jul 2, 2018

Thanks for your reproduction.

Before considering implementing it, we need to discuss about it.
Since it's MacOS only (https://github.com/electron/electron/blob/master/docs/api/frameless-window.md#alternatives-on-macos), we need to first find a way to generalize it also on other platforms.

@adarshv90
Copy link
Author

adarshv90 commented Jul 16, 2018

Hey @Armaldio, sorry for the delay in response. I think this can be implemented so that it only builds frameless for Mac. For other platforms, it can be built as is with frame. In all cases where they've tried to do frameless for Windows, they end up using a custom HTLM frame. Eg. Slack:
capture

@Ztarbox
Copy link
Contributor

Ztarbox commented Jul 17, 2018

Hi @Armaldio if u use titleBarStyle: 'hidden', it will not have effect on windows.
And as @adarshv90 mentioned. Frameless in Windows is not that great with electron, but u could use autoHideMenuBar: true to hide the menu until the user presses the 'Alt' key.
image

@adarshv90
Copy link
Author

@Ztarbox I had forgotten about autoHideMenuBar (I do most Electron development for Mac). You're right. That looks really good without the menu bar.

@plastik46
Copy link

hi, how can i add this frameless design to my mac app?

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

No branches or pull requests

6 participants