callbacks: global_state: compiler sanitization
* use unspecific lifetimes Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
@@ -16,7 +16,7 @@ use orbtk::prelude::*;
|
|||||||
/// Provides generic methods to handle states of datatypes (e.g. used in `PolicyList`).
|
/// Provides generic methods to handle states of datatypes (e.g. used in `PolicyList`).
|
||||||
pub trait GlobalState {
|
pub trait GlobalState {
|
||||||
/// Navigates to the given entity.
|
/// Navigates to the given entity.
|
||||||
fn navigate(&self, to: Entity, ctx: &mut Context) {
|
fn navigate(&self, to: Entity, ctx: &mut Context<'_>) {
|
||||||
if let Some(old_focused_element) = ctx.window().get::<Global>("global").focused_widget {
|
if let Some(old_focused_element) = ctx.window().get::<Global>("global").focused_widget {
|
||||||
let mut old_focused_element = ctx.get_widget(old_focused_element);
|
let mut old_focused_element = ctx.get_widget(old_focused_element);
|
||||||
old_focused_element.set("focused", false);
|
old_focused_element.set("focused", false);
|
||||||
@@ -28,7 +28,7 @@ pub trait GlobalState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Get the text of a widget.
|
/// Get the text of a widget.
|
||||||
fn get_text(&self, ctx: &mut Context, entity: Entity) -> Option<String> {
|
fn get_text(&self, ctx: &mut Context<'_>, entity: Entity) -> Option<String> {
|
||||||
let mut widget = ctx.get_widget(entity);
|
let mut widget = ctx.get_widget(entity);
|
||||||
|
|
||||||
let entry = widget.get_mut::<String>("text");
|
let entry = widget.get_mut::<String>("text");
|
||||||
|
|||||||
Reference in New Issue
Block a user