Skip to content

Build your personal knowledge base with Trilium Notes

feat(desktop): collapse spacing in full screen

Elian Doran6958e4b74fed
diff --git a/apps/client/src/desktop.ts b/apps/client/src/desktop.ts
index cca6c8c0f4..6462c13388 100644
--- a/apps/client/src/desktop.ts
+++ b/apps/client/src/desktop.ts
@@ -58,6 +58,7 @@ function initOnElectron() {
initDarkOrLightMode(style);
initTransparencyEffects(style, currentWindow);
+ initFullScreenDetection(currentWindow);
if (options.get("nativeTitleBarVisible") !== "true") {
initTitleBarButtons(style, currentWindow);
@@ -87,6 +88,11 @@ function initTitleBarButtons(style: CSSStyleDeclaration, currentWindow: Electron
}
}
+function initFullScreenDetection(currentWindow: Electron.BrowserWindow) {
+ currentWindow.on("enter-full-screen", () => document.body.classList.add("full-screen"));
+ currentWindow.on("leave-full-screen", () => document.body.classList.remove("full-screen"));
+}
+
function initTransparencyEffects(style: CSSStyleDeclaration, currentWindow: Electron.BrowserWindow) {
if (window.glob.platform === "win32") {
const material = style.getPropertyValue("--background-material");
diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css
index d49a14f7e8..342cd671a3 100644
--- a/apps/client/src/stylesheets/style.css
+++ b/apps/client/src/stylesheets/style.css
@@ -2009,7 +2009,7 @@ body.electron.platform-darwin:not(.native-titlebar) .tab-row-container {
-webkit-app-region: drag;
}
-body.electron.platform-darwin:not(.native-titlebar) #tab-row-left-spacer {
+body.electron.platform-darwin:not(.native-titlebar):not(.full-screen) #tab-row-left-spacer {
width: 80px;
}