Skip to content

Commit 9607706

Browse files
authored
fix: adjust toolbar positioning for sidepanel based on taskbar location (#1731)
* fix: adjust toolbar positioning for sidepanel based on taskbar location * fix: update window width calculation for left position based on open panels
1 parent 8f7a68a commit 9607706

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/gui/src/UI/UIWindow.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3633,8 +3633,9 @@ $.fn.makeWindowVisible = function(options){
36333633
'data-is_visible': '1',
36343634
});
36353635

3636-
// if sidepanel, shift desktop toolbar to the left
3637-
if($(this).attr('data-is_panel') === '1'){
3636+
// if sidepanel, shift desktop toolbar to the left
3637+
// only if taskbar is at the bottom
3638+
if($(this).attr('data-is_panel') === '1' && window.taskbar_position === 'bottom'){
36383639
$('.toolbar').css('left', `calc(50% - 200px)`);
36393640
$('.taskbar').css('left', `calc(50% - 200px)`);
36403641
}
@@ -3650,7 +3651,7 @@ $.fn.makeWindowInvisible = async function(options) {
36503651
'data-is_visible': '0',
36513652
});
36523653
// if sidepanel, shift desktop toolbar to the right
3653-
if($(this).attr('data-is_panel') === '1'){
3654+
if($(this).attr('data-is_panel') === '1' && window.taskbar_position === 'bottom'){
36543655
$('.toolbar').css('left', `calc(50%)`);
36553656
$('.taskbar').css('left', `calc(50%)`);
36563657
}
@@ -4008,10 +4009,17 @@ window.update_maximized_window_for_taskbar = function(el_window) {
40084009
'height': height + 'px',
40094010
});
40104011
} else if (position === 'left') {
4012+
let width = window.innerWidth - window.taskbar_height - 1;
4013+
4014+
// any open panels?
4015+
if($('.window[data-is_panel="1"][data-is_visible="1"]').length > 0){
4016+
width = `calc(100% - ${window.taskbar_height + 1}px - 400px - 1px)`;
4017+
}
4018+
40114019
$(el_window).css({
40124020
'top': window.toolbar_height + 'px',
40134021
'left': window.taskbar_height + 1 + 'px',
4014-
'width': `calc(100% - ${window.taskbar_height + 1}px)`,
4022+
'width': width,
40154023
'height': `calc(100% - ${window.toolbar_height}px)`,
40164024
});
40174025
} else if (position === 'right') {

0 commit comments

Comments
 (0)