Add middle-click to open in new tab from nav bar

This commit is contained in:
Jason Rodney Hansen 2024-07-01 19:56:34 -06:00 committed by Jeremy Soller
parent 42db606097
commit e9031f299d
2 changed files with 23 additions and 17 deletions

View file

@ -916,6 +916,9 @@ impl Application for App {
})
.on_context(|entity| cosmic::app::Message::App(Message::NavBarContext(entity)))
.on_close(|entity| cosmic::app::Message::App(Message::NavBarClose(entity)))
.on_middle_press(|entity| {
cosmic::app::Message::App(Message::NavMenuAction(NavMenuAction::OpenInNewTab(entity)))
})
.context_menu(self.nav_context_menu(self.nav_bar_context_id))
.close_icon(
widget::icon::from_name("media-eject-symbolic")
@ -1984,6 +1987,9 @@ impl Application for App {
Some(Location::Path(ref path)) => {
return self.open_tab(Location::Path(path.clone()));
}
Some(Location::Trash) => {
return self.open_tab(Location::Trash);
}
_ => {}
}
}