tweak: Move clock settings to the 'Personalization' tab of 'Settings'

This commit is contained in:
jelveh 2024-10-22 17:18:16 -07:00
parent 6f702c3927
commit 4e8c7455aa
8 changed files with 29 additions and 50 deletions

View File

@ -1,45 +0,0 @@
/**
* Copyright (C) 2024 Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// About
export default {
id: 'clock',
title_i18n_key: 'clock',
icon: 'clock.svg',
html: () => {
return `
<h1>${i18n('clock')}</h1>
<div style="display: flex;align-items: center">
<span>${i18n('visibility')}:</span>
<select class="change-clock-visible" style="margin-left: 10px;flex: 1">
<option value="auto">${i18n('clock_visible_auto')}</option>
<option value="hide">${i18n('clock_visible_hide')}</option>
<option value="show">${i18n('clock_visible_show')}</option>
</select>
</div>`;
},
init: ($el_window) => {
$el_window.on('change', 'select.change-clock-visible', function(e){
window.change_clock_visible(this.value);
});
window.change_clock_visible();
},
};

View File

@ -40,8 +40,16 @@ export default {
<button class="button change-ui-colors" style="float:right;">${i18n('change_ui_colors')}</button> <button class="button change-ui-colors" style="float:right;">${i18n('change_ui_colors')}</button>
</div> </div>
</div> </div>
<div class="settings-card">
<strong style="flex-grow:1;">${i18n('clock_visibility')}</strong>
<select class="change-clock-visible" style="margin-left: 10px; max-width: 300px;">
<option value="auto">${i18n('clock_visible_auto')}</option>
<option value="hide">${i18n('clock_visible_hide')}</option>
<option value="show">${i18n('clock_visible_show')}</option>
</select>
</div>
<div class="settings-card" style="display: block; height: auto;"> <div class="settings-card" style="display: block; height: auto;">
<strong>${i18n('menubar_style')}</strong> <strong style="margin: 15px 0 30px; display: block;">${i18n('menubar_style')}</strong>
<div style="flex-grow:1; margin-top: 10px;"> <div style="flex-grow:1; margin-top: 10px;">
<div> <div>
<label style="display:inline;" for="menubar_style_system"> <label style="display:inline;" for="menubar_style_system">
@ -50,7 +58,6 @@ export default {
<p style="margin-left: 17px; margin-top: 5px; margin-bottom: 20px;">Set the menubar based on the host system settings</p> <p style="margin-left: 17px; margin-top: 5px; margin-bottom: 20px;">Set the menubar based on the host system settings</p>
</label> </label>
</div> </div>
<div> <div>
<label style="display:inline;" for="menubar_style_desktop"> <label style="display:inline;" for="menubar_style_desktop">
<input type="radio" name="menubar_style" class="menubar_style" value="desktop" id="menubar_style_desktop"> <input type="radio" name="menubar_style" class="menubar_style" value="desktop" id="menubar_style_desktop">

View File

@ -37,6 +37,11 @@ async function UIWindowSettings(options){
h += `<button class="sidebar-toggle hidden-lg hidden-xl hidden-md"><div class="sidebar-toggle-button"><span></span><span></span><span></span></div></button>`; h += `<button class="sidebar-toggle hidden-lg hidden-xl hidden-md"><div class="sidebar-toggle-button"><span></span><span></span><span></span></div></button>`;
// sidebar // sidebar
h += `<div class="settings-sidebar disable-user-select disable-context-menu">`; h += `<div class="settings-sidebar disable-user-select disable-context-menu">`;
// if data-is_fullpage="1" show title saying "Settings"
if (options.window_options?.is_fullpage) {
h += `<div class="settings-sidebar-title">${i18n('settings')}</div>`;
}
// sidebar items // sidebar items
h += `<div class="settings-sidebar-burger disable-context-menu disable-user-select" style="background-image: url(${window.icons['menu']});"></div>`; h += `<div class="settings-sidebar-burger disable-context-menu disable-user-select" style="background-image: url(${window.icons['menu']});"></div>`;
tabs.forEach((tab, i) => { tabs.forEach((tab, i) => {

View File

@ -1071,7 +1071,7 @@ async function UIDesktop(options){
// open settings // open settings
UIWindowSettings({ UIWindowSettings({
window_options:{ window_options:{
is_fullpage: true, // is_fullpage: true,
} }
}); });
} }

View File

@ -3611,6 +3611,15 @@ fieldset[name=number-code] {
margin-top: 1px; margin-top: 1px;
} }
.settings-sidebar-title{
margin-bottom: 20px;
font-weight: bold;
-webkit-font-smoothing: antialiased;
margin-top: 15px;
color: #8c8c8c;
font-size: 19px;
}
.settings-sidebar-item { .settings-sidebar-item {
cursor: pointer; cursor: pointer;
border-radius: 4px; border-radius: 4px;

View File

@ -173,6 +173,10 @@ $( window ).on( "resize", function() {
const new_desktop_width = window.innerWidth; const new_desktop_width = window.innerWidth;
$('.window').each((_, el) => { $('.window').each((_, el) => {
// if data-is_fullpage="1" then the window is in fullpage mode
// and should not be resized
if($(el).attr('data-is_fullpage') === "1") return;
const pos = $(el).position(); const pos = $(el).position();
const id = $(el).attr('id'); const id = $(el).attr('id');

View File

@ -44,6 +44,7 @@ const en = {
change_password: "Change Password", change_password: "Change Password",
change_ui_colors: "Change UI Colors", change_ui_colors: "Change UI Colors",
change_username: "Change Username", change_username: "Change Username",
clock_visibility: 'Clock Visibility',
close: 'Close', close: 'Close',
close_all_windows: "Close All Windows", close_all_windows: "Close All Windows",
close_all_windows_confirm: "Are you sure you want to close all windows?", close_all_windows_confirm: "Are you sure you want to close all windows?",

View File

@ -24,7 +24,6 @@ import AccountTab from '../UI/Settings/UITabAccount.js';
import SecurityTab from '../UI/Settings/UITabSecurity.js'; import SecurityTab from '../UI/Settings/UITabSecurity.js';
import PersonalizationTab from '../UI/Settings/UITabPersonalization.js'; import PersonalizationTab from '../UI/Settings/UITabPersonalization.js';
import LanguageTag from '../UI/Settings/UITabLanguage.js'; import LanguageTag from '../UI/Settings/UITabLanguage.js';
import ClockTab from '../UI/Settings/UITabClock.js';
export class SettingsService extends Service { export class SettingsService extends Service {
#tabs = []; #tabs = [];
@ -35,7 +34,6 @@ export class SettingsService extends Service {
SecurityTab, SecurityTab,
PersonalizationTab, PersonalizationTab,
LanguageTag, LanguageTag,
ClockTab,
AboutTab, AboutTab,
].forEach(tab => { ].forEach(tab => {
this.register_tab(tab); this.register_tab(tab);