| 2408 |
2408 |
|
/// drawn into, which leaves out the filter panel, the detail panel and every
|
| 2409 |
2409 |
|
/// floating window.
|
| 2410 |
2410 |
|
///
|
| 2411 |
|
- |
/// **What it cannot tell apart is a press on the toolbar from a press on a
|
| 2412 |
|
- |
/// row**, and what follows from that is the one behaviour that is not the
|
| 2413 |
|
- |
/// shipped list's: this drags *what is chosen* rather than the row under the
|
| 2414 |
|
- |
/// cursor, where the shipped list collapsed the selection onto that row first.
|
| 2415 |
|
- |
/// Pressing a chosen row and dragging is the ordinary case and is exact;
|
| 2416 |
|
- |
/// pressing an unchosen one drags the chosen set instead, which the drag image
|
| 2417 |
|
- |
/// and the status line both name. The per-row hover that said "Just dragged.
|
| 2418 |
|
- |
/// Ready again in a moment." is gone with the rows for the same reason. Closing
|
| 2419 |
|
- |
/// either wants the description to say where its rows are, which is a question
|
| 2420 |
|
- |
/// for the vocabulary rather than something to guess at here.
|
|
2411 |
+ |
/// - **A row under the press.** `quasi_immediate::row_at` answers which
|
|
2412 |
+ |
/// described row the renderer drew under a point, so a press on the toolbar,
|
|
2413 |
+ |
/// the column heads or the empty space below the last row no longer starts a
|
|
2414 |
+ |
/// drag. Added 2026-08-27 with quasi 0.69.2; the ruling on quasicoherent
|
|
2415 |
+ |
/// `600c9e42` is that a description hands back no geometry and the *renderer*
|
|
2416 |
+ |
/// does, because where a row landed is the renderer's answer and a different
|
|
2417 |
+ |
/// one per host.
|
|
2418 |
+ |
///
|
|
2419 |
+ |
/// **What is still not the shipped list's behaviour**: this drags *what is
|
|
2420 |
+ |
/// chosen* rather than the row under the cursor, where the shipped list
|
|
2421 |
+ |
/// collapsed the selection onto that row first. Pressing a chosen row and
|
|
2422 |
+ |
/// dragging is the ordinary case and is exact; pressing an unchosen one drags
|
|
2423 |
+ |
/// the chosen set instead, which the drag image and the status line both name.
|
|
2424 |
+ |
/// The rects make that closable now and the plumbing is this app's rather than
|
|
2425 |
+ |
/// the vocabulary's -- the file list's rows carry no `Cells::value`, so the row
|
|
2426 |
+ |
/// has to be matched back by index against the samples the description was
|
|
2427 |
+ |
/// built from. Filed rather than guessed at here.
|
| 2421 |
2428 |
|
fn dragging_out(ui: &egui::Ui, state: &mut BrowserState) -> bool {
|
| 2422 |
2429 |
|
let ctx = ui.ctx();
|
| 2423 |
2430 |
|
let (held, origin, latest) = ctx.input(|input| {
|
| 2445 |
2452 |
|
let (Some(origin), Some(latest)) = (origin, latest) else {
|
| 2446 |
2453 |
|
return false;
|
| 2447 |
2454 |
|
};
|
| 2448 |
|
- |
(latest - origin).length() > DRAG_THRESHOLD && ui.max_rect().contains(origin)
|
|
2455 |
+ |
if (latest - origin).length() <= DRAG_THRESHOLD || !ui.max_rect().contains(origin) {
|
|
2456 |
+ |
return false;
|
|
2457 |
+ |
}
|
|
2458 |
+ |
// The press has to have landed on a row. Read off the renderer, which drew
|
|
2459 |
+ |
// the table earlier this frame; the description says what is on the screen
|
|
2460 |
+ |
// and never where, so this is the one side that can answer.
|
|
2461 |
+ |
quasi_immediate::row_at(ui.ctx(), origin).is_some()
|
| 2449 |
2462 |
|
}
|
| 2450 |
2463 |
|
|
| 2451 |
2464 |
|
/// Whether the last OS drag is still holding this one off.
|