mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
💄 Show native window controls on macOS crash dialog (#16357)
This commit is contained in:
parent
cc59bd1087
commit
d15f957239
2 changed files with 26 additions and 3 deletions
|
|
@ -91,7 +91,7 @@
|
||||||
|
|
||||||
.drag {
|
.drag {
|
||||||
-webkit-app-region: drag;
|
-webkit-app-region: drag;
|
||||||
height: 22px;
|
height: 32px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
@ -180,7 +180,28 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
document.querySelector('#icon').innerHTML = `<img src="${decodeURIComponent(getSearch('icon'))}"> SiYuan v${getSearch('v')}`
|
if (process.platform === 'darwin') {
|
||||||
|
document.getElementById('min').style.display = 'none';
|
||||||
|
document.getElementById('close').style.display = 'none';
|
||||||
|
document.querySelector('.drag').style.right = '0';
|
||||||
|
document.querySelector('#icon').style.left = '74px';
|
||||||
|
} else {
|
||||||
|
document.querySelector('#icon').style.right = '70px';
|
||||||
|
}
|
||||||
|
|
||||||
|
const os = require('os')
|
||||||
|
const platformMap = {
|
||||||
|
'darwin': 'macOS',
|
||||||
|
'win32': 'Windows',
|
||||||
|
'linux': 'Linux'
|
||||||
|
}
|
||||||
|
const platform = platformMap[process.platform] || process.platform
|
||||||
|
const release = os.release()
|
||||||
|
const arch = os.arch()
|
||||||
|
const cpus = os.cpus()
|
||||||
|
const cpuModel = cpus.length > 0 ? cpus[0].model : ''
|
||||||
|
const systemInfo = `· ${platform} ${release} · ${arch} · ${cpuModel}`
|
||||||
|
document.querySelector('#icon').innerHTML = `<img src="${decodeURIComponent(getSearch('icon'))}"> SiYuan v${getSearch('v')} ${systemInfo}`
|
||||||
|
|
||||||
document.getElementById('title').innerHTML = decodeURIComponent(getSearch('title'))
|
document.getElementById('title').innerHTML = decodeURIComponent(getSearch('title'))
|
||||||
document.getElementById('content').innerHTML = decodeURIComponent(getSearch('content'))
|
document.getElementById('content').innerHTML = decodeURIComponent(getSearch('content'))
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,9 @@ const showErrorWindow = (title, content) => {
|
||||||
const errWindow = new BrowserWindow({
|
const errWindow = new BrowserWindow({
|
||||||
width: Math.floor(screen.getPrimaryDisplay().size.width * 0.5),
|
width: Math.floor(screen.getPrimaryDisplay().size.width * 0.5),
|
||||||
height: Math.floor(screen.getPrimaryDisplay().workAreaSize.height * 0.8),
|
height: Math.floor(screen.getPrimaryDisplay().workAreaSize.height * 0.8),
|
||||||
frame: false,
|
frame: "darwin" === process.platform,
|
||||||
|
titleBarStyle: "hidden",
|
||||||
|
fullscreenable: false,
|
||||||
icon: path.join(appDir, "stage", "icon-large.png"),
|
icon: path.join(appDir, "stage", "icon-large.png"),
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true, webviewTag: true, webSecurity: false, contextIsolation: false,
|
nodeIntegration: true, webviewTag: true, webSecurity: false, contextIsolation: false,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue