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