improv: operation and select for directional navigation
This commit is contained in:
parent
d0f221c48b
commit
880f2c7565
7 changed files with 98 additions and 12 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use iced_core::window;
|
||||
|
||||
use crate::Selector;
|
||||
use crate::core::widget::operation::{
|
||||
Focusable, Outcome, Scrollable, TextInput,
|
||||
|
|
@ -100,6 +102,10 @@ where
|
|||
fn finish(&self) -> Self::Output {
|
||||
self.outputs.clone()
|
||||
}
|
||||
|
||||
fn set_window_id(&mut self, id: window::Id) {
|
||||
self.selector.set_window_id(id);
|
||||
}
|
||||
}
|
||||
|
||||
pub trait Strategy {
|
||||
|
|
@ -110,6 +116,8 @@ pub trait Strategy {
|
|||
fn is_done(&self) -> bool;
|
||||
|
||||
fn finish(&self) -> Self::Output;
|
||||
|
||||
fn set_window_id(&mut self, _id: window::Id) {}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -273,4 +281,8 @@ where
|
|||
fn finish(&self) -> Outcome<S::Output> {
|
||||
Outcome::Some(self.strategy.finish())
|
||||
}
|
||||
|
||||
fn set_window_id(&mut self, id: window::Id) {
|
||||
self.strategy.set_window_id(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue