feat: added more editor font sizes, closes #440

This commit is contained in:
Fabio Di Stasio 2022-09-21 10:33:44 +02:00
parent 84168d1d75
commit d114f8a651
7 changed files with 44 additions and 14 deletions

View File

@ -1588,7 +1588,8 @@ export class MySQLClient extends AntaresCore {
let timeStop: Date;
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]) => {
timeStop = new Date();
const queryResult = response;

View File

@ -1426,7 +1426,8 @@ export class PostgreSQLClient extends AntaresCore {
let timeStop: Date;
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 () => {
try {
const res = await connection.query({ rowMode: args.nest ? 'array' : null, text: query });

View File

@ -628,7 +628,8 @@ export class SQLiteClient extends AntaresCore {
let timeStop;
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 () => {
let queryRunResult: sqlite.RunResult;
// eslint-disable-next-line @typescript-eslint/no-explicit-any

View File

@ -51,14 +51,17 @@ watch(editorTheme, () => {
watch(editorFontSize, () => {
const sizes = {
small: 12,
medium: 14,
large: 16
xsmall: '10px',
small: '12px',
medium: '14px',
large: '16px',
xlarge: '18px',
xxlarge: '20px'
};
if (editor) {
editor.setOptions({
fontSize: sizes[editorFontSize.value as undefined as 'small' | 'medium' | 'large']
fontSize: sizes[editorFontSize.value]
});
}
});

View File

@ -239,7 +239,7 @@
<div class="column col-12 h6 text-uppercase mb-2 mt-4">
{{ t('message.editorTheme') }}
</div>
<div class="column col-6 h5 mb-4">
<div class="column col-5 h5 mb-4">
<BaseSelect
v-model="localEditorTheme"
class="form-select"
@ -251,28 +251,49 @@
@change="changeEditorTheme(localEditorTheme)"
/>
</div>
<div class="column col-6 mb-4">
<div class="column col-7 mb-4">
<div class="btn-group btn-group-block">
<button
class="btn btn-dark cut-text"
:class="{'active': editorFontSize === 'xsmall'}"
@click="changeEditorFontSize('xsmall')"
>
10px
</button>
<button
class="btn btn-dark cut-text"
:class="{'active': editorFontSize === 'small'}"
@click="changeEditorFontSize('small')"
>
{{ t('word.small') }}
12px
</button>
<button
class="btn btn-dark cut-text"
:class="{'active': editorFontSize === 'medium'}"
@click="changeEditorFontSize('medium')"
>
{{ t('word.medium') }}
14px
</button>
<button
class="btn btn-dark cut-text"
:class="{'active': editorFontSize === '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>
</div>
</div>

View File

@ -35,9 +35,12 @@ const {
} = storeToRefs(settingsStore);
const sizes = {
xsmall: '10px',
small: '12px',
medium: '14px',
large: '16px'
large: '16px',
xlarge: '18px',
xxlarge: '20px'
};
const props = defineProps({

View File

@ -10,7 +10,7 @@ const isDarkTheme = window.matchMedia('(prefers-color-scheme: dark)');
const defaultAppTheme = isDarkTheme.matches ? 'dark' : 'light';
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 const useSettingsStore = defineStore('settings', {