fix: reset focus when opening a new tab
This commit is contained in:
parent
d38d55525b
commit
9547da2b25
1 changed files with 10 additions and 9 deletions
19
src/app.rs
19
src/app.rs
|
|
@ -32,7 +32,8 @@ use cosmic::{
|
|||
widget::scrollable,
|
||||
window::{self, Event as WindowEvent, Id as WindowId},
|
||||
},
|
||||
iced_runtime::clipboard,
|
||||
iced_core::widget::operation::focusable::unfocus,
|
||||
iced_runtime::{clipboard, task},
|
||||
iced_widget::{button::focus, scrollable::AbsoluteOffset},
|
||||
style, surface, theme,
|
||||
widget::{
|
||||
|
|
@ -1177,14 +1178,14 @@ impl App {
|
|||
entity.id()
|
||||
};
|
||||
|
||||
(
|
||||
entity,
|
||||
Task::batch([
|
||||
self.update_title(),
|
||||
self.update_watcher(),
|
||||
self.update_tab(entity, location, selection_paths),
|
||||
]),
|
||||
)
|
||||
let mut tasks = Vec::with_capacity(4);
|
||||
if activate {
|
||||
tasks.push(task::widget(unfocus()));
|
||||
}
|
||||
tasks.push(self.update_title());
|
||||
tasks.push(self.update_watcher());
|
||||
tasks.push(self.update_tab(entity, location, selection_paths));
|
||||
(entity, Task::batch(tasks))
|
||||
}
|
||||
|
||||
fn open_tab(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue