fix dragging items into service
This commit is contained in:
parent
c141a50c3e
commit
df4ec1bd1b
1 changed files with 6 additions and 7 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -1644,7 +1644,6 @@ where
|
||||||
.on_double_press(Message::ChangeServiceItem(
|
.on_double_press(Message::ChangeServiceItem(
|
||||||
index,
|
index,
|
||||||
))
|
))
|
||||||
.on_drag(Message::None)
|
|
||||||
.on_right_press(Message::ContextMenuItem(index))
|
.on_right_press(Message::ContextMenuItem(index))
|
||||||
.on_release(Message::SelectServiceItem(index));
|
.on_release(Message::SelectServiceItem(index));
|
||||||
let single_item = if let Some(context_menu_item) =
|
let single_item = if let Some(context_menu_item) =
|
||||||
|
|
@ -1698,6 +1697,7 @@ where
|
||||||
Message::None
|
Message::None
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.forward_drag_as_cursor(true)
|
||||||
.on_finish(move |mime, data, action, x, y| {
|
.on_finish(move |mime, data, action, x, y| {
|
||||||
debug!(mime, ?data, ?action, x, y);
|
debug!(mime, ?data, ?action, x, y);
|
||||||
let Ok(item) =
|
let Ok(item) =
|
||||||
|
|
@ -1758,10 +1758,10 @@ where
|
||||||
]
|
]
|
||||||
.padding(10)
|
.padding(10)
|
||||||
.spacing(10);
|
.spacing(10);
|
||||||
let container = Container::new(stack![
|
let container = Container::new(
|
||||||
dnd_destination(
|
dnd_destination(
|
||||||
vertical_space().width(Length::Fill),
|
column,
|
||||||
vec!["application/service-item".into()]
|
vec!["application/service-item".into()],
|
||||||
)
|
)
|
||||||
.data_received_for::<ServiceItem>(|item| {
|
.data_received_for::<ServiceItem>(|item| {
|
||||||
item.map_or_else(
|
item.map_or_else(
|
||||||
|
|
@ -1779,10 +1779,9 @@ where
|
||||||
};
|
};
|
||||||
debug!(?item);
|
debug!(?item);
|
||||||
Message::AppendServiceItem(item)
|
Message::AppendServiceItem(item)
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
column
|
)
|
||||||
])
|
|
||||||
.style(nav_bar_style);
|
.style(nav_bar_style);
|
||||||
|
|
||||||
container.center(Length::FillPortion(2)).into()
|
container.center(Length::FillPortion(2)).into()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue