Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

任务栏小窗开关 #703

Merged
merged 1 commit into from
Apr 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/common/default_configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const configs = {
proxy_port: 0,
http_api_on: false,
http_api_only_local: true,
tray_mini_window: true,

// other
env: 'PROD' as 'PROD' | 'DEV',
Expand Down
1 change: 1 addition & 0 deletions src/common/i18n/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
http_api_on_desc:
'Läuft auf Port {0}, kann von Software von Drittanbietern wie Alfred verwendet werden, um den Host zu wechseln.',
http_api_only_local: 'HTTP-API hört nur auf 127.0.0.1',
tray_mini_window: 'Taskleistensymbol-Verknüpfung',
ignore_case: 'Groß- und Kleinschreibung ignorieren',
import: 'Importieren',
import_done: 'Der Import ist abgeschlossen.',
Expand Down
1 change: 1 addition & 0 deletions src/common/i18n/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default {
http_api_on_desc:
'Runs on port {0}, can be used by third-party software such as Alfred to switch hosts.',
http_api_only_local: 'HTTP API only listen 127.0.0.1',
tray_mini_window: 'taskbar icon shortcut',
ignore_case: 'Ignore case',
import: 'Import',
import_done: 'The import is complete.',
Expand Down
1 change: 1 addition & 0 deletions src/common/i18n/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default {
http_api_on_desc:
"Actif sur le port {0}, peut être utilisé par un logiciel tier comme Alfred pour changer d'hosts",
http_api_only_local: "L'API HTTP n'écoute que sur 127.0.0.1",
tray_mini_window: 'raccourci de l\'icône de la barre des tâches',
ignore_case: 'Ignorer la casse',
import: 'Importer',
import_done: "L'importation est terminée",
Expand Down
1 change: 1 addition & 0 deletions src/common/i18n/languages/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const lang: LanguageDict = {
http_api_on: '开启 HTTP API',
http_api_on_desc: '运行于 {0} 端口,可用于 Alfred 等第三方软件切换 hosts。',
http_api_only_local: 'HTTP API 仅监听 127.0.0.1',
tray_mini_window: '任务栏快捷小窗',
ignore_case: '忽略大小写',
import: '导入',
import_done: '导入已完成。',
Expand Down
5 changes: 4 additions & 1 deletion src/main/ui/tray/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ const makeTray = async () => {
return
}

tray.on('click', () => window())
tray.on('click', async () => {
let tray_mini_window = await configGet('tray_mini_window')
tray_mini_window ? window() : broadcast(events.active_main_window)
})

tray.on('double-click', () => broadcast(events.active_main_window))

Expand Down
13 changes: 13 additions & 0 deletions src/renderer/components/Pref/General.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,19 @@ const General = (props: IProps) => {
</VStack>
</FormControl>

<FormControl>
<VStack align="left">
<Checkbox
isChecked={data.tray_mini_window}
onChange={(e) =>
onChange({ tray_mini_window: e.target.checked })
}
>
{lang.tray_mini_window}
</Checkbox>
</VStack>
</FormControl>

<FormControl>
<VStack align="left">
<Checkbox
Expand Down