mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-01 18:06:53 +01:00
feat: added more editor font sizes, closes #440
This commit is contained in:
parent
84168d1d75
commit
d114f8a651
@ -1588,7 +1588,8 @@ export class MySQLClient extends AntaresCore {
|
|||||||
let timeStop: Date;
|
let timeStop: Date;
|
||||||
let keysArr: antares.QueryForeign[] = [];
|
let keysArr: antares.QueryForeign[] = [];
|
||||||
|
|
||||||
const { rows, report, fields, keys, duration } = await new Promise((resolve, reject) => {
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const { rows, report, fields, keys, duration }: any = await new Promise((resolve, reject) => {
|
||||||
connection.query({ sql: query, nestTables }).then(async ([response, fields]) => {
|
connection.query({ sql: query, nestTables }).then(async ([response, fields]) => {
|
||||||
timeStop = new Date();
|
timeStop = new Date();
|
||||||
const queryResult = response;
|
const queryResult = response;
|
||||||
|
@ -1426,7 +1426,8 @@ export class PostgreSQLClient extends AntaresCore {
|
|||||||
let timeStop: Date;
|
let timeStop: Date;
|
||||||
let keysArr: antares.QueryForeign[] = [];
|
let keysArr: antares.QueryForeign[] = [];
|
||||||
|
|
||||||
const { rows, report, fields, keys, duration } = await new Promise((resolve, reject) => {
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const { rows, report, fields, keys, duration }: any = await new Promise((resolve, reject) => {
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const res = await connection.query({ rowMode: args.nest ? 'array' : null, text: query });
|
const res = await connection.query({ rowMode: args.nest ? 'array' : null, text: query });
|
||||||
|
@ -628,7 +628,8 @@ export class SQLiteClient extends AntaresCore {
|
|||||||
let timeStop;
|
let timeStop;
|
||||||
const keysArr: antares.QueryForeign[] = [];
|
const keysArr: antares.QueryForeign[] = [];
|
||||||
|
|
||||||
const { rows, report, fields, keys, duration } = await new Promise((resolve, reject) => {
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const { rows, report, fields, keys, duration }: any = await new Promise((resolve, reject) => {
|
||||||
(async () => {
|
(async () => {
|
||||||
let queryRunResult: sqlite.RunResult;
|
let queryRunResult: sqlite.RunResult;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
@ -51,14 +51,17 @@ watch(editorTheme, () => {
|
|||||||
|
|
||||||
watch(editorFontSize, () => {
|
watch(editorFontSize, () => {
|
||||||
const sizes = {
|
const sizes = {
|
||||||
small: 12,
|
xsmall: '10px',
|
||||||
medium: 14,
|
small: '12px',
|
||||||
large: 16
|
medium: '14px',
|
||||||
|
large: '16px',
|
||||||
|
xlarge: '18px',
|
||||||
|
xxlarge: '20px'
|
||||||
};
|
};
|
||||||
|
|
||||||
if (editor) {
|
if (editor) {
|
||||||
editor.setOptions({
|
editor.setOptions({
|
||||||
fontSize: sizes[editorFontSize.value as undefined as 'small' | 'medium' | 'large']
|
fontSize: sizes[editorFontSize.value]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -239,7 +239,7 @@
|
|||||||
<div class="column col-12 h6 text-uppercase mb-2 mt-4">
|
<div class="column col-12 h6 text-uppercase mb-2 mt-4">
|
||||||
{{ t('message.editorTheme') }}
|
{{ t('message.editorTheme') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="column col-6 h5 mb-4">
|
<div class="column col-5 h5 mb-4">
|
||||||
<BaseSelect
|
<BaseSelect
|
||||||
v-model="localEditorTheme"
|
v-model="localEditorTheme"
|
||||||
class="form-select"
|
class="form-select"
|
||||||
@ -251,28 +251,49 @@
|
|||||||
@change="changeEditorTheme(localEditorTheme)"
|
@change="changeEditorTheme(localEditorTheme)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="column col-6 mb-4">
|
<div class="column col-7 mb-4">
|
||||||
<div class="btn-group btn-group-block">
|
<div class="btn-group btn-group-block">
|
||||||
|
<button
|
||||||
|
class="btn btn-dark cut-text"
|
||||||
|
:class="{'active': editorFontSize === 'xsmall'}"
|
||||||
|
@click="changeEditorFontSize('xsmall')"
|
||||||
|
>
|
||||||
|
10px
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-dark cut-text"
|
class="btn btn-dark cut-text"
|
||||||
:class="{'active': editorFontSize === 'small'}"
|
:class="{'active': editorFontSize === 'small'}"
|
||||||
@click="changeEditorFontSize('small')"
|
@click="changeEditorFontSize('small')"
|
||||||
>
|
>
|
||||||
{{ t('word.small') }}
|
12px
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-dark cut-text"
|
class="btn btn-dark cut-text"
|
||||||
:class="{'active': editorFontSize === 'medium'}"
|
:class="{'active': editorFontSize === 'medium'}"
|
||||||
@click="changeEditorFontSize('medium')"
|
@click="changeEditorFontSize('medium')"
|
||||||
>
|
>
|
||||||
{{ t('word.medium') }}
|
14px
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-dark cut-text"
|
class="btn btn-dark cut-text"
|
||||||
:class="{'active': editorFontSize === 'large'}"
|
:class="{'active': editorFontSize === 'large'}"
|
||||||
@click="changeEditorFontSize('large')"
|
@click="changeEditorFontSize('large')"
|
||||||
>
|
>
|
||||||
{{ t('word.large') }}
|
16px
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-dark cut-text"
|
||||||
|
:class="{'active': editorFontSize === 'xlarge'}"
|
||||||
|
@click="changeEditorFontSize('xlarge')"
|
||||||
|
>
|
||||||
|
18px
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-dark cut-text"
|
||||||
|
:class="{'active': editorFontSize === 'xxlarge'}"
|
||||||
|
@click="changeEditorFontSize('xxlarge')"
|
||||||
|
>
|
||||||
|
20px
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,9 +35,12 @@ const {
|
|||||||
} = storeToRefs(settingsStore);
|
} = storeToRefs(settingsStore);
|
||||||
|
|
||||||
const sizes = {
|
const sizes = {
|
||||||
|
xsmall: '10px',
|
||||||
small: '12px',
|
small: '12px',
|
||||||
medium: '14px',
|
medium: '14px',
|
||||||
large: '16px'
|
large: '16px',
|
||||||
|
xlarge: '18px',
|
||||||
|
xxlarge: '20px'
|
||||||
};
|
};
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -10,7 +10,7 @@ const isDarkTheme = window.matchMedia('(prefers-color-scheme: dark)');
|
|||||||
const defaultAppTheme = isDarkTheme.matches ? 'dark' : 'light';
|
const defaultAppTheme = isDarkTheme.matches ? 'dark' : 'light';
|
||||||
const defaultEditorTheme = isDarkTheme.matches ? 'twilight' : 'sqlserver';
|
const defaultEditorTheme = isDarkTheme.matches ? 'twilight' : 'sqlserver';
|
||||||
|
|
||||||
export type EditorFontSize = 'small' | 'medium' | 'large';
|
export type EditorFontSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
||||||
export type ApplicationTheme = 'light' | 'dark';
|
export type ApplicationTheme = 'light' | 'dark';
|
||||||
|
|
||||||
export const useSettingsStore = defineStore('settings', {
|
export const useSettingsStore = defineStore('settings', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user