Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,29 @@ function createWindow() {
sandbox: false,
},
// Use a frameless window so we can render a custom SnapDock titlebar
frame: false,
frame: false, // need to set to if dev == true else false
// On macOS we can hint to hide the native title bar inset
titleBarStyle: process.platform === 'darwin' ? 'hiddenInset' : undefined,
});

// --- DPI SCALING FIX ---
const { screen } = require("electron");
const scaleFactor = screen.getPrimaryDisplay().scaleFactor;

let zoom = 1.0;
if (scaleFactor >= 1.25 && scaleFactor < 1.5) zoom = 1.10;
else if (scaleFactor >= 1.5 && scaleFactor < 2.0) zoom = 1.25;
else if (scaleFactor >= 2.0) zoom = 1.40;

mainWindow.webContents.setZoomFactor(zoom);
// ------------------------

// Remove all menus
mainWindow.setMenu(null);
mainWindow.setMenuBarVisibility(false);
mainWindow.setAutoHideMenuBar(true);

// need to unblock for dev builds or test builds
// Block DevTools shortcuts
mainWindow.webContents.on("before-input-event", (event, input) => {
if (
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "snapdock",
"version": "3.1.2",
"version": "3.1.3",
"description": "A Minimal, Modern Markdown Editor",
"synopsis": "Fast, clean Markdown editor",
"homepage": "https://snapdock.app",
Expand Down