fix(electrobun): 10px left padding on sidebar to avoid resize edge overlap
This commit is contained in:
parent
94a8e4072d
commit
561bca1133
2 changed files with 10 additions and 4 deletions
|
|
@ -95,12 +95,17 @@
|
|||
function onDragStart(e: MouseEvent) {
|
||||
const target = e.target as HTMLElement;
|
||||
if (target.tagName === 'BUTTON' || target.tagName === 'INPUT' || target.closest('button') || target.closest('.rz')) return;
|
||||
// Don't drag if click is within the resize border zone (8px from any edge)
|
||||
const B = 8;
|
||||
if (e.clientX < B || e.clientY < B || e.clientX > window.innerWidth - B || e.clientY > window.innerHeight - B) return;
|
||||
// Don't start drag if click is within resize border zone (10px from any window edge).
|
||||
// The native C resize handler (on the WebView) needs these clicks.
|
||||
// Also prevent drag near the sidebar's own edges to avoid overlap.
|
||||
const B = 10;
|
||||
const winW = window.innerWidth, winH = window.innerHeight;
|
||||
if (e.clientX < B || e.clientY < B || e.clientX > winW - B || e.clientY > winH - B) {
|
||||
return; // Let native resize handle this
|
||||
}
|
||||
// Delegate to GTK — the WM handles everything (smooth, zero CPU)
|
||||
appRpc.request['window.beginMove']({
|
||||
button: e.button + 1, // DOM: 0=left, GTK: 1=left
|
||||
button: e.button + 1,
|
||||
rootX: e.screenX,
|
||||
rootY: e.screenY,
|
||||
}).catch(() => {});
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ html, body {
|
|||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0.5rem 0;
|
||||
padding-left: 10px; /* Leave space for native resize edge (8px + margin) */
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue