Update tab location when drag and dropping, fixes #178
This commit is contained in:
parent
e3f0f5b776
commit
e947bee833
2 changed files with 34 additions and 22 deletions
22
src/app.rs
22
src/app.rs
|
|
@ -1630,13 +1630,21 @@ impl Application for App {
|
|||
{
|
||||
self.nav_dnd_hover = None;
|
||||
let entity = self.tab_model.active();
|
||||
let title = location.to_string();
|
||||
self.tab_model.text_set(entity, title);
|
||||
return Command::batch([
|
||||
self.update_title(),
|
||||
self.update_watcher(),
|
||||
self.rescan_tab(entity, location),
|
||||
]);
|
||||
let title_opt = match self.tab_model.data_mut::<Tab>(entity) {
|
||||
Some(tab) => {
|
||||
tab.change_location(&location, None);
|
||||
Some(tab.title())
|
||||
}
|
||||
None => None,
|
||||
};
|
||||
if let Some(title) = title_opt {
|
||||
self.tab_model.text_set(entity, title);
|
||||
return Command::batch([
|
||||
self.update_title(),
|
||||
self.update_watcher(),
|
||||
self.rescan_tab(entity, location),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Message::DndEnterTab(entity) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue