Custom window controls (#46)

This commit is contained in:
Will Chen
2025-04-29 11:41:40 -07:00
committed by GitHub
parent 672bd790fa
commit a33e6c6ae3
6 changed files with 200 additions and 1 deletions

View File

@@ -776,4 +776,45 @@ export class IpcClient {
throw error;
}
}
// Window control methods
public async minimizeWindow(): Promise<void> {
try {
await this.ipcRenderer.invoke("window:minimize");
} catch (error) {
showError(error);
throw error;
}
}
public async maximizeWindow(): Promise<void> {
try {
await this.ipcRenderer.invoke("window:maximize");
} catch (error) {
showError(error);
throw error;
}
}
public async closeWindow(): Promise<void> {
try {
await this.ipcRenderer.invoke("window:close");
} catch (error) {
showError(error);
throw error;
}
}
// Get system platform (win32, darwin, linux)
public async getSystemPlatform(): Promise<string> {
try {
const platform = await this.ipcRenderer.invoke("window:get-platform");
return platform;
} catch (error) {
showError(error);
throw error;
}
}
// --- End window control methods ---
}