diff --git a/src/gui/src/UI/Settings/UITabPersonalization.js b/src/gui/src/UI/Settings/UITabPersonalization.js index b5002f3cb1..88009eacc1 100644 --- a/src/gui/src/UI/Settings/UITabPersonalization.js +++ b/src/gui/src/UI/Settings/UITabPersonalization.js @@ -48,6 +48,14 @@ export default { +
+ Auto-Hide Toolbar + +
+
${i18n('menubar_style')}
@@ -102,6 +110,42 @@ export default { window.change_clock_visible(); + // ============================================ + // Toolbar Auto-Hide Toggle Handler + // ============================================ + + // Load the current state from KV store and set checkbox + puter.kv.get('user_preferences.toolbar_autohide').then(async (val) => { + const isEnabled = !!val; + $el_window.find('.toggle-toolbar-autohide').prop('checked', isEnabled); + + // Also sync with the toolbar_autohide state + if (window.toolbar_autohide && isEnabled !== window.toolbar_autohide.isEnabled) { + if (isEnabled) { + window.toolbar_autohide.enable(); + } else { + window.toolbar_autohide.disable(); + } + } + }); + + // Handle checkbox changes + $el_window.find('.toggle-toolbar-autohide').on('change', function(e) { + const isEnabled = $(this).is(':checked'); + if (window.toolbar_autohide) { + if (isEnabled) { + window.toolbar_autohide.enable(); + } else { + window.toolbar_autohide.disable(); + } + // Save preference + window.mutate_user_preferences({ + toolbar_autohide: isEnabled + }); + } + }); + // ============================================ + puter.kv.get('menubar_style').then(async (val) => { if(val === 'system' || !val){ $el_window.find('#menubar_style_system').prop('checked', true); @@ -152,4 +196,4 @@ export default { } }) }, -}; +}; \ No newline at end of file diff --git a/src/gui/src/UI/UIDesktop.js b/src/gui/src/UI/UIDesktop.js index 6b9d619fb6..7099b23259 100644 --- a/src/gui/src/UI/UIDesktop.js +++ b/src/gui/src/UI/UIDesktop.js @@ -42,6 +42,7 @@ import UIWindowWelcome from "./UIWindowWelcome.js" import launch_app from "../helpers/launch_app.js" import item_icon from "../helpers/item_icon.js" import UIWindowSearch from "./UIWindowSearch.js" +import toolbar_autohide from "../helpers/toolbar_autohide.js" async function UIDesktop(options){ let h = ''; @@ -1105,7 +1106,7 @@ async function UIDesktop(options){ let ht = ''; ht += `
`; // logo - ht += ``; + ht += ``; // create account button ht += `