edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBef5832fTahinli3 months ago597 commits
| 1 | //! The window's fixed geometry: what every region is measured in. |
| 2 | |
| 3 | use crate::*; |
| 4 | |
| 5 | /// ...and the narrowest it is drawn: a library row whose length the engine has |
| 6 | /// not measured yet has a landing place but no width, and a head marker says |
| 7 | /// where it goes where a zero-width box would say nothing. |
| 8 | pub const GHOST_MIN: f32 = 2.; |
| 9 | |
| 10 | /// Fixed so the video region takes every pixel the window gains and the controls |
| 11 | /// never clip at 640x360. |
| 12 | pub const HEADER_H: f32 = 32.; |
| 13 | // 28 button row + 24 scrub strip + two 48 lanes + the timecode line + the gaps |
| 14 | // between them, with a few px of slack so a taller text line cannot push a lane |
| 15 | // off the bottom. The window measures itself from [`timeline_h`] now, so this |
| 16 | // figure is the guards' anchor for it and sits with them. |
| 17 | |
| 18 | pub const PANEL_H: f32 = 220.; |
| 19 | /// How many lane rows are drawn before the lane column starts scrolling: past |
| 20 | /// this the panel would be taller than the picture it belongs under, and a |
| 21 | /// timeline that pushes the video off the window is not a timeline. |
| 22 | pub const LANES_MAX: usize = 6; |
| 23 | pub const LANE_H: f32 = 48.; |
| 24 | /// A caption lane's own height, thinner than a media one: a subtitle box |
| 25 | /// carries a name, a rate badge and the cue band under it |
| 26 | /// ([`Player::lane_row`]) and none of a clip's waveform or its full-height |
| 27 | /// plate, so the strip that used to draw the whole row's worth of nothing is |
| 28 | /// the regression this constant undoes. |
| 29 | /// |
| 30 | /// Floored at [`HIT_MIN`] rather than the 20 px a first pass at "thin" landed |
| 31 | /// on: the header's show/hide eye is the row's one surviving click target |
| 32 | /// once the remove button moves off it onto the right button |
| 33 | /// ([`Player::lane_row`]), and that eye fills the row's full height -- so |
| 34 | /// anything under `HIT_MIN` here is a WCAG 2.5.8 target shrunk to chase a |
| 35 | /// pixel count, not a thinner lane. This is the whole gap between the two |
| 36 | /// harness variants the task asked for: 20 is not shippable at all, 24 is, |
| 37 | /// so 24 is the only variant landed. |
| 38 | pub const SUB_LANE_H: f32 = HIT_MIN; |
| 39 | /// The lane header column: wide enough for `V1`/`A1` and fixed, so both lanes |
| 40 | /// and the ruler above them start at the same pixel and are the same width -- |
| 41 | /// one x-to-time mapping for the whole timeline. `HEADER_GAP` is part of that |
| 42 | /// offset and is therefore shared by all three rows. |
| 43 | pub const HEADER_W: f32 = 40.; |
| 44 | pub const HEADER_GAP: f32 = 4.; |
| 45 | /// The label row inside a clip; a waveform paints under it, never through it. |
| 46 | pub const LABEL_H: f32 = 15.; |
| 47 | /// A clip narrower than this shows no name: two characters and an ellipsis say |
| 48 | /// nothing that the tint has not already said, and cost the picture a smear. |
| 49 | pub const LABEL_MIN_W: f32 = 36.; |
| 50 | /// Peak buckets per second of source. Fixed and modest on purpose: `peaks` |
| 51 | /// allocates one bucket per window, so a rate taken from anything the user can |
| 52 | /// influence is an allocation bomb -- and 40 is already finer than the pixels a |
| 53 | /// clip is ever given. |
| 54 | /// |
| 55 | /// corner-cut: "finer than the pixels" stops being true once the timeline is |
| 56 | /// zoomed -- past ~25 ms per bucket the envelope reads as steps rather than as |
| 57 | /// a shape. Ceiling: [`View::max_zoom`]'s 8 frames across the bed. The upgrade |
| 58 | /// is a second, finer pass over the visible span only, cached like `waves` is. |
| 59 | pub const WAVE_BPS: u32 = 40; |
| 60 | /// How many stand-ins may be in flight at once -- the engine's own number, not |
| 61 | /// a second one that happens to agree: the proxy cache sweeps with room left |
| 62 | /// for exactly this many encodes ([`engine::proxy::reserve`]), so a front-end |
| 63 | /// that started more would put the disk past the cap by whatever it added. |
| 64 | pub const PROXIES_AT_ONCE: usize = AT_ONCE; |
| 65 | /// Pixels per envelope column. Coarser than a pixel: the eye reads the shape, |
| 66 | /// and a path with a point per pixel is a path per repaint. |
| 67 | pub const WAVE_COL: f32 = 2.; |
| 68 | /// The most columns one envelope is ever built from. A waveform is drawn into |
| 69 | /// the slice of its box that is on the bed ([`visible_slice`]), and a bed is a |
| 70 | /// screen wide, so nothing on screen ever reaches this -- it is the backstop for |
| 71 | /// a box laid out wider than any screen, whose path would otherwise cost a point |
| 72 | /// per two pixels of a width nobody can see and stall the repaint that was |
| 73 | /// meant to draw the wave. |
| 74 | pub const WAVE_COLS_MAX: usize = 4096; |
| 75 | /// WCAG 2.5.8: nothing clickable is smaller than this. The scrub bar stays 6 px |
| 76 | /// to look at -- `RULER_HIT_H` is the strip that has to be hit. |
| 77 | pub const HIT_MIN: f32 = 24.; |
| 78 | /// The media library's column: a share of the window rather than a fixed width, |
| 79 | /// so it yields on a narrow one, and never more than a third of it -- the |
| 80 | /// picture is what this program is for and keeps the majority at every size. |
| 81 | /// The floor is what a file name and a timecode need to be readable at all. |
| 82 | pub const LIBRARY_FRAC: f32 = 0.2; |
| 83 | pub const LIBRARY_MIN_W: f32 = 120.; |
| 84 | pub const LIBRARY_MAX_W: f32 = 220.; |
| 85 | /// A library row: a name over its duration, two lines and a click target, so |
| 86 | /// `HIT_MIN` binds it like every other one. |
| 87 | pub const ROW_H: f32 = 32.; |
| 88 | /// The tint swatch down the left of a row: the same colour that source's clips |
| 89 | /// wear in the lanes, which is the whole of the panel<->timeline association. |
| 90 | pub const SWATCH_W: f32 = 4.; |
| 91 | /// How far the encode has come, drawn under the stop square on a library row. |
| 92 | /// Inside a `HIT_MIN` cell with a little air each side, so the bar never reaches |
| 93 | /// the edge of the target it belongs to. |
| 94 | pub const PROXY_BAR_W: f32 = HIT_MIN - 10.; |
| 95 | pub const CONTROL_H: f32 = 28.; |
| 96 | /// The volume slider beside its button: a hundred steps across it, so a pixel |
| 97 | /// is finer than a step and the drag reads as continuous. |
| 98 | pub const VOLUME_W: f32 = 110.; |
| 99 | pub const RULER_HIT_H: f32 = HIT_MIN; |
| 100 | /// Wide enough for `HH:MM:SS:FF / HH:MM:SS:FF`, and fixed so changing digits |
| 101 | /// cannot push the layout around. |
| 102 | pub const TIME_W: f32 = 200.; |
| 103 | /// The keybindings card: a row per action, a title and a status line, inside a |
| 104 | /// 360 px tall window. The rows are click targets, so `HIT_MIN` binds them too. |
| 105 | /// Wider than the export card, and for the same reason that one is wider than |
| 106 | /// this used to be: at 320 the longest labels ("Remove the last video track (it |
| 107 | /// must be empty)") ran straight over the stroke printed at the other end of |
| 108 | /// their row. Every label in the registry fits beside its stroke here, and the |
| 109 | /// one that cannot -- a row waiting for a key to be pressed -- truncates rather |
| 110 | /// than overprinting. Still inside the 640 px floor. |
| 111 | pub const KEYS_W: f32 = 480.; |
| 112 | pub const KEYS_ROW_H: f32 = HIT_MIN; |
| 113 | /// How much of the row list is on screen at once; past this it scrolls. What |
| 114 | /// keeps the card inside the smallest window no matter how many actions the |
| 115 | /// editor grows -- ten rows fit here, and the eleventh is a scroll away. |
| 116 | pub const KEYS_ROWS_H: f32 = 10. * KEYS_ROW_H; |
| 117 | /// The same for the export card, which carries two summary lines and a button |
| 118 | /// under its list and so has less room: a section header, six codecs, the |
| 119 | /// container, five qualities and the destination are more rows than a 360 px |
| 120 | /// window holds. Eight on screen, which is the whole format section and its |
| 121 | /// header -- what a user picks first is never behind a scroll. |
| 122 | pub const EXPORT_ROWS_H: f32 = 8. * KEYS_ROW_H; |
| 123 | /// The export card is wider than the keybindings one: its rows carry a key, a |
| 124 | /// name *and* what the choice means, and the two summary lines under them state |
| 125 | /// the whole file. At `KEYS_W` every one of those wrapped to two lines, which is |
| 126 | /// the card the user called unfriendly. Still inside the 640 px floor with the |
| 127 | /// scrim showing either side of it. |
| 128 | pub const EXPORT_W: f32 = 420.; |
| 129 | /// The column the key of a row is printed in, wide enough for `0–9`: every row |
| 130 | /// in the export card says what picks it, so the card is drivable by keyboard |
| 131 | /// without a legend to memorise. |
| 132 | pub const EXPORT_KEY_W: f32 = 26.; |
| 133 | /// Everything in the export card that is *not* the row list: the title, the |
| 134 | /// status line, the head and tail of the summary, the button, the gaps between |
| 135 | /// them and the padding around the lot. What the list may be is the window |
| 136 | /// minus this -- and never less than [`EXPORT_ROWS_H`], which is the number |
| 137 | /// that makes the card fit the 360 px floor. |
| 138 | pub const EXPORT_FIXED_H: f32 = 17. + 28. + 15. + 30. + CONTROL_H + 4. + 10. + 24.; |
| 139 | /// The menu a right-click on a clip opens: wide enough for the longest label |
| 140 | /// beside the stroke that does the same thing, with the click targets `HIT_MIN` |
| 141 | /// binds like every other list here. |
| 142 | pub const MENU_W: f32 = 260.; |
| 143 | pub const MENU_ROW_H: f32 = HIT_MIN; |
| 144 | pub const MENU_PAD: f32 = 6.; |
| 145 | |
| 146 | /// A cue's text, and the line it sits on. Fixed rather than a share of the |
| 147 | /// picture: the video region is 108 px tall at the 640x360 floor and a |
| 148 | /// proportional size there would be unreadable at exactly the size where it has |
| 149 | /// to be read. |
| 150 | pub const SUB_TEXT: f32 = 14.; |
| 151 | pub const SUB_LINE_H: f32 = 18.; |
| 152 | /// How far off the bottom of the picture the plate sits. |
| 153 | pub const SUB_BOTTOM: f32 = 8.; |
| 154 | /// The same, once the transient bars that hang off that bottom edge (import, |
| 155 | /// seek, notice) are `bars_h` tall: the cue steps up over them and comes back |
| 156 | /// down the frame they leave, which is what a player does with its OSD -- the |
| 157 | /// alternative, a notice drawn over the line being read, loses both of them. |
| 158 | /// |
| 159 | /// `bars_h` is *measured* ([`height_probe`]) and never counted: a notice wraps |
| 160 | /// to as many lines as the window is narrow, and any constant here would be |
| 161 | /// right at one width. Nothing hanging there means nothing to step over, so the |
| 162 | /// no-notice position is [`SUB_BOTTOM`] exactly, to the pixel. |
| 163 | pub |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | /// A mark narrower than this is still drawn this wide: a one-frame cue on a |
| 169 | /// zoomed-out bed is worth a fraction of a pixel, and a mark nobody can see says |
| 170 | /// the track is empty. The silence preview's marks are floored by it too -- they |
| 171 | /// are the same kind of thing, a picture of where something is and no target. |
| 172 | pub const SUB_CUE_MIN_W: f32 = 2.; |
| 173 | /// How much of the subtitle list in the library column is on screen at once, |
| 174 | /// past which it scrolls -- the media list above it is what keeps the height. |
| 175 | pub const SUB_ROWS_H: f32 = 3. * ROW_H; |
| 176 | /// The row naming the file a block of tracks came out of. Always drawn where |
| 177 | /// there is more than one file -- the list already scrolls past `SUB_ROWS_H`, |
| 178 | /// so a short window loses tracks under the fold rather than the name saying |
| 179 | /// whose they are. A click folds it, so it binds `HIT_MIN` like every other |
| 180 | /// target. |
| 181 | pub const SUB_HEAD_H: f32 = HIT_MIN; |
| 182 | /// How much of a subtitle row's width the file's name in front of the label may |
| 183 | /// take. Half: which file and which language are both worth reading, and a name |
| 184 | /// given the whole row is a row where the language is what gets truncated. |
| 185 | pub const SUB_STEM_SHARE: f32 = 0.5; |
| 186 | /// Roughly how wide one character of an 11 px list row is. Generous on purpose: |
| 187 | /// the element truncates for real, and a budget that overshoots would have the |
| 188 | /// element cut the tail off after [`clip_middle`] had already kept it. |
| 189 | pub const LIST_CHAR_W: f32 = 6.; |
| 190 | /// The fewest characters a clipped name is cut to, however narrow the column |
| 191 | /// gets: past this there is nothing on either side of the gap to read. |
| 192 | pub const LIST_CLIP_MIN: usize = 5; |
| 193 | /// How long the export card's Subtitles line may get before it counts tracks |
| 194 | /// instead of naming them ([`subtitle_plan`]). Three lines of that row's value |
| 195 | /// box, at [`LIST_CHAR_W`] to a character: [`EXPORT_W`] less the row's padding |
| 196 | /// and gap, its tick and [`EXPORT_KEY_W`] key column, and the word "Subtitles" |
| 197 | /// in front of the value. Not a track count -- what walks the Destination row |
| 198 | /// off the bottom of the card is the *wrapping*, and thirty-five one-word |
| 199 | /// labels wrap less than three long ones. |
| 200 | pub const SUB_PLAN_CHARS: usize = |
| 201 | |
| 202 | as usize; |
| 203 | |
| 204 | /// The one key name this file still spells out, and gpui's spelling of it: it |
| 205 | /// is the way out of a capture and out of the overlay, and both have to work |
| 206 | /// while the keymap itself is what is being changed -- so neither can go |
| 207 | /// through the keymap to find it. |
| 208 | pub const ESCAPE: &str = "escape"; |
| 209 | |
| 210 | /// How tall a column of `lanes` rows is, gaps included -- the panel's own gap |
| 211 | /// between them, since the rows sit in it. |
| 212 | pub |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | /// How tall one lane row is: [`LANE_H`] for a media track, [`SUB_LANE_H`] for |
| 220 | /// a caption one -- the one place that answer is decided, since |
| 221 | /// [`lanes_h_mixed`], [`lanes_shown_mixed`] and [`rows_below_mixed`] all walk |
| 222 | /// off it and a track drawn at one height and measured at another is a fold |
| 223 | /// line that lands on the wrong row. |
| 224 | pub |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | /// [`lanes_h`] for a real stack of lanes rather than a bare count: a project |
| 232 | /// with a caption track in it is shorter than that many `LANE_H` rows, and |
| 233 | /// the column, the fold and the affordance below it all have to agree on |
| 234 | /// exactly how much shorter, or "N more below" is answering a box nothing |
| 235 | /// draws at. |
| 236 | pub |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | /// [`lanes_shown`] for a real stack: the largest prefix of `kinds` whose |
| 244 | /// drawn height still fits `box_h`, on the same boundary [`lanes_shown`] |
| 245 | /// draws it at (`lanes_h(k) <= box_h`) -- so a uniform stack answers exactly |
| 246 | /// what [`lanes_shown`] already did, and a mixed one answers the row count |
| 247 | /// its own heights actually reach. |
| 248 | pub |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | /// [`rows_below`] for a real stack: `scrolled` read against each row's own |
| 257 | /// top rather than a uniform `LANE_H + 8` stride, so a column with a thin |
| 258 | /// caption track in it still says the true count once that track has |
| 259 | /// scrolled by. |
| 260 | pub |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | /// The same question for a column whose rows are not one height -- the |
| 284 | /// inspector's sections -- answered in pixels off what the scroll itself |
| 285 | /// reports: how far it may still be taken (`max_offset`) less how far it has |
| 286 | /// been (`offset`, which gpui keeps negative going down). |
| 287 | pub |
| 288 | |
| 289 | |
| 290 | |
| 291 | /// How tall the panel is with `lanes` tracks in it: [`PANEL_H`] is sized for the |
| 292 | /// two a project starts with, and every further one adds its own row -- up to |
| 293 | /// [`LANES_MAX`], past which the lane column scrolls instead and the panel stops |
| 294 | /// growing. Only the guards ask, so it sits with them. |
| 295 | |
| 296 | pub |
| 297 | |
| 298 | |
| 299 | |
| 300 | /// How tall the timeline region is: its own padding, the timecode line, the |
| 301 | /// ruler, the scrollbar strip under the lanes when there is one to draw, and |
| 302 | /// the gaps between them, plus a row per lane. Measured from its parts rather |
| 303 | /// than taken off `PANEL_H` -- the button row moved out of it |
| 304 | /// ([`Player::toolbar`]), and a height still carrying that row's pixels is a |
| 305 | /// height that cuts the last lane off the bottom of the window. |
| 306 | pub |
| 307 | |
| 308 | |
| 309 | |
| 310 | /// 8+8 padding, the timecode line, the 24 px ruler strip and the two 8 px gaps |
| 311 | /// between the three rows, with a couple of px of slack so a taller text line |
| 312 | /// cannot push a lane off the bottom. The scrollbar strip's row is *not* here: |
| 313 | /// the strip comes and goes with the zoom, so its pixels are carried by |
| 314 | /// [`timeline_fixed_h`] alone, where every derivation that must agree with |
| 315 | /// what is drawn reads them together. |
| 316 | pub const TIMELINE_FIXED_H: f32 = 16. + 18. + 8. + RULER_HIT_H + 8. + 4.; |
| 317 | |
| 318 | /// The panel's fixed furniture with its scrollbar strip while the timeline has |
| 319 | /// somewhere to scroll to. With nowhere to go the strip is not drawn -- a bar |
| 320 | /// for a view that cannot move is a bar teaching nothing -- and its row goes |
| 321 | /// with it, out of every budget at once: a height still carrying the row would |
| 322 | /// hand it to the lane column as a bonus at exactly the zoom where the hand is |
| 323 | /// least expecting the bed to move. |
| 324 | pub |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | /// The most of a short window the timeline may take, sized so the seam's own |
| 332 | /// floor still fits inside it ([`split_bounds`]): at the 640x360 floor that is |
| 333 | /// 171 px of the 360 -- the chrome with the scrollbar strip in it, one whole |
| 334 | /// lane, and the line saying the rest are below. Left smaller than the floor |
| 335 | /// the floor would win the clamp anyway and this number would say the panel |
| 336 | /// takes less of a short window than it does. The lanes scroll inside whatever |
| 337 | /// is left, which leaves the picture a region rather than a letterbox stripe. |
| 338 | pub const TIMELINE_SHARE: f32 = 171. / 360.; |
| 339 | |
| 340 | /// The edit toolbar directly above the timeline: one control's height in its |
| 341 | /// own padding, fixed so nothing in it can push the timeline down. |
| 342 | pub const TOOLBAR_H: f32 = CONTROL_H + 16.; |
| 343 | |
| 344 | /// The top bar: the project's name on the left, the two file actions on the |
| 345 | /// right. Fixed for the reason [`HEADER_H`] is. |
| 346 | pub const TOPBAR_H: f32 = 36.; |
| 347 | |
| 348 | /// The transport strip under the picture -- play, timecode, volume -- where a |
| 349 | /// player's own controls live in every consumer editor. |
| 350 | pub const TRANSPORT_H: f32 = CONTROL_H + 12.; |
| 351 | |
| 352 | /// One press of a zoom key, or one notch of ctrl+wheel. |
| 353 | pub const ZOOM_STEP: f32 = 1.25; |
| 354 | |
| 355 | /// How far one notch of a bare wheel slides the view along, as a share of what |
| 356 | /// is on the bed. A *share* rather than a number of pixels or of seconds: one |
| 357 | /// gesture then moves the same fraction of what is being looked at whether the |
| 358 | /// bed is showing five seconds or five hours, which is the only way a wheel is |
| 359 | /// usable at both ends of the zoom. |
| 360 | pub const SCROLL_NOTCH_SHARE: f32 = 0.1; |
| 361 | |
| 362 | /// How few frames the bed may be narrowed down to. Past this there is nothing |
| 363 | /// left to aim at -- a single frame across a whole window is a wall of colour, |
| 364 | /// not an edit surface. |
| 365 | pub const ZOOM_MIN_FRAMES: f64 = 8.; |
| 366 | |
| 367 | /// How thin a second of timeline may be drawn on a bed that is already showing |
| 368 | /// all of it: the far stop for a *short* project, which has no length of its own |
| 369 | /// worth widening to, so a five second import can still be zoomed out of. |
| 370 | pub const PPS_MIN: f64 = 1.; |
| 371 | |
| 372 | /// How much bed the far stop leaves past the last frame, as a multiple of the |
| 373 | /// timeline's own length -- so a timeline zoomed all the way out ends a sliver |
| 374 | /// short of the window's edge rather than glued to it. |
| 375 | pub const ZOOM_OUT_MARGIN: f64 = 1.05; |
| 376 | |
| 377 | /// How wide a second of timeline is drawn before anyone zooms: a five second |
| 378 | /// import is 200 px of a bed several times that, so a short clip reads as |
| 379 | /// short -- the thing a bed scaled to the content's own length cannot say. |
| 380 | /// [`View::fit`] is the one way back to "the whole timeline across the bed". |
| 381 | pub const PPS_DEFAULT: f64 = 40.; |
| 382 | |
| 383 | // -- the seams between the regions, and where a hand has dragged them --------- |
| 384 | |
| 385 | /// Which divider a hand has hold of. The three seams the main layout has -- |
| 386 | /// library|picture, picture|inspector and the timeline's top edge -- and so the |
| 387 | /// only three sizes in this window a person sets rather than is given. |
| 388 | |
| 389 | pub |
| 390 | |
| 391 | |
| 392 | |
| 393 | |
| 394 | |
| 395 | /// How wide a divider is drawn *and* hit. Wider than the 1 px stroke it stands |
| 396 | /// in for: a seam nobody can put a pointer on is a seam nobody can drag, which |
| 397 | /// is why every editor that ships this draws a strip rather than the hairline |
| 398 | /// it looks like. |
| 399 | pub const SPLIT_W: f32 = 6.; |
| 400 | |
| 401 | /// The most of the window one side column may be dragged to. A third each, so |
| 402 | /// the picture keeps the middle at every size -- the rule [`library_w`] and |
| 403 | /// [`inspector_w`] already lay an untouched window out by, kept once the hand |
| 404 | /// takes over. |
| 405 | pub const SIDE_MAX_FRAC: f32 = 1. / 3.; |
| 406 | |
| 407 | /// The most of the window the timeline may be dragged to. Past |
| 408 | /// [`TIMELINE_SHARE`], which is what it is *given*: a hand asking for a tall |
| 409 | /// timeline is asking on purpose, and the picture still keeps most of a third. |
| 410 | pub const TIMELINE_MAX_SHARE: f32 = 0.7; |
| 411 | |
| 412 | /// What a hand has done to the three seams: the size it dragged each panel to, |
| 413 | /// or `None` where nobody has touched one and the window's own share still |
| 414 | /// answers. Held in the model and not recomputed, so a size outlives the |
| 415 | /// release -- and read through [`split_size`], so it cannot outlive the window |
| 416 | /// it was set in. |
| 417 | |
| 418 | pub |
| 419 | |
| 420 | |
| 421 | |
| 422 | |
| 423 | |
| 424 | |
| 425 | |
| 426 | |
| 427 | |
| 428 | |
| 429 | |
| 430 | |
| 431 | |
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 | |
| 441 | |
| 442 | /// How small a panel may be dragged and how large: the floor is the size it |
| 443 | /// still shows something at, the ceiling is what its neighbour needs to stay a |
| 444 | /// region rather than a sliver. Neither end is passable -- a panel dragged to |
| 445 | /// nothing is a panel nobody can get back, and a picture squeezed out by two |
| 446 | /// side columns is the same loss on the other side of the window. |
| 447 | pub |
| 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 | |
| 480 | |
| 481 | |
| 482 | |
| 483 | |
| 484 | |
| 485 | |
| 486 | |
| 487 | pub |
| 488 | |
| 489 | |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | |
| 496 | |
| 497 | |
| 498 | |
| 499 | |
| 500 | |
| 501 | |
| 502 | |
| 503 | |
| 504 | |
| 505 | |
| 506 | |
| 507 | /// Where a divider drag puts the panel it belongs to: the pointer's position |
| 508 | /// turned into that panel's size. Half a strip is taken off each answer because |
| 509 | /// the strip is grabbed by its middle -- without it the panel jumps a strip's |
| 510 | /// width on the press and then trails the pointer for the rest of the gesture. |
| 511 | pub |
| 512 | |
| 513 | |
| 514 | |
| 515 | |
| 516 | |
| 517 | |
| 518 | |
| 519 | |
| 520 | |
| 521 | |
| 522 | |
| 523 | |
| 524 | |
| 525 | |
| 526 | |
| 527 | |
| 528 | |
| 529 | |
| 530 | |
| 531 | |
| 532 | |
| 533 | |
| 534 | |
| 535 | |
| 536 | |
| 537 | |
| 538 | |
| 539 | |
| 540 | |
| 541 | |
| 542 | |
| 543 | |
| 544 |