Skip to content

Commit 6cbd402

Browse files
authored
feat: replace font size slider with button group for better UX (#788)
1 parent 5a45639 commit 6cbd402

File tree

10 files changed

+47
-49
lines changed

10 files changed

+47
-49
lines changed

src/renderer/src/components/settings/DisplaySettings.vue

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,17 @@
5757
<Icon icon="lucide:a-large-small" class="w-4 h-4 text-muted-foreground" />
5858
<span class="text-sm font-medium">{{ t('settings.display.fontSize') }}</span>
5959
</span>
60-
<div class="flex flex-row items-center gap-2 pl-6">
61-
<Slider
62-
:default-value="[fontSizeLevel]"
63-
:model-value="[fontSizeLevel]"
64-
:min="0"
65-
:max="4"
66-
:step="1"
67-
class="w-full max-w-sm"
68-
@update:model-value="(val) => (fontSizeLevel = val?.[0] ?? 1)"
69-
/>
70-
<span class="text-xs w-16 text-center">{{
71-
t('settings.display.' + fontSizeClass.toLowerCase())
72-
}}</span>
60+
<div class="flex flex-wrap items-center gap-1.5 pl-6">
61+
<Button
62+
v-for="(sizeOption, index) in fontSizeOptions"
63+
:key="index"
64+
:variant="fontSizeLevel === index ? 'default' : 'outline'"
65+
size="sm"
66+
class="px-2 py-1.5 text-xs flex-shrink-0"
67+
@click="fontSizeLevel = index"
68+
>
69+
{{ t('settings.display.' + sizeOption) }}
70+
</Button>
7371
</div>
7472
</div>
7573

@@ -172,7 +170,6 @@ import {
172170
} from '@/components/ui/dialog'
173171
import { Button } from '@/components/ui/button'
174172
import { Switch } from '@/components/ui/switch'
175-
import { Slider } from '@/components/ui/slider'
176173
177174
const languageStore = useLanguageStore()
178175
const settingsStore = useSettingsStore()
@@ -200,11 +197,12 @@ watch(selectedLanguage, async (newValue) => {
200197
})
201198
202199
// --- Font Size Settings ---
200+
const fontSizeOptions = ['text-sm', 'text-base', 'text-lg', 'text-xl', 'text-2xl']
201+
203202
const fontSizeLevel = computed({
204203
get: () => settingsStore.fontSizeLevel,
205204
set: (value) => settingsStore.updateFontSizeLevel(value)
206205
})
207-
const fontSizeClass = computed(() => settingsStore.fontSizeClass)
208206
209207
// --- Content Protection Settings ---
210208
const contentProtectionEnabled = computed({

src/renderer/src/i18n/en-US/settings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,11 @@
737737
},
738738
"display": {
739739
"fontSize": "Text size",
740-
"text-2xl": "Extremely large",
741-
"text-base": "Default",
742-
"text-lg": "Big",
743740
"text-sm": "Small",
744-
"text-xl": "Large",
741+
"text-base": "Medium",
742+
"text-lg": "Large",
743+
"text-xl": "X-Large",
744+
"text-2xl": "XX-Large",
745745
"floatingButton": "Floating Button",
746746
"floatingButtonDesc": "Display a floating button on the desktop to quickly activate the application window"
747747
},

src/renderer/src/i18n/fa-IR/settings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,11 @@
737737
},
738738
"display": {
739739
"fontSize": "اندازه قلم",
740-
"text-2xl": "بسیار بسیار بزرگ",
741-
"text-base": "پیش‌فرض",
742-
"text-lg": "بزرگ",
743740
"text-sm": "کوچک",
744-
"text-xl": "بسیار بزرگ",
741+
"text-base": "متوسط",
742+
"text-lg": "بزرگ",
743+
"text-xl": "XL",
744+
"text-2xl": "XXL",
745745
"floatingButton": "دکمه شناور",
746746
"floatingButtonDesc": "نمایش یک دکمه شناور بر روی دسکتاپ برای فعال‌سازی سریع پنجره برنامه"
747747
},

src/renderer/src/i18n/fr-FR/settings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,11 @@
737737
},
738738
"display": {
739739
"fontSize": "Taille de texte",
740-
"text-2xl": "Extrêmement grand",
741-
"text-base": "défaut",
742-
"text-lg": "grand",
743740
"text-sm": "Petit",
744-
"text-xl": "Extrêmement grand",
741+
"text-base": "Moyen",
742+
"text-lg": "Grand",
743+
"text-xl": "XL",
744+
"text-2xl": "XXL",
745745
"floatingButton": "Bouton flottant",
746746
"floatingButtonDesc": "Afficher un bouton flottant sur le bureau pour activer rapidement la fenêtre de l'application"
747747
},

src/renderer/src/i18n/ja-JP/settings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,11 @@
737737
},
738738
"display": {
739739
"fontSize": "テキストサイズ",
740-
"text-2xl": "非常に大きい",
741-
"text-base": "デフォルト",
742-
"text-lg": "大きい",
743-
"text-sm": "小さい",
744-
"text-xl": "非常に大きい",
740+
"text-sm": "",
741+
"text-base": "",
742+
"text-lg": "",
743+
"text-xl": "XL",
744+
"text-2xl": "XXL",
745745
"floatingButton": "フローティングボタン",
746746
"floatingButtonDesc": "デスクトップにフローティングボタンを表示し、アプリケーションウィンドウを素早く起動できます"
747747
},

src/renderer/src/i18n/ko-KR/settings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,11 @@
737737
},
738738
"display": {
739739
"fontSize": "텍스트 크기",
740-
"text-2xl": "매우 큽니다",
741-
"text-base": "기본",
742-
"text-lg": "",
743-
"text-sm": "작은",
744-
"text-xl": "매우 큽니다",
740+
"text-sm": "작음",
741+
"text-base": "보통",
742+
"text-lg": "",
743+
"text-xl": "XL",
744+
"text-2xl": "XXL",
745745
"floatingButton": "플로팅 버튼",
746746
"floatingButtonDesc": "데스크톱에 플로팅 버튼을 표시하여 애플리케이션 창을 빠르게 활성화할 수 있습니다"
747747
},

src/renderer/src/i18n/ru-RU/settings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,11 @@
737737
},
738738
"display": {
739739
"fontSize": "Размер текста",
740-
"text-2xl": "Чрезвычайно большой",
741-
"text-base": "Маленький",
742-
"text-lg": "по умолчанию",
743-
"text-sm": "Чрезвычайно маленький",
744-
"text-xl": "большой",
740+
"text-sm": "Малый",
741+
"text-base": "Средний",
742+
"text-lg": "Большой",
743+
"text-xl": "XL",
744+
"text-2xl": "XXL",
745745
"floatingButton": "Плавающая кнопка",
746746
"floatingButtonDesc": "Отображать плавающую кнопку на рабочем столе для быстрого активации окна приложения"
747747
},

src/renderer/src/i18n/zh-CN/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@
738738
"display": {
739739
"fontSize": "文字大小",
740740
"text-sm": "",
741-
"text-base": "默认",
741+
"text-base": "标准",
742742
"text-lg": "",
743743
"text-xl": "特大",
744744
"text-2xl": "超大",

src/renderer/src/i18n/zh-HK/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,11 @@
737737
},
738738
"display": {
739739
"fontSize": "文字大小",
740-
"text-2xl": "超大",
741-
"text-base": "預設",
742-
"text-lg": "",
743740
"text-sm": "",
741+
"text-base": "標準",
742+
"text-lg": "",
744743
"text-xl": "特大",
744+
"text-2xl": "超大",
745745
"floatingButton": "懸浮按鈕",
746746
"floatingButtonDesc": "在桌面顯示一個懸浮按鈕,可以快速喚起應用程式視窗"
747747
},

src/renderer/src/i18n/zh-TW/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,11 @@
737737
},
738738
"display": {
739739
"fontSize": "文字大小",
740-
"text-2xl": "超大",
741-
"text-base": "預設",
742-
"text-lg": "",
743740
"text-sm": "",
741+
"text-base": "標準",
742+
"text-lg": "",
744743
"text-xl": "特大",
744+
"text-2xl": "超大",
745745
"floatingButton": "懸浮按鈕",
746746
"floatingButtonDesc": "在桌面顯示一個懸浮按鈕,可以快速喚起應用程式視窗"
747747
},

0 commit comments

Comments
 (0)