Desktop: Hook up native window controls (#3161)

* Implement window controls

* Fix drag target size

* Maximize with drag area double click
This commit is contained in:
Timon
2025-09-13 20:15:52 +00:00
committed by GitHub
parent e97d5520e8
commit 944a6eeea2
9 changed files with 29 additions and 4 deletions
@@ -43,6 +43,7 @@
on:dragover
on:dragstart
on:drop
on:mousedown
on:mouseup
on:pointerdown
on:pointerenter
@@ -67,7 +68,6 @@ on:keydown
on:keypress
on:keyup
on:lostpointercapture
on:mousedown
on:mouseenter
on:mouseleave
on:mousemove
@@ -76,13 +76,15 @@
<TextButton label={entry.label} icon={entry.icon} menuListChildren={entry.children} action={entry.action} flush={true} />
{/each}
{/if}
<LayoutRow on:mousedown={() => editor.handle.appWindowDrag()} on:dblclick={() => editor.handle.appWindowMaximize()} />
</LayoutRow>
<!-- Document title -->
<LayoutRow class="center">
<LayoutRow class="center" on:mousedown={() => editor.handle.appWindowDrag()} on:dblclick={() => editor.handle.appWindowMaximize()}>
<WindowTitle text={windowTitle} />
</LayoutRow>
<!-- Window buttons (except on Mac) -->
<LayoutRow class="right">
<LayoutRow on:mousedown={() => editor.handle.appWindowDrag()} on:dblclick={() => editor.handle.appWindowMaximize()} />
{#if platform === "Windows"}
<WindowButtonsWindows {maximized} />
{:else if platform === "Linux"}