Update tab location when drag and dropping, fixes #178

This commit is contained in:
Jeremy Soller 2024-05-28 09:28:46 -06:00
parent e3f0f5b776
commit e947bee833
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
2 changed files with 34 additions and 22 deletions

View file

@ -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) => {