Improves macOS settings window appearance and behavior

Updates the frame, title bar, and traffic light positioning for the settings window on macOS to better match platform conventions.
Ensures window button visibility and adjusts fullscreen capabilities for greater consistency across platforms.
This commit is contained in:
bincxz
2025-12-26 01:40:20 +08:00
parent e107247dbc
commit 92ae9ed6f4

View File

@@ -558,14 +558,15 @@ async function openSettingsWindow(electronModule, options) {
minHeight: 600,
backgroundColor,
icon: appIcon,
fullscreenable: !isMac,
// NOTE: Do NOT set parent on Windows - it can cause the main window to close
// when the settings window is closed in some edge cases.
parent: isMac ? mainWindow : undefined,
modal: false,
show: false,
frame: false,
frame: isMac,
titleBarStyle: isMac ? "hiddenInset" : undefined,
trafficLightPosition: isMac ? { x: 16, y: 18 } : undefined,
trafficLightPosition: isMac ? { x: 12, y: 12 } : undefined,
webPreferences: {
preload,
contextIsolation: true,
@@ -576,6 +577,14 @@ async function openSettingsWindow(electronModule, options) {
settingsWindow = win;
if (isMac) {
try {
win.setWindowButtonVisibility(true);
} catch {
// ignore
}
}
win.on("enter-full-screen", () => {
win.webContents?.send("netcatty:window:fullscreen-changed", true);
});