💄 Show native window controls on macOS crash dialog (#16357)

This commit is contained in:
Jeffrey Chen 2025-11-17 09:20:27 +08:00 committed by GitHub
parent cc59bd1087
commit d15f957239
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 3 deletions

View file

@ -91,7 +91,7 @@
.drag {
-webkit-app-region: drag;
height: 22px;
height: 32px;
cursor: pointer;
position: fixed;
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('content').innerHTML = decodeURIComponent(getSearch('content'))