diff --git a/contextAPI.js b/contextAPI.js index 920ed75..45f12ec 100644 --- a/contextAPI.js +++ b/contextAPI.js @@ -28,7 +28,8 @@ contextBridge.exposeInMainWorld("api", { appVersion : async () => await ipcRenderer.invoke("Ation::appVersion"), fonts : async () => await ipcRenderer.invoke("FontManager::fonts"), resize : size => ipcRenderer.invoke("WindowManager::resize", size), - fullscreen : fullscreen => ipcRenderer.invoke("WindowManager::presentFullscreen", fullscreen) + fullscreen : fullscreen => ipcRenderer.invoke("WindowManager::presentFullscreen", fullscreen), + maximize : () => ipcRenderer.send("WindowManager::toggleMaximize") }); contextBridge.exposeInMainWorld("appSettings", { diff --git a/src/WindowManager.js b/src/WindowManager.js index 8c996a6..3cb85f4 100644 --- a/src/WindowManager.js +++ b/src/WindowManager.js @@ -18,6 +18,7 @@ class WindowManager { ipcMain.on("WindowManager::openFileDialog", () => this.app.openFile()); ipcMain.on("WindowManager::openFile", (_, path) => this.app.openFile(path)); + ipcMain.on("WindowManager::toggleMaximize", () => this.mainWindow?.isMaximized() ? this.mainWindow?.unmaximize() : this.mainWindow?.maximize()); ipcMain.handle("WindowManager::resize", (_, height) => this.windows.settings.setSize(800, height + (process.platform === "win32" ? 50 : 0), true)); ipcMain.handle("WindowManager::presentFullscreen", (_, fullscreen) => this.windows.main.setFullScreen(fullscreen)); } diff --git a/src/ui/src/assets/css/_window.scss b/src/ui/src/assets/css/_window.scss index a5cbaa8..65cba4f 100644 --- a/src/ui/src/assets/css/_window.scss +++ b/src/ui/src/assets/css/_window.scss @@ -11,6 +11,10 @@ grid-column: 1 / span 2; } + &.edit { + //grid-template-columns: 10% auto; + } + main { background: color(mainBackground); overflow-y: auto; diff --git a/src/ui/src/components/Ation.js b/src/ui/src/components/Ation.js index 233485c..d0ca2a0 100644 --- a/src/ui/src/components/Ation.js +++ b/src/ui/src/components/Ation.js @@ -64,7 +64,7 @@ const Ation = () => { : ( -
+
{ document.documentElement.requestFullscreen(); }; + const toggleMaximize = () => { + window.api.maximize(); + }; + return ( -