Skip to content

Commit 58568e1

Browse files
authored
Merge pull request RocketChat#336 from edipox/mac-os-sexy
Make it sexier in macOS
2 parents 8aac5ce + b1985c5 commit 58568e1

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

src/background.js

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ app.on('ready', function () {
4040

4141
var mainWindow = createWindow('main', {
4242
width: 1000,
43+
titleBarStyle: 'hidden',
4344
height: 600
4445
});
4546

src/scripts/sidebar.js

+8
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,20 @@ class SideBar extends EventEmitter {
192192
document.body.classList.add('hide-server-list');
193193
localStorage.setItem('sidebar-closed', 'true');
194194
this.emit('hide');
195+
if (process.platform === 'darwin') {
196+
document.querySelectorAll('webview').forEach(
197+
(webviewObj) => { if (webviewObj.insertCSS) { webviewObj.insertCSS('aside.side-nav{margin-top:15px;overflow:hidden; transition: margin .5s ease-in-out; }'); } });
198+
}
195199
}
196200

197201
show () {
198202
document.body.classList.remove('hide-server-list');
199203
localStorage.setItem('sidebar-closed', 'false');
200204
this.emit('show');
205+
if (process.platform === 'darwin') {
206+
document.querySelectorAll('webview').forEach(
207+
(webviewObj) => { if (webviewObj.insertCSS) { webviewObj.insertCSS('aside.side-nav{margin-top:0; overflow:hidden; transition: margin .5s ease-in-out; }'); } });
208+
}
201209
}
202210

203211
toggle () {

src/stylesheets/main.less

+1
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ input[type='password'] {
291291
padding: 45px 0 35px;
292292
z-index: 10;
293293
position: relative;
294+
-webkit-app-region: no-drag;
294295
}
295296
.share {
296297
border-radius: 50%;

src/stylesheets/start-page.less

+9-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ div.server-list {
3030
bottom: 0;
3131
height: 100%;
3232
width: 80px;
33-
padding-top: 5px;
33+
padding-top: 22px;
3434
background-color: #0F354C;
3535
z-index: 100000;
36+
-webkit-app-region: drag;
3637
}
3738

3839
div.server-list ul {
@@ -175,6 +176,7 @@ div.server-list li:before {
175176

176177
.hide-server-list webview {
177178
left: 0;
179+
transition: left 0.5s ease-in-out;
178180
}
179181

180182
@-webkit-keyframes wrong {
@@ -238,4 +240,10 @@ webview.active {
238240

239241
.landing-page {
240242
z-index: 1;
243+
-webkit-app-region: drag;
244+
}
245+
246+
body,
247+
html {
248+
-webkit-app-region: drag;
241249
}

0 commit comments

Comments
 (0)