Skip to content

Commit

Permalink
dynamic header height
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceFox1 committed Nov 21, 2024
1 parent fa96292 commit 1381dd3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
8 changes: 1 addition & 7 deletions electron/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class Backend {
this.mainWindow = new Window(this, 'controller', {
width: 800,
height: 600,
frame: false,
// frame: false,
minWidth: 800,
minHeight: 600,
});
Expand All @@ -76,14 +76,8 @@ export class Backend {
this.mainWindow.windowInstance.on('close', (event: Electron.Event) => {
event.preventDefault();
this.mainWindow.windowInstance.hide();
// // Ask user if he really wants to close the application
// this.mainWindow!.windowInstance.webContents.send('app.stop.ask');
// this.logger.debug('Main window close event received');

});

// this.mainWindow.windowInstance.once('closed', () => process.exit(0));

const nextApp = (next as unknown as typeof next.default)({
dev: isDev,
dir: path.resolve(app.getAppPath(), '..', 'renderer'),
Expand Down
2 changes: 2 additions & 0 deletions electron/helpers/Window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export class Window {
preload: path.join(import.meta.dirname, '..', 'preload', 'preload.cjs'),
...options.webPreferences,
},
...(process.platform === 'darwin' ? {} : { titleBarOverlay: true }),
titleBarStyle: 'hidden',
};

this.window = new BrowserWindow(browserOptions);
Expand Down
11 changes: 0 additions & 11 deletions renderer/app/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ export default function Header(): React.ReactElement {
<h1 id={styles.appTitle}>Whats&lt;Pending&gt;</h1>
</div>
<div id={styles.rightSide}>
<div id={styles.actionButtons}>
<div id={styles.minimize} onClick={(): void => {
((globalThis as any).ipc)?.send('controller.minimize');
}}></div>
<div id={styles.maximize} onClick={(): void => {
((globalThis as any).ipc)?.send('controller.maximize');
}}></div>
<div id={styles.close} onClick={(): void => {
((globalThis as any).ipc)?.send('app.stop');
}}></div>
</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion renderer/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:root {
--header-height: 1.75rem;
--header-height: env(titlebar-area-height, 1.75rem);
--max-width: 1407px;
--border-radius: 0.5rem;

Expand Down

0 comments on commit 1381dd3

Please sign in to comment.