mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
custom window title works on mac
This commit is contained in:
@@ -176,7 +176,8 @@ function fillMissingSettings(value) {
|
||||
...value,
|
||||
};
|
||||
if (value['app.useNativeMenu'] !== true && value['app.useNativeMenu'] !== false) {
|
||||
res['app.useNativeMenu'] = os.platform() == 'darwin' ? true : false;
|
||||
res['app.useNativeMenu'] = false;
|
||||
// res['app.useNativeMenu'] = os.platform() == 'darwin' ? true : false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ registerCommand({
|
||||
category: 'New',
|
||||
icon: 'img shell',
|
||||
name: 'JavaScript Shell',
|
||||
menuName: ' New JavaScript shell',
|
||||
menuName: 'New JavaScript shell',
|
||||
onClick: () => {
|
||||
openNewTab({
|
||||
title: 'Shell #',
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
import { EDITOR_THEMES, FONT_SIZES } from '../query/AceEditor.svelte';
|
||||
import SqlEditor from '../query/SqlEditor.svelte';
|
||||
import { currentEditorFontSize, currentEditorTheme, extensions, selectedWidget } from '../stores';
|
||||
import { isMac } from '../utility/common';
|
||||
import getElectron from '../utility/getElectron';
|
||||
import ThemeSkeleton from './ThemeSkeleton.svelte';
|
||||
|
||||
@@ -66,7 +67,7 @@ ORDER BY
|
||||
<div class="heading">Appearance</div>
|
||||
<FormCheckboxField
|
||||
name="app.useNativeMenu"
|
||||
label="Use system native menu"
|
||||
label={isMac() ? 'Use native window title' : 'Use system native menu'}
|
||||
on:change={() => {
|
||||
restartWarning = true;
|
||||
}}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import HorizontalMenu from '../modals/HorizontalMenu.svelte';
|
||||
|
||||
import { activeTab, currentDatabase } from '../stores';
|
||||
import { isMac } from '../utility/common';
|
||||
import getElectron from '../utility/getElectron';
|
||||
|
||||
$: title = _.compact([$activeTab?.title, $currentDatabase?.name, 'DbGate']).join(' - ');
|
||||
@@ -12,23 +13,27 @@
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
<div class="icon"><img src="logo192.png" width="20" height="20" /></div>
|
||||
<div class="menu">
|
||||
<HorizontalMenu items={mainMenuDefinition} />
|
||||
</div>
|
||||
{#if !isMac()}
|
||||
<div class="icon"><img src="logo192.png" width="20" height="20" /></div>
|
||||
<div class="menu">
|
||||
<HorizontalMenu items={mainMenuDefinition} />
|
||||
</div>
|
||||
{/if}
|
||||
<div class="title">{title}</div>
|
||||
|
||||
<div class="actions">
|
||||
<div class="button" on:click={() => electron.send('window-action', 'minimize')}>
|
||||
<FontIcon icon="icon window-minimize" />
|
||||
{#if !isMac()}
|
||||
<div class="actions">
|
||||
<div class="button" on:click={() => electron.send('window-action', 'minimize')}>
|
||||
<FontIcon icon="icon window-minimize" />
|
||||
</div>
|
||||
<div class="button">
|
||||
<FontIcon icon="icon window-restore" on:click={() => electron.send('window-action', 'maximize')} />
|
||||
</div>
|
||||
<div class="button close-button" on:click={() => electron.send('window-action', 'close')}>
|
||||
<FontIcon icon="icon window-close" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="button">
|
||||
<FontIcon icon="icon window-restore" on:click={() => electron.send('window-action', 'maximize')} />
|
||||
</div>
|
||||
<div class="button close-button" on:click={() => electron.send('window-action', 'close')}>
|
||||
<FontIcon icon="icon window-close" />
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user