Skip to content

Build your personal knowledge base with Trilium Notes

feat(next): improve left margin to allow moving

Elian Doranaefd139592bf
diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css
index b8a83a3fab..875c98b14a 100644
--- a/src/public/stylesheets/style.css
+++ b/src/public/stylesheets/style.css
@@ -1278,6 +1278,10 @@ textarea {
color: var(--muted-text-color);
}
+body.electron:not(.native-titlebar) .tab-row-container {
+ padding-left: 2em;
+}
+
#tab-row-left-spacer {
width: env(titlebar-area-x);
-webkit-app-region: drag;
diff --git a/src/routes/index.ts b/src/routes/index.ts
index 17a5adad3a..a37965b4cd 100644
--- a/src/routes/index.ts
+++ b/src/routes/index.ts
@@ -28,13 +28,15 @@ function index(req: Request, res: Response) {
// The page is restored from cache, but the API call fail.
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
+ const isElectron = utils.isElectron();
res.render(view, {
csrfToken: csrfToken,
themeCssUrl: getThemeCssUrl(options.theme),
headingStyle: options.headingStyle,
layoutOrientation: options.layoutOrientation,
platform: process.platform,
- isElectron: utils.isElectron(),
+ isElectron,
+ hasNativeTitleBar: (isElectron && options.nativeTitleBarVisible === "true"),
mainFontSize: parseInt(options.mainFontSize),
treeFontSize: parseInt(options.treeFontSize),
detailFontSize: parseInt(options.detailFontSize),
diff --git a/src/views/desktop.ejs b/src/views/desktop.ejs
index d2db1f175e..f922e94541 100644
--- a/src/views/desktop.ejs
+++ b/src/views/desktop.ejs
@@ -6,7 +6,7 @@
<link rel="manifest" crossorigin="use-credentials" href="manifest.webmanifest">
<title>TriliumNext Notes</title>
</head>
-<body class="desktop heading-style-<%= headingStyle %> layout-<%= layoutOrientation %> platform-<%= platform %> <%= isElectron ? 'electron' : '' %>">
+<body class="desktop heading-style-<%= headingStyle %> layout-<%= layoutOrientation %> platform-<%= platform %> <%= isElectron ? 'electron' : '' %> <%= hasNativeTitleBar ? 'native-titlebar' : '' %>">
<noscript><%= t("javascript-required") %></noscript>
<script>