diff --git a/src/gui/src/UI/UIDesktop.js b/src/gui/src/UI/UIDesktop.js index ea51e508..42b525e7 100644 --- a/src/gui/src/UI/UIDesktop.js +++ b/src/gui/src/UI/UIDesktop.js @@ -655,8 +655,6 @@ async function UIDesktop(options){ >`; h += ``; - h += ``; - // Get window sidebar width puter.kv.get('window_sidebar_width').then(async (val) => { let value = parseInt(val); @@ -1105,8 +1103,12 @@ async function UIDesktop(options){ let ht = ''; ht += `
`; // logo - ht += ``; - + ht += ``; + + + //clock + ht += `
12:00 AM Sun, Jan 01
`; + // create account button ht += `
`; ht += ``; @@ -1145,9 +1147,12 @@ async function UIDesktop(options){ // prepend toolbar to desktop $(ht).insertBefore(el_desktop); + // send event window.dispatchEvent(new CustomEvent('toolbar:ready')); - + // init clock visibility + window.change_clock_visible(); + // notification container $('body').append(`
${i18n('close_all')}
`); @@ -1267,6 +1272,7 @@ async function UIDesktop(options){ }) function display_ct() { + var x = new Date() var ampm = x.getHours( ) >= 12 ? ' PM' : ' AM'; let hours = x.getHours( ) % 12; @@ -1279,19 +1285,20 @@ async function UIDesktop(options){ var seconds=x.getSeconds().toString() seconds=seconds.length==1 ? 0+seconds : seconds; - var month=(x.getMonth() +1).toString(); - month=month.length==1 ? 0+month : month; + var month = x.toLocaleString('default',{month : 'short'}); - var dt=x.getDate().toString(); + var dt = x.getDate().toString(); dt=dt.length==1 ? 0+dt : dt; - var x1=month + "/" + dt + "/" + x.getFullYear(); - x1 = x1 + " - " + hours + ":" + minutes + ":" + seconds + " " + ampm; + var day = x.toLocaleString('default',{weekday : 'short'}); + + + var x1= day + ", " + month + " " + dt; + x1 = hours + ":" + minutes + ampm + " " + x1; $('#clock').html(x1); - $('#clock').css('line-height', window.taskbar_height + 'px'); } - - setInterval(display_ct, 1000); + display_ct() + setInterval(display_ct,1000); // show referral notice window if(window.show_referral_notice && !window.user.email_confirmed){ diff --git a/src/gui/src/UI/UITaskbar.js b/src/gui/src/UI/UITaskbar.js index 783ca919..6c59c27b 100644 --- a/src/gui/src/UI/UITaskbar.js +++ b/src/gui/src/UI/UITaskbar.js @@ -49,8 +49,6 @@ async function UITaskbar(options){ $('.desktop').append(h); - // init clock visibility - window.change_clock_visible(); //--------------------------------------------- // add `Start` to taskbar diff --git a/src/gui/src/css/style.css b/src/gui/src/css/style.css index 67a3c02a..c23a34ff 100644 --- a/src/gui/src/css/style.css +++ b/src/gui/src/css/style.css @@ -2398,12 +2398,12 @@ label { #clock { display: none; - position: absolute; - right: 15px; color: white; - text-shadow: 0px 0px 3px #00000082, 0px 0px 3px #00000082, 0px 0px 3px #00000082; font-size: 13px; - bottom: 5px; + background-color: #00000056; + padding: 5px; + border-radius: 5px; + opacity: 0.8; } .device-phone #clock { diff --git a/src/gui/src/helpers.js b/src/gui/src/helpers.js index 86aab6f0..366569d3 100644 --- a/src/gui/src/helpers.js +++ b/src/gui/src/helpers.js @@ -2551,8 +2551,8 @@ window.change_clock_visible = (clock_visible) => { newValue === 'auto' && window.is_fullscreen() ? $('#clock').show() : $('#clock').hide(); - newValue === 'show' && $('#clock').show(); - newValue === 'hide' && $('#clock').hide(); + newValue === 'show' && $('#clock').show() && $('#toolbar-first').css('margin-right', ''); + newValue === 'hide' && $('#clock').hide() && $('#toolbar-first').css('margin-right', 'auto'); if(clock_visible) { // save clock_visible to user preferences