fix os logic

This commit is contained in:
2026-04-23 07:02:55 +02:00
parent 191e0e73fe
commit 573cc5dc74
4 changed files with 23 additions and 20 deletions

View File

@@ -7,6 +7,9 @@ const isMobile = (
let topZ = 100; let topZ = 100;
const MAX_PADDING = { left: 8, top: 8, right: 8, bottom: 60 }; const MAX_PADDING = { left: 8, top: 8, right: 8, bottom: 60 };
const maximizeIcon = '▢';
const restoreIcon = '🗗';
const startBtn = document.getElementById('start-btn'); const startBtn = document.getElementById('start-btn');
const startMenu = document.getElementById('start-menu'); const startMenu = document.getElementById('start-menu');
const windowsContainer = document.getElementById('windows'); const windowsContainer = document.getElementById('windows');
@@ -341,7 +344,7 @@ function handleWindowAction(payload) {
win.dataset.state = 'normal'; win.dataset.state = 'normal';
bringToFront(win); bringToFront(win);
btn.classList.add('focus'); btn.classList.add('focus');
btn.classList.remove('minimized'); btn.classList.remove('minimized');
@@ -378,7 +381,6 @@ function applyMaximized(win) {
win.classList.add('max'); win.classList.add('max');
win.dataset.state = 'maximized'; win.dataset.state = 'maximized';
} }
@@ -574,7 +576,7 @@ function wireWindowControls(win, taskbarBtn = null) {
maximize.addEventListener('click', (evt) => { maximize.addEventListener('click', (evt) => {
if(taskbarBtn != null) { if(taskbarBtn != null) {
taskbarBtn.classList.add('focus'); taskbarBtn.classList.add('focus');
maximize.innerHTML = win.dataset.state === 'normal' ? '🗗' : '▢'; maximize.innerHTML = win.dataset.state === 'normal' ? restoreIcon : maximizeIcon;
resetFocus(win.dataset.winid); resetFocus(win.dataset.winid);
} }
toggleMaximize(); toggleMaximize();
@@ -601,7 +603,7 @@ function wireWindowControls(win, taskbarBtn = null) {
if (taskbarBtn !== null) { if (taskbarBtn !== null) {
titlebar.addEventListener('dblclick', (evt) => { titlebar.addEventListener('dblclick', (evt) => {
toggleMaximize(); toggleMaximize();
titlebar.querySelector('.maximize').innerHTML = win.dataset.state === 'maximized' ? '🗗' : '▢'; titlebar.querySelector('.maximize').innerHTML = win.dataset.state === 'maximized' ? restoreIcon : maximizeIcon;
saveOpenWindows() saveOpenWindows()
}); });
} }
@@ -612,7 +614,7 @@ function wireWindowControls(win, taskbarBtn = null) {
const delta = current - lastTap; const delta = current - lastTap;
if (delta < 300 && delta > 0) { if (delta < 300 && delta > 0) {
// Double tap → maximize / restore // Double tap → maximize / restore
titlebar.querySelector('.maximize').innerHTML = win.dataset.state === 'maximized' ? '🗗' : '▢'; titlebar.querySelector('.maximize').innerHTML = win.dataset.state === 'maximized' ? restoreIcon : maximizeIcon;
toggleMaximize(); toggleMaximize();
} }
lastTap = current; lastTap = current;
@@ -913,7 +915,7 @@ function makeDraggableWithSnap(win) {
win.style.height = height + 'px'; win.style.height = height + 'px';
win.classList.remove('max'); win.classList.remove('max');
win.querySelector('.maximize').innerHTML = '▢'; win.querySelector('.maximize').innerHTML = maximizeIcon;
win.dataset.state = 'normal'; win.dataset.state = 'normal';
win.dataset.snapped = ''; win.dataset.snapped = '';
@@ -930,15 +932,14 @@ function bringToFront(win) {
if(tb) { if(tb) {
tb.classList.add('focus'); tb.classList.add('focus');
resetFocus(win.dataset.winid); resetFocus(win.dataset.winid);
saveOpenWindows();
saveOpenWindows(); // <-- HIER
} }
const currentZ = parseInt(win.style.zIndex || 0); const currentZ = parseInt(win.style.zIndex || 0);
// Nur nach vorne holen, wenn nicht bereits ganz oben
if (currentZ < topZ) { if (currentZ < topZ) {
topZ += 1; topZ += 1;
win.style.zIndex = topZ; win.style.zIndex = topZ;
} }
saveOpenWindows();
} }
function resetFocus(exceptID) { function resetFocus(exceptID) {
@@ -975,6 +976,7 @@ function restoreWindow(win, payload, taskbarBtn = null) {
} }
} else { } else {
win.style.display = 'flex'; win.style.display = 'flex';
win.querySelector('.maximize').innerHTML = win.dataset.state === 'maximized' ? restoreIcon : maximizeIcon;
} }
if (state === 'maximized') { if (state === 'maximized') {

View File

@@ -8,7 +8,7 @@ body, html { margin:0; padding:0; height:100%; overflow: hidden; font-family: va
.window-titlebar .title { display: flex; align-items: center; min-width: 0; flex: 1; overflow: hidden; } .window-titlebar .title { display: flex; align-items: center; min-width: 0; flex: 1; overflow: hidden; }
.window-titlebar .window-title { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-left:8px; } .window-titlebar .window-title { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-left:8px; }
.window-icon { height: 10px; background-size:contain; transform: translate(1px, -1px); background-repeat: no-repeat; background-position: left; background-color: rgb(144, 179, 144); padding:4px;border-radius: 8px;} .window-icon { height: 12px; background-size:contain; transform: translate(1px, -1px); background-repeat: no-repeat; background-position: left; background-color: rgb(144, 179, 144); padding:4px;border-radius: 6px;}
.window .controls { display: flex; flex-shrink: 0;} .window .controls { display: flex; flex-shrink: 0;}
.window .controls button { transition: background-color .3s, color .3s; padding: 2px 10px; border:none;} .window .controls button { transition: background-color .3s, color .3s; padding: 2px 10px; border:none;}
.window-content { display: flex; flex-direction: column; flex:1; padding:8px; overflow: auto; } .window-content { display: flex; flex-direction: column; flex:1; padding:8px; overflow: auto; }
@@ -24,10 +24,10 @@ body, html { margin:0; padding:0; height:100%; overflow: hidden; font-family: va
.window-resize-sw { bottom: -4px; left: -4px; width: 12px; height: 12px; cursor: sw-resize; } .window-resize-sw { bottom: -4px; left: -4px; width: 12px; height: 12px; cursor: sw-resize; }
#taskbar { z-index: 2; position: absolute; width:100%; bottom:0; left:0; height:42px; overflow:visible; display:flex; flex: 0 0 auto; min-width:0; align-items:center; padding:0 8px; box-sizing:border-box; } #taskbar { z-index: 2; position: absolute; width:100%; bottom:0; left:0; height:auto; overflow:visible; display:flex; flex: 0 0 auto; min-width:0; align-items:center; padding:0 8px; box-sizing:border-box; }
#start-btn { transition: background-color 0.3s ease; padding: 8px 15px; border-radius: 5px; border: none; margin-right:8px; } #start-btn { transition: background-color 0.3s ease; padding: 8px 12px; border-radius: 5px; border: none; margin-right:8px; }
#taskbar-windows { display:flex; gap:6px; align-items:center; flex:1; overflow-y:hidden;overflow-x: auto; min-width: 0; } #taskbar-windows { display:flex; gap:6px; align-items:center; flex:1; overflow-y:hidden;overflow-x: auto; min-width: 0;scrollbar-width: thin; }
.taskbar-item { display: flex; position: relative; padding:7px 10px; border-radius:4px; } .taskbar-item { display: flex; position: relative; padding:4px 10px; border-radius:4px; }
.taskbar-item::before { content: ''; position: absolute; bottom:1px; left:50%; width:40%; height: 4px; border-radius:4px; transform:translateX(-50%) scaleX(0); transform-origin:center; transition:transform 0.3s ease; } .taskbar-item::before { content: ''; position: absolute; bottom:1px; left:50%; width:40%; height: 4px; border-radius:4px; transform:translateX(-50%) scaleX(0); transform-origin:center; transition:transform 0.3s ease; }
.taskbar-item.focus::before { transform: translateX(-50%) scaleX(1); } .taskbar-item.focus::before { transform: translateX(-50%) scaleX(1); }
@@ -114,17 +114,18 @@ img.icon { width: auto; height:20px; object-fit: contain; filter: var(--theme-no
/* Taskbar größer für Touch */ /* Taskbar größer für Touch */
#taskbar { #taskbar {
height: 50px;
padding: 0 6px; padding: 0 6px;
overflow: hidden;
} }
#start-btn { #start-btn {
padding: 10px 14px; padding: 5px 14px;
font-size: 16px; font-size: 16px;
} }
.taskbar-item { .taskbar-item {
padding: 10px; padding: 5px 5px 0 0;
white-space:nowrap; text-overflow:ellipsis;
} }
.start-list { list-style: none; margin: 0; padding: 8px 0; height: 100%; overflow-y: auto; } .start-list { list-style: none; margin: 0; padding: 8px 0; height: 100%; overflow-y: auto; }

View File

@@ -7,7 +7,7 @@
{{#if this.printable}} {{#if this.printable}}
<button data-tooltip="Drucken" id="printbutton">🖨</button> <button data-tooltip="Drucken" id="printbutton">🖨</button>
{{/if}} {{/if}}
<button class="close"></button> <button class="close">X</button>
</div> </div>
</div> </div>
<div class="window-content"> <div class="window-content">

View File

@@ -8,9 +8,9 @@
{{#if tutorial}} {{#if tutorial}}
<button class="tutorial" id="tutorial-{{appname}}-{{label}}" onclick="tutorial.start()" data-tooltip="Startet eine interaktive Einführung">&#128161;</button> <button class="tutorial" id="tutorial-{{appname}}-{{label}}" onclick="tutorial.start()" data-tooltip="Startet eine interaktive Einführung">&#128161;</button>
{{/if}} {{/if}}
<button class="minimize">🗕</button> <button class="minimize"></button>
<button class="maximize">{{#equaler state "==" "maximized"}}🗗{{else}}{{/equaler}}</button> <button class="maximize">{{#equaler state "==" "maximized"}}🗗{{else}}{{/equaler}}</button>
<button class="close"></button> <button class="close">X</button>
</div> </div>
</div> </div>
<div class="window-content"> <div class="window-content">