Move push macro to seperate module

This commit is contained in:
Elias Projahn 2021-02-02 09:47:14 +01:00
parent 06d181447c
commit 59171e705b
4 changed files with 28 additions and 25 deletions

View file

@ -6,31 +6,6 @@ use gtk::prelude::*;
use std::cell::{Cell, RefCell};
use std::rc::{Rc, Weak};
/// Simplification for pushing new screens.
///
/// This macro can be invoked in two forms.
///
/// 1. To push screens without an input value:
///
/// ```
/// let result = push!(handle, ScreenType).await;
/// ```
///
/// 2. To push screens with an input value:
///
/// ```
/// let result = push!(handle, ScreenType, input).await;
/// ```
#[macro_export]
macro_rules! push {
($handle:expr, $screen:ty) => {
$handle.push::<_, _, $screen>(())
};
($handle:expr, $screen:ty, $input:ident) => {
$handle.push::<_, _, $screen>($input)
};
}
/// A widget that represents a logical unit of transient user interaction and
/// that optionally resolves to a specific return value.
pub trait Screen<I, O>: Widget {