The scrollbar strip is panel furniture, not lane pixels
Browse files at this commit27b5f78ae6fba25f4aa627bf4554fc28aca0dc32Parent: 1027953- fix
- the scrollbar strip is panel furniture, not lane pixels
1 changed file +30 -9
- crates/app/src/layout.rs +30 -9
crates/app/src/layout.rsmodified+30 -9
| @@ -243,23 +243,44 @@ pub(crate) fn panel_h(lanes: usize) -> f32 { | |||
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | /// How tall the timeline region is: its own padding, the timecode line, the | 245 | /// How tall the timeline region is: its own padding, the timecode line, the |
| 246 | -/// ruler and the gaps between them, plus a row per lane. Measured from its | 246 | +/// ruler, the scrollbar strip under the lanes when there is one to draw, and |
| 247 | -/// parts rather than taken off `PANEL_H` -- the button row moved out of it | 247 | +/// the gaps between them, plus a row per lane. Measured from its parts rather |
| 248 | +/// than taken off `PANEL_H` -- the button row moved out of it | ||
| 248 | /// ([`Player::toolbar`]), and a height still carrying that row's pixels is a | 249 | /// ([`Player::toolbar`]), and a height still carrying that row's pixels is a |
| 249 | /// height that cuts the last lane off the bottom of the window. | 250 | /// height that cuts the last lane off the bottom of the window. |
| 250 | -pub(crate) fn timeline_h(lanes: usize) -> f32 { | 251 | +pub(crate) fn timeline_h(lanes: usize, scroll: bool) -> f32 { |
| 251 | - TIMELINE_FIXED_H + lanes_h(lanes.clamp(2, LANES_MAX)) | 252 | + timeline_fixed_h(scroll) + lanes_h(lanes.clamp(2, LANES_MAX)) |
| 252 | } | 253 | } |
| 253 | 254 | ||
| 254 | /// 8+8 padding, the timecode line, the 24 px ruler strip and the two 8 px gaps | 255 | /// 8+8 padding, the timecode line, the 24 px ruler strip and the two 8 px gaps |
| 255 | /// between the three rows, with a couple of px of slack so a taller text line | 256 | /// between the three rows, with a couple of px of slack so a taller text line |
| 256 | -/// cannot push a lane off the bottom. | 257 | +/// cannot push a lane off the bottom. The scrollbar strip's row is *not* here: |
| 258 | +/// the strip comes and goes with the zoom, so its pixels are carried by | ||
| 259 | +/// [`timeline_fixed_h`] alone, where every derivation that must agree with | ||
| 260 | +/// what is drawn reads them together. | ||
| 257 | pub(crate) const TIMELINE_FIXED_H: f32 = 16. + 18. + 8. + RULER_HIT_H + 8. + 4.; | 261 | pub(crate) const TIMELINE_FIXED_H: f32 = 16. + 18. + 8. + RULER_HIT_H + 8. + 4.; |
| 258 | 262 | ||
| 259 | -/// The most of a short window the timeline may take. At the 640x360 floor that | 263 | +/// The panel's fixed furniture with its scrollbar strip while the timeline has |
| 260 | -/// is 151 px of the 360, which leaves the picture a region rather than a | 264 | +/// somewhere to scroll to. With nowhere to go the strip is not drawn -- a bar |
| 261 | -/// letterbox stripe -- and the lanes scroll inside it. | 265 | +/// for a view that cannot move is a bar teaching nothing -- and its row goes |
| 262 | -pub(crate) const TIMELINE_SHARE: f32 = 0.42; | 266 | +/// with it, out of every budget at once: a height still carrying the row would |
| 267 | +/// hand it to the lane column as a bonus at exactly the zoom where the hand is | ||
| 268 | +/// least expecting the bed to move. | ||
| 269 | +pub(crate) fn timeline_fixed_h(scroll: bool) -> f32 { | ||
| 270 | + TIMELINE_FIXED_H + match scroll { | ||
| 271 | + true => 8. + SCROLL_HIT, | ||
| 272 | + false => 0., | ||
| 273 | + } | ||
| 274 | +} | ||
| 275 | + | ||
| 276 | +/// The most of a short window the timeline may take, sized so the seam's own | ||
| 277 | +/// floor still fits inside it ([`split_bounds`]): at the 640x360 floor that is | ||
| 278 | +/// 171 px of the 360 -- the chrome with the scrollbar strip in it, one whole | ||
| 279 | +/// lane, and the line saying the rest are below. Left smaller than the floor | ||
| 280 | +/// the floor would win the clamp anyway and this number would say the panel | ||
| 281 | +/// takes less of a short window than it does. The lanes scroll inside whatever | ||
| 282 | +/// is left, which leaves the picture a region rather than a letterbox stripe. | ||
| 283 | +pub(crate) const TIMELINE_SHARE: f32 = 171. / 360.; | ||
| 263 | 284 | ||
| 264 | /// The edit toolbar directly above the timeline: one control's height in its | 285 | /// The edit toolbar directly above the timeline: one control's height in its |
| 265 | /// own padding, fixed so nothing in it can push the timeline down. | 286 | /// own padding, fixed so nothing in it can push the timeline down. |