edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiB978e685Tahinli3 months ago627 commits
| 1 | //! The small elements every region is built out of. |
| 2 | |
| 3 | use crate::*; |
| 4 | |
| 5 | /// One clip's audio, drawn as a filled min/max envelope inside whatever box it |
| 6 | /// is given. Peaks are the source's whole envelope; `from`/`to` are the source |
| 7 | /// seconds this clip plays, so a cut clip shows its own stretch of the file. |
| 8 | pub |
| 9 | |
| 10 | |
| 11 | |
| 12 | /// As [`waveform`], but in a caller-picked ink rather than the fixed |
| 13 | /// secondary foreground -- the darkroom bench's own audio clips draw their |
| 14 | /// envelope in the source's ink (DESIGN §5), which the legacy timeline never |
| 15 | /// needed a colour for. |
| 16 | pub |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | /// An audio clip's fade, drawn as a translucent wedge over its box: silent |
| 47 | /// (full shade) at the clip's own edge, clear by the fade's far side -- |
| 48 | /// [`is_in`] mirrors it for the tail's ramp-down. The same `canvas` + |
| 49 | /// `PathBuilder` idiom [`waveform`] draws its envelope with, filled with the |
| 50 | /// same wash the in/out range already paints the bed with |
| 51 | /// (`ACCENT_WASH`, timeline.rs), so a fade reads as one more overlay on this |
| 52 | /// bed rather than a shape borrowed from somewhere else. |
| 53 | pub |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | /// A video clip's dissolve into its neighbour, drawn as a small X astride the |
| 88 | /// join -- the box it is given is the last [`Clip::transition_out`] frames of |
| 89 | /// the clip's own width, so the mark sits right at the edge it dissolves |
| 90 | /// through. Two strokes rather than [`fade_wedge`]'s fill: a dissolve is not |
| 91 | /// a ramp to or from silence, it is two clips overlapping, and an X reads as |
| 92 | /// a splice the way a wedge reads as a fade. |
| 93 | pub |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | /// A toolbar button: its glyph, its name, and its key on hover. `id` only buys |
| 116 | /// `on_click` and the tooltip -- it is still not focusable, so the root's own |
| 117 | /// key listener keeps working after a press, and the click lands on mouse-up |
| 118 | /// inside the button (a press that slides off does nothing). |
| 119 | /// |
| 120 | /// A button that would do nothing says so: dimmed, no pointer, no listener. |
| 121 | pub |
| 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 | /// The monitoring level as something to drag: 4 px of bar to look at and the |
| 185 | /// whole control's height to hit (WCAG 2.5.8), the split the speed bar and the |
| 186 | /// colour sliders both make. Only the level -- mute is the button beside it, so |
| 187 | /// a muted slider still shows what unmuting comes back to, drawn dim. |
| 188 | /// |
| 189 | /// Dimmed and inert without a timeline, like every other control that would |
| 190 | /// have nothing to act on. |
| 191 | pub |
| 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 | /// The line between two groups of buttons. |
| 238 | /// What a group of buttons is *for*, printed in front of it. A toolbar of |
| 239 | /// twelve unlabelled boxes is a toolbar nobody reads twice; three named groups |
| 240 | /// are three things to skip. |
| 241 | pub |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 248 | |
| 249 | pub |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | /// Whether a card or a menu is drawn over the window, as the hover labels see |
| 259 | /// it: written once a frame by [`Player::render`], read by every [`Tip`] before |
| 260 | /// it paints. |
| 261 | /// |
| 262 | /// A tooltip already on screen when an overlay opens *stays* on screen in gpui: |
| 263 | /// occluding the surface under it does not take it back, because the check that |
| 264 | /// keeps it visible works off the element's absolute bounds and knows nothing |
| 265 | /// about what was painted over it (`div.rs::handle_tooltip_mouse_move`, its own |
| 266 | /// TODO). So the tip is what has to stand aside -- here, once, for every hover |
| 267 | /// label in this window, rather than at fifteen call sites of which the |
| 268 | /// sixteenth would be forgotten. |
| 269 | pub static OVERLAID: AtomicBool = new; |
| 270 | |
| 271 | /// A tooltip is a view in gpui and nothing smaller, so this is the smallest one |
| 272 | /// that carries a line of text. It paints outside the window's element tree and |
| 273 | /// therefore owns its colours. |
| 274 | pub SharedString); |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
| 300 | |
| 301 | |
| 302 | |
| 303 | |
| 304 | /// Scissors: two blades crossed. Drawn this way and not as a split clip because |
| 305 | /// two bars is what the transport wears when it is playing -- the one glyph a |
| 306 | /// cut must never be mistaken for. |
| 307 | pub |
| 308 | |
| 309 | |
| 310 | |
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | /// A lid over a bin. |
| 327 | pub |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | /// What a window with no file open is waiting for. Both ways in are already |
| 338 | /// built -- the whole window is the drop target and the Import chooser takes a |
| 339 | /// project as readily as media -- so this only has to say so. |
| 340 | pub |
| 341 | |
| 342 | |
| 343 | |
| 344 | |
| 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | |
| 351 | |
| 352 | |
| 353 | |
| 354 | |
| 355 | /// Two bars while playing, a triangle in every other state -- paused, nothing |
| 356 | /// open, and played out, where the button's next act is to start over rather |
| 357 | /// than to stop something. Drawn, so there is no icon font and no glyph |
| 358 | /// coverage to depend on. |
| 359 | pub |
| 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 | |
| 387 | |
| 388 | |
| 389 |