diff --git a/src/musrview_web/musrview.html b/src/musrview_web/musrview.html index e59f80b6..38dd4262 100644 --- a/src/musrview_web/musrview.html +++ b/src/musrview_web/musrview.html @@ -30,24 +30,40 @@ } /* ---- overall layout ------------------------------------------------ */ + /* row/column sizes are the defaults for the very first paint; from then + on updateLayout() (below, in the script) drives them via inline + styles, so that the side column width and the run-info height can be + dragged by the user and the title/params/theory/info rows/columns + collapse to 0 when their panel is hidden. */ #app { display: grid; - grid-template-rows: auto auto 1fr auto auto; - grid-template-columns: 1fr 340px; + grid-template-rows: auto auto 1fr 6px auto auto; + grid-template-columns: 1fr 6px 340px; grid-template-areas: - "toolbar toolbar" - "title title" - "plot side" - "info info" - "status status"; + "toolbar toolbar toolbar" + "title title title" + "plot vsplit side" + "hsplit hsplit hsplit" + "info info info" + "status status status"; height: 100%; width: 100%; } - /* the side column disappears completely when both side panels are off */ - #app.no-side { grid-template-columns: 1fr 0px; } - #app.no-title { grid-template-rows: auto 0px 1fr auto auto; } - #app.no-info { grid-template-rows: auto auto 1fr 0px auto; } - #app.no-title.no-info { grid-template-rows: auto 0px 1fr 0px auto; } + + /* ---- drag handles --------------------------------------------------- + thin bars between the plot and the side column (width) and between + the plot row and the run-info panel (height); the params/theory + split handle lives inside #side below. */ + #vsplit, #hsplit, #side-split { + background: var(--border); + transition: background .15s; + touch-action: none; + } + #vsplit { grid-area: vsplit; cursor: col-resize; } + #hsplit { grid-area: hsplit; cursor: row-resize; } + #vsplit:hover, #vsplit.dragging, + #hsplit:hover, #hsplit.dragging, + #side-split:hover, #side-split.dragging { background: var(--accent); } /* ---- toolbar ------------------------------------------------------- */ #toolbar { @@ -112,10 +128,11 @@ #side { grid-area: side; - display: flex; - flex-direction: column; + display: grid; + grid-template-rows: 1fr 6px 1fr; border-left: 1px solid var(--border); min-height: 0; + min-width: 0; overflow: hidden; } @@ -123,10 +140,9 @@ display: flex; flex-direction: column; min-height: 0; - flex: 1 1 50%; - border-bottom: 1px solid var(--border); + min-width: 0; + overflow: hidden; } - .panel:last-child { border-bottom: none; } .panel > h2 { margin: 0; padding: 4px 8px; @@ -179,11 +195,11 @@ grid-area: info; display: flex; flex-direction: column; - max-height: 28vh; + min-height: 0; border-top: 1px solid var(--border); overflow: hidden; } - #infopanel > #info { max-height: 22vh; } + #infopanel > #info { flex: 1 1 auto; min-height: 0; } #statusbar { grid-area: status; @@ -279,17 +295,22 @@
+ +