widget:global_state: remove usage of navigate
* this needs to be adopted to use event handler code Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
@@ -61,14 +61,14 @@ pub trait GlobalState {
|
||||
Some(text)
|
||||
}
|
||||
|
||||
/// Navigates to the given entity.
|
||||
fn navigate(&self, to: Entity, ctx: &mut Context<'_>) {
|
||||
if let Some(old_focused_element) = *Window::focus_state_ref(&ctx.window()).focused_entity() {
|
||||
ctx.push_event_by_window(FocusEvent::RemoveFocus(old_focused_element));
|
||||
}
|
||||
ctx.widget().set("visibility", Visibility::Collapsed);
|
||||
ctx.get_widget(to).set("visibility", Visibility::Visible);
|
||||
}
|
||||
// /// Navigates to the given entity.
|
||||
// fn navigate(&self, to: Entity, ctx: &mut Context<'_>) {
|
||||
// if let Some(old_focused_element) = *Window::focus_state_ref(&ctx.window()).focused_entity() {
|
||||
// ctx.push_event_by_window(FocusEvent::RemoveFocus(old_focused_element));
|
||||
// }
|
||||
// ctx.widget().set("visibility", Visibility::Collapsed);
|
||||
// ctx.get_widget(to).set("visibility", Visibility::Visible);
|
||||
// }
|
||||
|
||||
/// Save the our data structure and convert it to `ron` file format.
|
||||
/// The cargo package identifier (here: 'nwx.advotracker') is taken to create the app directory.
|
||||
|
||||
@@ -181,7 +181,7 @@ impl PolicycheckState {
|
||||
/// Create new ticket
|
||||
pub fn new_ticket(&mut self, ctx: &mut Context<'_>) {
|
||||
println!("WIP: new ticket.");
|
||||
self.navigate(self.ticketdata, ctx);
|
||||
self(ticketdata_view.0);
|
||||
//ctx.widget().get_mut::<TicketdataView>(0).
|
||||
//ctx.get_widget(self.ticketdata_view);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user