Skip to content

Commit

Permalink
add an option for using system frame on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
moonheart committed May 1, 2022
1 parent 29ef79b commit fef685d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/common/default_configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const configs = {
// UI
left_panel_show: true,
left_panel_width: 270,
use_system_window_frame: false,

// preferences
write_mode: null as WriteModeType,
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 @@ -176,6 +176,7 @@
'Möchten Sie uns helfen, SwitchHosts zu verbessern, indem Sie regelmäßig anonyme Nutzungsdaten übermitteln?',
usage_data_title: 'Machen Sie SwitchHosts besser!',
use_proxy: 'Proxy verwenden',
use_system_window_frame: 'System-Fensterrahmen verwenden',
view: 'Ansicht',
where_is_my_data: 'Wo sind meine Daten gespeichert?',
where_is_my_hosts: 'Wo ist meine Hosts-Datei?',
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 @@ -176,6 +176,7 @@ export default {
'Would you like to help us improve SwitchHosts by periodically submitting anonymous usage data?',
usage_data_title: 'Make SwitchHosts better!',
use_proxy: 'Use proxy',
use_system_window_frame: 'Use system window frame',
view: 'View',
where_is_my_data: 'Where is my data stored?',
where_is_my_hosts: 'Where is my hosts file?',
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 @@ -177,6 +177,7 @@ export default {
"Voulez-vous nous aider à améliorer SwitchHosts en soumettant périodiquement vos données d'utilisation de manière anonyme ?",
usage_data_title: 'Rendez SwitchHosts meilleur !',
use_proxy: 'Utiliser un proxy',
use_system_window_frame: 'Utiliser la bordure de fenêtre du système',
view: 'Vue',
where_is_my_data: 'Où sont stockées mes données ?',
where_is_my_hosts: 'Où est mon fichier hosts ?',
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 @@ -172,6 +172,7 @@ const lang: LanguageDict = {
'您愿意发送匿名的使用数据来帮助我们改进 SwitchHosts 吗?数据中不会包含任何隐私信息。',
usage_data_title: '帮助改进 SwitchHosts',
use_proxy: '使用代理',
use_system_window_frame: '使用系统窗口框架',
view: '视图',
where_is_my_data: '我的数据存储在哪里?',
where_is_my_hosts: '我的 hosts 文件在哪里?',
Expand Down
2 changes: 1 addition & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const createWindow = async () => {
minHeight: 200,
autoHideMenuBar: true,
titleBarStyle: 'hiddenInset',
frame: false,
frame: configs.use_system_window_frame || false,
webPreferences: {
contextIsolation: true,
preload: path.join(__dirname, 'preload.js'),
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 @@ -154,6 +154,19 @@ const General = (props: IProps) => {
</HStack>
</FormControl>

{agent.platform === 'linux' ? (
<FormControl>
<HStack>
<Checkbox
isChecked={data.use_system_window_frame}
onChange={(e) => onChange({ use_system_window_frame: e.target.checked })}
>
{lang.use_system_window_frame}
</Checkbox>
</HStack>
</FormControl>
) : null}

{agent.platform === 'darwin' ? (
<FormControl>
<HStack>
Expand Down

0 comments on commit fef685d

Please sign in to comment.