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,
|
widget::scrollable,
|
||||||
window::{self, Event as WindowEvent, Id as WindowId},
|
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},
|
iced_widget::{button::focus, scrollable::AbsoluteOffset},
|
||||||
style, surface, theme,
|
style, surface, theme,
|
||||||
widget::{
|
widget::{
|
||||||
|
|
@ -1177,14 +1178,14 @@ impl App {
|
||||||
entity.id()
|
entity.id()
|
||||||
};
|
};
|
||||||
|
|
||||||
(
|
let mut tasks = Vec::with_capacity(4);
|
||||||
entity,
|
if activate {
|
||||||
Task::batch([
|
tasks.push(task::widget(unfocus()));
|
||||||
self.update_title(),
|
}
|
||||||
self.update_watcher(),
|
tasks.push(self.update_title());
|
||||||
self.update_tab(entity, location, selection_paths),
|
tasks.push(self.update_watcher());
|
||||||
]),
|
tasks.push(self.update_tab(entity, location, selection_paths));
|
||||||
)
|
(entity, Task::batch(tasks))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn open_tab(
|
fn open_tab(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue