Transparent Mac OS
Open a window without toolbars, borders, or other graphical 'chrome'.
A frameless window is a window that has nochrome, the parts ofthe window, like toolbars, that are not a part of the web page. These areoptions on the BrowserWindow
class.
Create a frameless window
To create a frameless window, you need to set frame
to false
inBrowserWindow's options
:
First, launch System Preferences and select Accessibility. Next, make sure you’re on the Display section on the left side of the Accessibility window. On the right side of the window, find and check the box labeled Reduce Transparency. If you have a solid white background it’s probably fine, but lots of people have found that the translucent background for the menubar is more annoying than cool after all. Now, as I said, in Mac OS X 10.5.2 the “Desktop & Screen Saver” system preference panel has been tweaked.
Here is a solution for Mac OS X. The main file calls this function: #include 'my-cocoa-wrappers.h' setWindowTransparency(myfltkwindow, istransparent? 0.75: 1.0); Then I created my-cocoa-wrappers.h. May 06, 2014 This can be done by dragging your mouse pointer over the area you want to delete, and by clicking on “Delete” on your keyboard. Use the Lasso Selection Option for a selection that has an irregular shape, and press “Delete” to remove the selected area of the image and make it transparent. A popup may appear saying “Convert this document to PNG? Your last edit adds transparency, which the current document format does not support. Converting will replace the existing file.” Click the Convert button. This will make your image with the instant alpha areas transparent. See also: How to convert images. You can also delete.
Alternatives on macOS
There's an alternative way to specify a chromeless window.Instead of setting frame
to false
which disables both the titlebar and window controls,you may want to have the title bar hidden and your content extend to the full window size,yet still preserve the window controls ('traffic lights') for standard window actions.You can do so by specifying the titleBarStyle
option:
hidden
Results in a hidden title bar and a full size content window, yet the title bar still has the standard window controls (“traffic lights”) in the top left.
hiddenInset
Results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge.
customButtonsOnHover
Uses custom drawn close, and miniaturize buttons that displaywhen hovering in the top left of the window. The fullscreen buttonis not available due to restrictions of frameless windows as theyinterface with Apple's macOS window masks. These custom buttons preventissues with mouse events that occur with the standard window toolbar buttons.This option is only applicable for frameless windows.
Transparent window
By setting the transparent
option to true
, you can also make the framelesswindow transparent:
Limitations
- You can not click through the transparent area. We are going to introduce anAPI to set window shape to solve this, seeour issue for details.
- Transparent windows are not resizable. Setting
resizable
totrue
may makea transparent window stop working on some platforms. - The
blur
filter only applies to the web page, so there is no way to applyblur effect to the content below the window (i.e. other applications open onthe user's system). - The window will not be transparent when DevTools is opened.
- On Windows operating systems,
- transparent windows will not work when DWM isdisabled.
- transparent windows can not be maximized using the Windows system menu or by double clicking the title bar. The reasoning behind this can be seen on this pull request.
- On Linux, users have to put
--enable-transparent-visuals --disable-gpu
inthe command line to disable GPU and allow ARGB to make transparent window,this is caused by an upstream bug that alpha channel doesn't work on someNVidia drivers onLinux. - On Mac, the native window shadow will not be shown on a transparent window.
Click-through window
To create a click-through window, i.e. making the window ignore all mouseevents, you can call the win.setIgnoreMouseEvents(ignore)API:
Forwarding
Ignoring mouse messages makes the web page oblivious to mouse movement, meaningthat mouse movement events will not be emitted. On Windows operating systems anoptional parameter can be used to forward mouse move messages to the web page,allowing events such as mouseleave
to be emitted:
This makes the web page click-through when over el
, and returns to normaloutside it.
Draggable region
By default, the frameless window is non-draggable. Apps need to specify-webkit-app-region: drag
in CSS to tell Electron which regions are draggable(like the OS's standard titlebar), and apps can also use-webkit-app-region: no-drag
to exclude the non-draggable area from thedraggable region. Note that only rectangular shapes are currently supported.
Note: -webkit-app-region: drag
is known to have problems while the developer tools are open. See this GitHub issue for more information including a workaround.
To make the whole window draggable, you can add -webkit-app-region: drag
asbody
's style:
And note that if you have made the whole window draggable, you must also markbuttons as non-draggable, otherwise it would be impossible for users to click onthem:
If you're only setting a custom titlebar as draggable, you also need to make allbuttons in titlebar non-draggable.
Text selection
In a frameless window the dragging behavior may conflict with selecting text.For example, when you drag the titlebar you may accidentally select the text onthe titlebar. To prevent this, you need to disable text selection within adraggable area like this:
Context menu
On some platforms, the draggable area will be treated as a non-client frame, sowhen you right click on it a system menu will pop up. To make the context menubehave correctly on all platforms you should never use a custom context menu ondraggable areas.
29 images of mac icon. You can use these free icons and png images for your photoshop design, documents, web sites, art projects or google presentations, powerpoint templates. Free icons png images that you can download to you computer and use in your designs.Please, Do not forget to link to MAC ICON page for attribution!
Thanks for choosing us!