feat(reader): relocate back-to-location, add recenter control, wrap bottom bar on small windows
- Back-to-location moves from the topbar (where it sat between Back and the title, too subtle and disconnected from navigation) into both bottom-bar rows, beside the page-back arrow — the natural 'go back' cluster. New icon: a location pin, clearly distinct from the back arrow and page controls. Appears only when the stack has a return target; Alt+← unchanged. - New recenter button in the fixed-layout row (crosshair icon, next to zoom): resets pan offsets while keeping the current zoom — backed by foliate's new recenter() (1c812e8), which zeroes the wrapper translate and re-syncs the spread side. - Both bottom-bar rows wrap gracefully on narrow windows instead of overflowing/h-scrolling: controls are grouped (paging+back | slider | fit+zoom+magnifier+recenter | pointer mode | spread | progress+TOC) so groups flow to a second line at small widths; the slider shrinks first (grow + min-width), everything else stays whole. Fixed-layout row drops its overflow-x-auto.
This commit is contained in:
@@ -1417,6 +1417,12 @@ document.addEventListener("alpine:init", () => {
|
||||
this.interactionMode = mode;
|
||||
saveSettings({ pdf_interaction_mode: mode });
|
||||
},
|
||||
// Reset pan offsets while keeping the current zoom level.
|
||||
recenterView() {
|
||||
if (!this.isFixedLayout || !this.renderer) return;
|
||||
this.renderer.recenter?.();
|
||||
this.renderer.dragOffset = { x: 0, y: 0 };
|
||||
},
|
||||
applyFitMode(mode: string) {
|
||||
if (!this.isFixedLayout || !this.renderer) return;
|
||||
if (mode === "fit-width" || mode === "fit-page") {
|
||||
|
||||
Reference in New Issue
Block a user