Initialize Application::name in multi-window runtime
This commit is contained in:
parent
780af771fa
commit
4890d75012
4 changed files with 17 additions and 4 deletions
|
|
@ -84,6 +84,11 @@ where
|
|||
/// The data needed to initialize your [`Application`].
|
||||
type Flags;
|
||||
|
||||
/// Returns the unique name of the [`Application`].
|
||||
fn name() -> &'static str {
|
||||
std::any::type_name::<Self>()
|
||||
}
|
||||
|
||||
/// Initializes the [`Application`] with the flags provided to
|
||||
/// [`run`] as part of the [`Settings`].
|
||||
///
|
||||
|
|
@ -232,6 +237,10 @@ where
|
|||
(Instance(app), command)
|
||||
}
|
||||
|
||||
fn name() -> &'static str {
|
||||
A::name()
|
||||
}
|
||||
|
||||
fn title(&self, window: window::Id) -> String {
|
||||
self.0.title(window)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,9 +107,7 @@ where
|
|||
type Executor = executor::Default;
|
||||
|
||||
fn name() -> &'static str {
|
||||
let type_name = std::any::type_name::<State>();
|
||||
|
||||
type_name.split("::").next().unwrap_or(type_name)
|
||||
std::any::type_name::<State>()
|
||||
}
|
||||
|
||||
fn load(&self) -> Command<Self::Message> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue