update os logic

This commit is contained in:
2026-04-22 12:25:45 +02:00
parent c251b0b353
commit d73d5a3117
6 changed files with 82 additions and 26 deletions

View File

@@ -378,6 +378,7 @@ function applyMaximized(win) {
win.classList.add('max');
win.dataset.state = 'maximized';
}
@@ -600,16 +601,18 @@ function wireWindowControls(win, taskbarBtn = null) {
if (taskbarBtn !== null) {
titlebar.addEventListener('dblclick', (evt) => {
toggleMaximize();
titlebar.querySelector('.maximize').innerHTML = win.dataset.state === 'maximized' ? '🗗' : '▢';
saveOpenWindows()
});
}
titlebar.addEventListener('touchend', (ev) => {
const current = Date.now();
const delta = current - lastTap;
if (delta < 300 && delta > 0) {
// Double tap → maximize / restore
titlebar.querySelector('.maximize').innerHTML = win.dataset.state === 'maximized' ? '🗗' : '▢';
toggleMaximize();
}
lastTap = current;
@@ -668,7 +671,7 @@ function destroyWindow(win) {
// 🔥 VOR dem Maximieren speichern
storeNormalGeometry(win);
applyMaximized(win);
applyMaximized(win);
} else {
const prev = JSON.parse(win.dataset.normalGeometry || '{}');
@@ -838,6 +841,7 @@ function makeDraggableWithSnap(win) {
} else if (ev.clientY <= snapThreshold) {
// Snap top (maximize)
applySnap(win, 'top');
win.querySelector('.maximize').innerHTML = '🗗';
snapped = 'top';
} else if (snapped && ev.clientX > snapThreshold * 2 && ev.clientX < screenW - snapThreshold * 2) {
// Wegziehen vom Rand → Restore
@@ -865,6 +869,7 @@ function makeDraggableWithSnap(win) {
}
win.classList.add('max');
if (side === 'left') {
win.style.left = '0';
@@ -908,6 +913,8 @@ function makeDraggableWithSnap(win) {
win.style.height = height + 'px';
win.classList.remove('max');
win.querySelector('.maximize').innerHTML = '▢';
win.dataset.state = 'normal';
win.dataset.snapped = '';
}