mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-19 16:16:45 +00:00
feat(desktop): show zoom scale toast and lower UI scale limit to 70%
This commit is contained in:
@@ -1175,16 +1175,23 @@ function setGlobalUiScale(scale: number) {
|
||||
settingsStore.updateEditorSettings({ uiScale: scale });
|
||||
}
|
||||
|
||||
function showUiScaleToast() {
|
||||
toast(`${Math.round(settingsStore.editorSettings.uiScale * 100)}%`, 1500);
|
||||
}
|
||||
|
||||
function zoomInUi() {
|
||||
setGlobalUiScale(settingsStore.editorSettings.uiScale + 0.1);
|
||||
showUiScaleToast();
|
||||
}
|
||||
|
||||
function zoomOutUi() {
|
||||
setGlobalUiScale(settingsStore.editorSettings.uiScale - 0.1);
|
||||
showUiScaleToast();
|
||||
}
|
||||
|
||||
function resetUiZoom() {
|
||||
setGlobalUiScale(1);
|
||||
showUiScaleToast();
|
||||
}
|
||||
|
||||
function applyUiFontFamily(fontFamily: string) {
|
||||
|
||||
@@ -1138,7 +1138,7 @@ export const STORAGE_KEY = "dbx-editor-settings";
|
||||
const OLD_FONT_SIZE_KEY = "dbx-query-editor-font-size";
|
||||
const EXPORT_BATCH_SIZE_DEFAULT_MIGRATION_KEY = "dbx-export-batch-size-default-migrated-v1";
|
||||
const LEGACY_DEFAULT_EXPORT_BATCH_SIZE = 10000;
|
||||
const MIN_UI_SCALE = 0.75;
|
||||
const MIN_UI_SCALE = 0.7;
|
||||
const MAX_UI_SCALE = 2;
|
||||
|
||||
export function normalizeGlobalQueryTimeoutSecs(value: unknown): number {
|
||||
|
||||
+1
-1
@@ -1101,7 +1101,7 @@ test("normalizeEditorSettings falls back to the default UI scale", () => {
|
||||
});
|
||||
|
||||
test("normalizeEditorSettings clamps UI scale into the supported range", () => {
|
||||
assert.equal(normalizeEditorSettings({ uiScale: 0.2 }).uiScale, 0.75);
|
||||
assert.equal(normalizeEditorSettings({ uiScale: 0.2 }).uiScale, 0.7);
|
||||
assert.equal(normalizeEditorSettings({ uiScale: 2.8 }).uiScale, 2);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user