ソースを参照

Fix `auto` not being triggered when changing visibility

Nariman Jelveh 1 年間 前
コミット
8883c892ed

+ 7 - 7
src/UI/Settings/UIWindowSettings.js

@@ -129,14 +129,14 @@ async function UIWindowSettings(options){
 
                 // Clock
                 h += `<div class="settings-content" data-settings="clock">`;
-                     h += `<h1>Clock</h1>`;
+                     h += `<h1>${i18n('clock')}</h1>`;
                      h += `<div style="display: flex;align-items: center">`
-                        h += `<span>${i18n('click_visible')}:</span>`
-                        h += `<Select class="change-clock-visible" style="margin-left: 10px;flex: 1">`
-                            h += `<option value="auto">${i18n('click_visible_auto')}</option>`
-                            h += `<option value="hide">${i18n('click_visible_hide')}</option>`
-                            h += `<option value="show">${i18n('click_visible_show')}</option>`
-                        h += `</Select>`
+                        h += `<span>${i18n('visibility')}:</span>`
+                        h += `<select class="change-clock-visible" style="margin-left: 10px;flex: 1">`
+                            h += `<option value="auto">${i18n('clock_visible_auto')}</option>`
+                            h += `<option value="hide">${i18n('clock_visible_hide')}</option>`
+                            h += `<option value="show">${i18n('clock_visible_show')}</option>`
+                        h += `</select>`
                      h += `</div>`
                 h += `</div>`;      
 

+ 3 - 1
src/helpers.js

@@ -3683,10 +3683,12 @@ window.delete_desktop_item_positions = ()=>{
 window.change_clock_visible = (clock_visible) => {
     let newValue = clock_visible || window.user_preferences.clock_visible;
     
+    
+    newValue === 'auto' && is_fullscreen() ? $('#clock').show() : $('#clock').hide();
+
     newValue === 'show' && $('#clock').show();
     newValue === 'hide' && $('#clock').hide();
 
-
     if(clock_visible) {
         // save clock_visible to user preferences
         window.mutate_user_preferences({

+ 4 - 4
src/i18n/translations/en.js

@@ -61,10 +61,9 @@ const en = {
         current_password: "Current Password",
         cut: 'Cut',
         clock: "Clock",
-        click_visible: 'Visible',
-        click_visible_hide: 'Hide - Always hidden',
-        click_visible_show: 'Show - Always visible',
-        click_visible_auto: 'Auto - Default, visible only in full-screen mode.',
+        clock_visible_hide: 'Hide - Always hidden',
+        clock_visible_show: 'Show - Always visible',
+        clock_visible_auto: 'Auto - Default, visible only in full-screen mode.',
         date_modified: 'Date modified',
         delete: 'Delete',
         delete_account: "Delete Account",
@@ -203,6 +202,7 @@ const en = {
         username: "Username",
         username_changed: 'Username updated successfully.',
         versions: "Versions",
+        visibility: 'Visibility',
         yes: 'Yes',
         yes_release_it: 'Yes, Release It',
         you_have_been_referred_to_puter_by_a_friend: "You have been referred to Puter by a friend!",

+ 4 - 4
src/i18n/translations/zh.js

@@ -51,10 +51,9 @@ const zh = {
         current_password: "当前密码",
         cut: '剪切',
         clock: "时间",
-        click_visible: '显示方式',
-        click_visible_hide: '隐藏 - 始终隐藏',
-        click_visible_show: '显示 - 始终显示',
-        click_visible_auto: '自动 - 默认值,全屏显示',
+        clock_visible_hide: '隐藏 - 始终隐藏',
+        clock_visible_show: '显示 - 始终显示',
+        clock_visible_auto: '自动 - 默认值,全屏显示',
         date_modified: '修改日期',
         delete: '删除',
         delete_permanently: "永久删除",
@@ -162,6 +161,7 @@ const zh = {
         upload_here: '在此上传',
         username: "用户名",
         username_changed: '用户名已成功更新。',
+        visibility: "可见性",
         versions: "版本",
         yes_release_it: '是的,释放它',
         you_have_been_referred_to_puter_by_a_friend: "您已经被朋友推荐到 Puter!",