fix: title bar controls

This commit is contained in:
ThaUnknown 2023-05-30 20:00:56 +02:00
parent d94c54df09
commit 41b0af3048
3 changed files with 5 additions and 54 deletions

View file

@ -1,6 +1,6 @@
{
"name": "Miru",
"version": "3.11.2",
"version": "3.11.3",
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
"description": "Stream anime torrents, real-time with no waiting for downloads.",
"main": "src/index.js",

View file

@ -131,6 +131,10 @@ function createWindow () {
height: 900,
frame: process.platform === 'darwin', // Only keep the native frame on Mac
titleBarStyle: 'hidden',
titleBarOverlay: {
color: '#191c20',
height: 28
},
backgroundColor: '#191c20',
autoHideMenuBar: true,
webPreferences: {
@ -242,21 +246,6 @@ ipcMain.on('dialog', async (event, data) => {
}
})
ipcMain.on('minimize', (event) => {
BrowserWindow.fromWebContents(event.sender).minimize()
})
ipcMain.on('maximize', (event) => {
const window = BrowserWindow.fromWebContents(event.sender)
if (window.isMaximized()) {
window.unmaximize()
} else {
window.maximize()
}
})
ipcMain.on('close', () => {
app.quit()
})
let status = null
const discord = new Client({
transport: 'ipc'

View file

@ -16,25 +16,6 @@
</div>
{/if}
</div>
{#if window.version.platform !== 'darwin'}
<div class='controls d-flex h-full pointer'>
<div class='d-flex align-items-center' on:pointerdown={() => window.IPC.emit('minimize')}>
<svg viewBox='0 0 24 24'>
<path d='M19 13H5v-2h14v2z' />
</svg>
</div>
<div class='d-flex align-items-center' on:pointerdown={() => window.IPC.emit('maximize')}>
<svg viewBox='0 0 24 24'>
<path d='M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z' />
</svg>
</div>
<div class='d-flex align-items-center close' on:pointerdown={() => window.IPC.emit('close')}>
<svg viewBox='0 0 24 24'>
<path d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z' />
</svg>
</div>
</div>
{/if}
</div>
</div>
@ -53,23 +34,4 @@
height: 16px;
width: 16px;
}
.controls > div {
width: 40px;
transition: background 0.15s ease;
}
.controls > div:hover {
background-color: #ffffff33;
color: #fff;
}
.controls > .close:hover {
background-color: #e81123 !important;
}
svg {
width: 18px;
height: 18px;
width: 100%;
}
path {
fill: currentColor;
}
</style>