eleethesontai
eleethesontai

Reputation: 546

Slack style title bar

Slack on the Mac at least removed the title bar but still has the control buttons. How do I duplicate this effect? Is there an electron option I missing or did slack rollout there own control buttons?

Upvotes: 1

Views: 1549

Answers (1)

Joshua
Joshua

Reputation: 5322

You can do this with Electron by setting the titleBarStyle option.

To use it:

var winObj = new BrowserWindow({
    titleBarStyle:   'hidden',
});

This will hide the title bar but still keep the traffic lights in the corner.

Here are different values for the titleBarStyle option:

default

  • Results in the standard gray opaque Mac title bar.

hidden (Used in the example).

  • 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.

See the docs for the BrowserWindow options (search for titleBarStyle).

Upvotes: 3

Related Questions