Repository navigation
replace OSX window title bar with custom title-bar - #11790
Conversation
|
@brumm Any chance to get rid of the black separation line between the title bar and the three file view? I think it would look much better. |
|
@FezVrasta These screenshots are just a first stab at theming the title-bar and intended to show what it could look like. At any rate, you could always remove that line by tinkering with your user stylesheet :) @simurai Would you like me to go ahead and create some PRs on https://github.com/atom/one-dark-ui/ and https://github.com/atom/one-light-ui/? |
| @deserialize(state) if state? | ||
| @deserializeTimings.atom = Date.now() - startTime | ||
|
|
||
| @document.body.appendChild(@views.getView(@titleBar)) if @titleBar |
There was a problem hiding this comment.
Would it make sense to add the title bar into the atom-panel-container.header with addHeaderPanel().
Then eventually you could do some funky stuff like (visually) combining the title-bar with the tool-bar:
Probably not by default, but maybe just restyle it in styles.less or as an option in the tool-bar package.
There was a problem hiding this comment.
Yeah, that's exactly what I was wondering as well. It seemed easier for now to stick the title-bar above the atom-workspace, but I was hoping to also support the combined title-bar as well.
I thought the combined titlebar might primarily be hosting the tab-bar, which might be pragmatic for a start, toolbars do sound funky though.
There was a problem hiding this comment.
I thought the combined titlebar might primarily be hosting the tab-bar, which might be pragmatic for a start, toolbars do sound funky though.
Only visually maybe, but tab-bars have to live inside panes. Because they can be split into different directions and each pane as its own tab-bar.
Anyways, I think for now it would be safer to add the title-bar into the .header. Because the changes to workspace-view.less might invite other packages to add their bars or other UI stuff outside of atom-workspace. With the addXXXPanel() all panels can be kept a bit more under control.
That's a much better idea than using the grey gradient! I'll change it. |
|
What's the status of this PR? I think the top grey bar is one of the most annoying things of Atom. If I have to use it the whole day I need a pleasant environment, and that gray bar doesn't help at all 😓 In my opinion, this PR should have high priority. |
|
I just can't stress how awesome and cool this thing looks to me. Would love to see it! |
|
Let us know when you have the specs complete for this @brumm 😀 |
| align-items: center; | ||
| justify-content: center; | ||
|
|
||
| font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue"; |
There was a problem hiding this comment.
Maybe we don't have to force a font-family and just let it inherit whatever the theme defined. The One themes use the system font, but some themes might wanna use something else.
|
Made a few more comments.. sorry.. 😇 I tried to make a PR to your PR, but your fork somehow didn't show up in the list to compare against. |
|
Thanks for the comments! All good points. I'll be able to work on this in a few hours 👍 |
|
@simurai i made a couple of changes:
|
094563a to
6159970
Compare
|
I'm for |
Yeah, sounds good. For the bundled One + Atom themes, we can still thinking about customizing it. Also having a border by default should help make it clear where you can start dragging the window. @FezVrasta In case your favorite theme doesn't look seamless, you could always make it transparent in your .title-bar {
background-color: transparent;
border-color: transparent;
}
Only if you want, so far we haven't really bothered about it. Maybe one day we will enable it on the merge button, now that GitHub added that feature.
Ya, looks like an unlreated timeout. |
|
ok, so the styling is 👍 So hopefully we can get somebody from @atom/core to take a look at the code. And maybe @amytruong can give it another test drive? |
| options = | ||
| show: false | ||
| title: 'Atom' | ||
| titleBarStyle: 'hidden' |
There was a problem hiding this comment.
Is there any chance of this ever doing something on platforms other than OS X? If so, I think it'd be nice to specifically check for the platform here, since we're also explicitly checking it in atom-environment, and we don't want it to accidentally get out of sync.
There was a problem hiding this comment.
I changed it to check for darwin as well, thanks for the heads up!
|
@FezVrasta The window controls are drawn by the OS and positions can't be changed indivdually. I always figured that we'd have to completely hide the titlebar to support the 'tabs-on-top' style proposed in #10208, and dynamically switch draggable areas on and off with css. That's what I came up with the other day: Edit: this stuff is not feasible yet because it needs this fix electron/electron#5557 which is available from |
|
Thanks for the reply. If it can be helpful I posted my custom CSS at #10208 (comment) |
|
@brumm We came up with that design too - it looks great but the problem is that objects in the non-client area (i.e. the invisible bar from the traffic lights onward) cannot be dragged, so reordering tabs is busted 😢 |
|
Couldn't we hide the title bar altogether, and create fake window buttons with CSS, as shown here? @paulcbetts @brumm |
|
@controversial In Atom's case, window buttons are rendered by the OS and can't be changed. |
|
@silvestreh Why couldn't that be changed? This is a PR to the atom core... |
|
@controversial This is what the titlebar's DOM element looks like: As you can see, the buttons aren't part of the DOM. You can't style them with CSS because the window manager, not Chrome, is rendering them. AFAIK, you can't move, resize, nor hide them. |
|
You can spawn a frameless window, which would hide the title bar completely, then you could emulate the buttons using custom CSS. https://github.com/electron/electron/blob/master/docs/api/frameless-window.md Maybe this isn't available in the version of Electron atom is on though. |
This does indeed require a more modern Electron. We're very close to shipping #12300 though 🎉 |
|
Ah, great. I'll look forward to #12300 😃 |
|
@controversial I think it's not a good practice to replace native OS UI controls. They are a hell to maintain and avoids OS level customization and third party software control over them. |
|
Yeah, you're probably right. Waiting for the newer Electron version will be a much better choice. |
|
Any plans to have something like this for other operating systems, given 57% of the Atom userbase is on Linux or Windows? 😄
I agree with @sveggiani... Emulating native OS controls is tricky and very difficult to maintain. It's better to use the native APIs to render the native controls (for example, I believe the title bar of Google Chrome does it this way). This used to be reasonably common with native apps on Windows, I don't know if Electron exposes this functionality though. |
|
@Daniel15 Electron does expose this, but only in a version of Electron that's later than the one Atom uses. I think a fake control would be good for the short term, using the native controls once we get to that version of Electron. |
|
Now that Atom is on a modern Electron version can we do this? I really like @brumm's solution, even though the tabs can't be reordered. Hyper does this and the tabs aren't reorderable, but it never really bothers me. If this was an option that could be enabled by users, I think it'd be great to include some kind of solution in the Atom core. |
|
I'm probably late to the party, but is there any way I can do this currently? Is there a dev branch or beta release with this enabled? |
|
@lacostenycoder, look for |
|
@MaximSokolov, already found that thanks! |










This pull request is intended to naively implement a custom titlebar on OSX.
I've included fallback styling to match El Capitan's titlebars, which is probably not necessary as I modified the four included themes to provide their own titlebar styling. I'll create PRs for these in their respective repositories if this PR gets considered.
I'd like to hear your thoughts on the implementation, I just banged on the code until it worked 😁
This is what it looks like by default:

This is the titlebar provided by one-dark-ui, with the oceanic-next syntax

This is one-light-ui, with the atom-light syntax

Things left to do:
This is a partial continuation of #10208 albeit without the combined title-bar-and-tabs functionality, for which this would be the groundwork. (As requested in #4599 for example.)