mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 03:17:43 +00:00
ui-contract: a foreign drag moving to another row restarts the rest wait
The wait timed whether any row was under the pointer, so half a delay on one tab and half on the next selected the second.
This commit is contained in:
@@ -240,6 +240,10 @@ impl<C: Collection> ItemsHooks<'_, '_, C> {
|
||||
.map(|(_, row)| row)
|
||||
.filter(|row| before.pointer != pos || before.row == Some(*row));
|
||||
*cx.core.memory.shown::<DragRest>(slot) = DragRest { pointer: pos, row: target };
|
||||
// Another row restarts the wait.
|
||||
if target != before.row {
|
||||
crate::contract::overlay::dwell(&ctx, &mut *cx.core.memory, id, "drag rest", false, crate::contract::tooltip::DELAY);
|
||||
}
|
||||
if crate::contract::overlay::dwell(&ctx, &mut *cx.core.memory, id, "drag rest", target.is_some(), crate::contract::tooltip::DELAY)
|
||||
&& let Some(row) = target
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user