diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index 695993d77..bcda245a2 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -364,13 +364,17 @@ body.side-nav { --side-w: 212px; padding-left: var(--side-w); } @media (pointer: coarse) { .side-edge { right: -12px; width: 24px; } } .side-edge:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; } body.side-drag, body.side-drag * { cursor: col-resize !important; user-select: none; } -.side-top { flex: none; display: flex; align-items: center; height: 46px; padding: 0 18px; } +/* its top is the title bar's left end: the sidebar's button (app.js + layoutNav), then the magpie, at the header's own height and left padding, + so the button is in the one place whether the sidebar shows or not, as + Finder's and Notes' is (ztf4080 on X) */ +.side-top { flex: none; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 14px; } .side-top .brand { font-size: 13.5px; } +/* a sidebar too narrow for the name keeps the bird (app.js fitTop) */ +.side-top.tight .brand > span:not(.logo) { display: none; } /* the traffic lights are the sidebar's top left, as in a Mac app's sidebar; - the magpie beside them, level with them (see .top above) */ -body.window.mac .side-top { height: calc(50px / var(--zoom, 1)); padding: calc(2px / var(--zoom, 1)) 0 0 calc(90px / var(--zoom, 1)); } -/* Windows' title bar above already shows the icon and the name */ -body.window:not(.mac):not(.linux):not(.web) .side-top { height: 10px; } + the button and the magpie beside them, level with them (see .top above) */ +body.window.mac .side-top { height: calc(50px / var(--zoom, 1)); padding: calc(2px / var(--zoom, 1)) 0 0 calc(96px / var(--zoom, 1)); } .side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 10px; } .side-foot { flex: none; max-height: 55%; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 10px; border-top: .5px solid var(--line-2); } /* a short window's sidebar keeps no bar beside its pages: a thin one is laid diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index 8bc12eac1..073dabce9 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -23591,6 +23591,9 @@ matchMedia("(max-width: 760px), (pointer: coarse) and (max-width: 1024px)").addE // further still when they don't fit (the 560px window at 150%). function fitTop() { const top = $(".top"), nav = $("#nav"), brand = $(".brand"), actions = $(".actions"); + const st = $(".side-top"); + st.classList.remove("tight"); + st.classList.toggle("tight", st.scrollWidth > st.clientWidth); // a phone's browser: the tabs have a row of their own (app.css), at their size; // and beside the sidebar the header holds only where the reader is and the icons if (phoneWeb() || sideNav()) { top.classList.remove("tight", "cramped", "inrow", "crowded", "packed"); return; } @@ -23599,8 +23602,7 @@ function fitTop() { // the buttons sit against the padding; under a page zoom (the text size) // their edge can measure a hair past it, which isn't running off (#457) if (a.right > top.getBoundingClientRect().right - parseFloat(getComputedStyle(top).paddingRight) + 0.5) return false; - // the sidebar's button, when shown, comes after the brand - const lead = $("#sideToggle")?.offsetParent ? $("#sideToggle") : brand; + const lead = brand.offsetParent ? brand : $("#sideToggle"); const left = lead.offsetParent ? lead.getBoundingClientRect().right : top.getBoundingClientRect().left + parseFloat(getComputedStyle(top).paddingLeft); if (!nav?.offsetParent) return left + 8 <= a.left; @@ -23659,17 +23661,17 @@ function layoutNav() { return; } layoutNav.done = true; - const side = $("#side"), nav = $("#nav"), brand = $(".brand"), prefs = $("#prefs"); + const side = $("#side"), nav = $("#nav"), brand = $(".brand"), prefs = $("#prefs"), btn = $("#sideToggle"); document.body.classList.toggle("side-nav", on); side.hidden = !on; $("#crumb").hidden = !on; if (on) { - side.querySelector(".side-top").append(brand); + side.querySelector(".side-top").append(btn, brand); side.querySelector(".side-scroll").append(nav); side.querySelector(".side-foot").prepend(prefs); nav.querySelector(":scope > .thumb")?.remove(); } else { - $(".top").prepend(brand); + $(".top").prepend(btn, brand); $("#crumb").after(nav); $(".actions").insertBefore(prefs, $("#winclose")); } diff --git a/internal/gui/assets/index.html b/internal/gui/assets/index.html index f9e7bb0f6..46c26c1b1 100644 --- a/internal/gui/assets/index.html +++ b/internal/gui/assets/index.html @@ -51,16 +51,18 @@