From abc8d7fcce612512a463415395be277c4ab06286 Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Wed, 8 Oct 2025 22:14:42 -0700 Subject: [PATCH] Npm run test puterjs (#1719) * chore: add http-server as a dev dependency and update package scripts * refactor: move maximized window positioning logic to UIWindow and remove from UITaskbar --- src/gui/src/UI/UITaskbar.js | 39 ---------------------------- src/gui/src/UI/UIWindow.js | 51 +++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 39 deletions(-) diff --git a/src/gui/src/UI/UITaskbar.js b/src/gui/src/UI/UITaskbar.js index eae7c44af..2122959d4 100644 --- a/src/gui/src/UI/UITaskbar.js +++ b/src/gui/src/UI/UITaskbar.js @@ -593,45 +593,6 @@ window.update_desktop_dimensions_for_taskbar = function() { } }; -// Function to update maximized window positioning based on taskbar position -window.update_maximized_window_for_taskbar = function(el_window) { - const position = window.taskbar_position || 'bottom'; - - // Handle fullpage mode differently - if (window.is_fullpage_mode) { - $(el_window).css({ - 'top': window.toolbar_height + 'px', - 'left': '0', - 'width': '100%', - 'height': `calc(100% - ${window.toolbar_height}px)`, - }); - return; - } - - if (position === 'bottom') { - $(el_window).css({ - 'top': window.toolbar_height + 'px', - 'left': '0', - 'width': '100%', - 'height': `calc(100% - ${window.taskbar_height + window.toolbar_height + 6}px)`, - }); - } else if (position === 'left') { - $(el_window).css({ - 'top': window.toolbar_height + 'px', - 'left': window.taskbar_height + 1 + 'px', - 'width': `calc(100% - ${window.taskbar_height + 1}px)`, - 'height': `calc(100% - ${window.toolbar_height}px)`, - }); - } else if (position === 'right') { - $(el_window).css({ - 'top': window.toolbar_height + 'px', - 'left': '0', - 'width': `calc(100% - ${window.taskbar_height + 1}px)`, - 'height': `calc(100% - ${window.toolbar_height}px)`, - }); - } -}; - //------------------------------------------- // Dynamic taskbar item resizing for left/right positions //------------------------------------------- diff --git a/src/gui/src/UI/UIWindow.js b/src/gui/src/UI/UIWindow.js index 1e31fbaa7..9e747377a 100644 --- a/src/gui/src/UI/UIWindow.js +++ b/src/gui/src/UI/UIWindow.js @@ -240,6 +240,9 @@ async function UIWindow(options) { options.is_visible = false; options.position = 'absolute !important'; options.left = 'auto !important'; + + // panel is not visible by default + options.is_visible = false; } h += `
0){ + width = window.innerWidth - 400 - 2; + } + + $(el_window).css({ + 'top': window.toolbar_height + 'px', + 'left': '0', + 'width': width, + 'height': height + 'px', + }); + } else if (position === 'left') { + $(el_window).css({ + 'top': window.toolbar_height + 'px', + 'left': window.taskbar_height + 1 + 'px', + 'width': `calc(100% - ${window.taskbar_height + 1}px)`, + 'height': `calc(100% - ${window.toolbar_height}px)`, + }); + } else if (position === 'right') { + $(el_window).css({ + 'top': window.toolbar_height + 'px', + 'left': '0', + 'width': `calc(100% - ${window.taskbar_height + 1}px)`, + 'height': `calc(100% - ${window.toolbar_height}px)`, + }); + } +}; + + export default UIWindow;