edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! The overview strip and the scrollbar under the lanes (DESIGN §3 "Overview |
| 2 | //! strip", §5 layout, §7 zoom). The overview is the whole film in one 14px |
| 3 | //! band above the ruler: each video clip in its film ink across its span, |
| 4 | //! audio as thin translucent slivers along the bottom, the playhead as a |
| 5 | //! white tick, and the bench's window as a closed 1px box. It replaces the |
| 6 | //! contact strip that used to sit in the time band; the export range's two |
| 7 | //! mark grips moved onto it with the rest of the film minimap. |
| 8 | //! |
| 9 | //! The scrollbar is the same window as a thumb, so both strips share |
| 10 | //! [`window_frac`] and [`grab_for`], and both drag through the one |
| 11 | //! `Player::scroll_drag` gesture (`player/view.rs::pan_window_to`). |
| 12 | |
| 13 | use ; |
| 14 | use crate; |
| 15 | use cratehitmap; |
| 16 | use crate::*; |
| 17 | |
| 18 | /// The overview's own height (REDESIGN §3.6's 12px overview strip). |
| 19 | pub const OVERVIEW_H: f32 = crateOVERVIEW_H; |
| 20 | /// An audio clip's sliver: a thin band along the overview's bottom edge. |
| 21 | const SLIVER_H: f32 = 3.; |
| 22 | /// The window box never draws narrower than this, however far the view is |
| 23 | /// zoomed in: a box a pixel wide is a box no hand can find. |
| 24 | const WINDOW_MIN_W: f32 = 4.; |
| 25 | /// How far either side of a mark tick the hand still grabs it. |
| 26 | const MARK_GRAB: f32 = 6.; |
| 27 | |
| 28 | thread_local! |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | /// The strip rows the bench spends above its lane stack: the overview, the |
| 37 | /// ruler, the gaps between them and the lanes, and the scrollbar row with its |
| 38 | /// gap while there is a scrollbar to draw. A `const fn` so the bench floor |
| 39 | /// (`layout::BENCH_MIN_H`) can take the same numbers `render` does. |
| 40 | pub const |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | /// The bench's window on the whole film, as fractions of the film's length: |
| 52 | /// where it starts and how much of the film it shows. A film with no length |
| 53 | /// yet shows all of itself, so the box never vanishes into nothing. |
| 54 | pub |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | /// How far into a window a press grabbed it, in px. A press inside the |
| 64 | /// window keeps the point it landed on under the hand; a press outside it |
| 65 | /// names the window's centre, so the view jumps there and the drag carries |
| 66 | /// on from the middle. `track_w` is the bed's width in px, `window` the |
| 67 | /// fractions from [`window_frac`], `min_w` the drawn floor of the window. |
| 68 | pub |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | /// The overview strip: the film's clips, the playhead, the window box, and |
| 78 | /// the export range's two grips. Mounted above the ruler in the bench's own |
| 79 | /// column, so it shares the ruler's bed (`HEAD_W` in, the bed's width). |
| 80 | pub |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | /// The scrollbar under the lanes: the window as a thumb along a hairline |
| 277 | /// track, the same bed as the ruler above the lanes. Mounted only while the |
| 278 | /// film is longer than the window ([`render`](super::render) reserves the row |
| 279 | /// on the same test). A press on the thumb grabs it; a press on the track |
| 280 | /// centres the window there. Its hit band is the row plus [`SCROLL_HIT_UP`] |
| 281 | /// over the bottom of the lanes and [`SCROLL_HIT_DOWN`] of the bench's own |
| 282 | /// padding below it: 24px (WCAG 2.5.8) with no more than 8px taken from the |
| 283 | /// lanes. |
| 284 | pub |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
| 300 | |
| 301 | |
| 302 | |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | |
| 308 | |
| 309 | |
| 310 | |
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | |
| 338 | |
| 339 | |
| 340 | |
| 341 | |
| 342 | |
| 343 | |
| 344 | |
| 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | |
| 351 | |
| 352 | |
| 353 | /// One clip on the overview: its `(from, to)` fractions of the film and its ink. |
| 354 | type Span = ; |
| 355 | |
| 356 | /// The film's clips as `(from, to, ink)` fractions of the film, split into |
| 357 | /// video and audio. Each clip takes its source's tint, the same one the lane |
| 358 | /// dot and the bench's clip anatomy draw. A film with no length yields none. |
| 359 | |
| 360 | |
| 361 | |
| 362 | |
| 363 | |
| 364 | |
| 365 | |
| 366 | |
| 367 | |
| 368 | |
| 369 | |
| 370 | |
| 371 | |
| 372 | |
| 373 | |
| 374 | |
| 375 | |
| 376 | |
| 377 | |
| 378 | |
| 379 | |
| 380 | |
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | |
| 386 | /// One export-range mark, drawn on the overview at its own film position: an |
| 387 | /// `ink1` tick with a ±[`MARK_GRAB`] door around it that takes precedence |
| 388 | /// over the strip's own press (`stop_propagation` on its press). Dragging it |
| 389 | /// sets that mark; `i`, `o` and `^u` are unchanged. |
| 390 | |
| 391 | |
| 392 | |
| 393 | |
| 394 | |
| 395 | |
| 396 | |
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | |
| 402 | |
| 403 | |
| 404 | |
| 405 | |
| 406 | |
| 407 | |
| 408 | |
| 409 | |
| 410 | |
| 411 | |
| 412 | |
| 413 | |
| 414 | |
| 415 | |
| 416 | |
| 417 | |
| 418 | |
| 419 | |
| 420 | |
| 421 | |
| 422 | |
| 423 | |
| 424 | |
| 425 | |
| 426 | |
| 427 | |
| 428 | |
| 429 | |
| 430 | |
| 431 | |
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 | |
| 441 | |
| 442 | |
| 443 | |
| 444 | |
| 445 | |
| 446 | |
| 447 | |
| 448 | |
| 449 | |
| 450 | |
| 451 | |
| 452 | |
| 453 | |
| 454 | |
| 455 | |
| 456 | |
| 457 | |
| 458 | |
| 459 | |
| 460 | |
| 461 | |
| 462 | |
| 463 | |
| 464 | |
| 465 | |
| 466 | |
| 467 | |
| 468 | |
| 469 | |
| 470 | |
| 471 | |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 |