Use native window controls
All checks were successful
Build Windows App / build-windows (push) Successful in 20m26s

This commit is contained in:
MrSphay
2026-05-01 17:45:16 +02:00
parent fab6888e80
commit 7f5ed594b7
6 changed files with 9 additions and 72 deletions

View File

@@ -4,8 +4,6 @@ import {
FileDown,
FileInput,
Languages,
Maximize2,
Minus,
Plus,
RefreshCcw,
Settings,
@@ -335,17 +333,6 @@ export default function App() {
<div className="titlebarMark">EH</div>
<span>EnvHelper</span>
</div>
<div className="windowControls">
<button onClick={() => window.envHelper?.minimizeWindow()} title="Minimize" type="button">
<Minus size={15} />
</button>
<button onClick={() => window.envHelper?.toggleMaximizeWindow()} title="Maximize" type="button">
<Maximize2 size={14} />
</button>
<button className="closeButton" onClick={() => window.envHelper?.closeWindow()} title="Close" type="button">
<X size={15} />
</button>
</div>
</section>
<header className="toolbar">

View File

@@ -155,6 +155,7 @@ textarea:focus {
display: flex;
justify-content: space-between;
overflow: hidden;
padding-right: 138px;
}
.titlebarBrand {
@@ -180,33 +181,6 @@ textarea:focus {
width: 24px;
}
.windowControls {
-webkit-app-region: no-drag;
align-items: stretch;
display: flex;
height: 100%;
}
.windowControls button {
background: transparent;
border-radius: 0;
color: var(--muted);
min-height: 0;
min-width: 44px;
padding: 0;
}
.windowControls button:hover {
background: var(--surface-subtle);
color: var(--text);
transform: none;
}
.windowControls .closeButton:hover {
background: #c93d32;
color: #fff;
}
.toolbar {
align-items: center;
background: var(--surface);

3
src/vite-env.d.ts vendored
View File

@@ -9,8 +9,5 @@ interface Window {
envHelper?: {
openFile: () => Promise<EnvHelperFileResult | null>;
saveFile: (content: string) => Promise<string | null>;
minimizeWindow: () => Promise<void>;
toggleMaximizeWindow: () => Promise<void>;
closeWindow: () => Promise<void>;
};
}