Alt+Tab window switcher (MRU), snap/maximize, panel separators
- window_switcher action: overlay listing windows in most-recently-used order; Tab/arrows cycle, Enter confirms, Esc cancels. Bound to alt+tab with alt+w as fallback for terminals that swallow alt+tab - snap_left/snap_right actions (alt+left/alt+right) tile the focused window to half the content area; dragging a window to the screen edge snaps it too - maximize action (alt+up) toggles maximize/restore, double-click on the title bar does the same; restore returns the pre-snap geometry - Panel: separator between focus dot and buttons, separators between right-docked status widgets, and item widths now use display width (fixes rects for åäö/wide labels) - Integration suite: 23 checks, all passing Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -274,6 +274,38 @@ def main():
|
||||
if top_win:
|
||||
app.send({"type": "close_window", "window_id": top_win["id"]})
|
||||
|
||||
# ── 4e. Alt+Tab-växlare + snap/maximera ──────────────────────────
|
||||
# Två fönster finns (mouse-test + top stängdes; spawna ett till)
|
||||
app.send({"type": "spawn_window", "command": "exec cat",
|
||||
"request_id": "w-sw"})
|
||||
sw_open = app.recv_until("window_opened")
|
||||
disp.send(key_event(code="Tab", modifiers="ALT"))
|
||||
text = disp.frame_text(timeout=5.0, contains="Fönster")
|
||||
check("alt+tab öppnar fönsterväxlaren", "Fönster" in text)
|
||||
disp.send(key_event(code="Esc"))
|
||||
time.sleep(0.2)
|
||||
|
||||
# Snap vänster: fokuserat fönster ska bli halva bredden
|
||||
disp.send(key_event(code="Left", modifiers="ALT"))
|
||||
time.sleep(0.3)
|
||||
app.send({"type": "list_windows", "request_id": "lsnap"})
|
||||
wsn = app.recv_until("window_list")
|
||||
snapped = next(w for w in wsn["windows"] if w["id"] == sw_open["id"])
|
||||
# innehållsytan är 100 bred (minus panel högst upp) → halvan ~50
|
||||
check("alt+left fäster fönstret som halvskärm",
|
||||
45 <= snapped["width"] <= 55 and snapped["x"] <= 1,
|
||||
f"geometri: {snapped}")
|
||||
|
||||
# Maximera/återställ: alt+up två gånger ska ge tillbaka snappad storlek
|
||||
disp.send(key_event(code="Up", modifiers="ALT"))
|
||||
time.sleep(0.3)
|
||||
app.send({"type": "list_windows", "request_id": "lmax"})
|
||||
wmx = app.recv_until("window_list")
|
||||
maxed = next(w for w in wmx["windows"] if w["id"] == sw_open["id"])
|
||||
check("alt+up maximerar fönstret", maxed["width"] >= 95,
|
||||
f"geometri: {maxed}")
|
||||
app.send({"type": "close_window", "window_id": sw_open["id"]})
|
||||
|
||||
# ── 5. Popup + popup_result via Enter ───────────────────────────
|
||||
app.send({
|
||||
"type": "spawn_popup", "message": "Integrationstest?",
|
||||
|
||||
Reference in New Issue
Block a user