Web apps in the left panel were a fixed 380 px, too narrow for WhatsApp, and add-on panels a fixed 400. A grip on the panel's right edge now resizes it, each app keeps its own width (settings.leftPanelWidths), a double-click resets it, and the page always keeps at least 320 px. The grip is a small view of Theseus's own laid over the edge, since the panel may be a third-party page; while dragging it covers the window so the drag keeps its events. Like Opera's sidebar, the left panel now hides when a new tab is opened or the right sidebar opens. It is only hidden, so reopening lands where the user left off. Add-on panels on the left used to get the right sidebar's grip on their left edge, where dragging resized the right sidebar; that grip is hidden there and its drags are ignored.
12 lines
715 B
JavaScript
12 lines
715 B
JavaScript
// Resize grip for the left panel (quick-link web apps and add-on panels).
|
|
// The panel itself may be a third-party page (WhatsApp, Telegram…), so the
|
|
// grip is a separate view of Theseus's own laid over the panel's right edge.
|
|
// While dragging, main stretches this view over the whole window so every
|
|
// mousemove and the final mouseup land here, wherever the pointer goes.
|
|
const { contextBridge, ipcRenderer } = require("electron");
|
|
contextBridge.exposeInMainWorld("grip", {
|
|
start: () => ipcRenderer.invoke("panel-grip-start"),
|
|
move: (windowX) => ipcRenderer.invoke("panel-grip-move", windowX),
|
|
end: () => ipcRenderer.invoke("panel-grip-end"),
|
|
reset: () => ipcRenderer.invoke("panel-grip-reset"),
|
|
});
|