pub struct DevToolsPage { /* private fields */ }Expand description
Addition of the port (not in the original): a page that another crate adds to the developer tools, shown as a tab after the tabs of the original (the logical tree, the visual tree, the events and the hidden hot keys tab).
A page is a title and a factory of its view. The factory is called with
the view model of the developer tools window the first time the tab of
the page is selected in that window; the view is kept for the lifetime of
the window. MainViewModel::root is the object the window inspects.
let registration = MainViewModel::register_page(DevToolsPage::new("Components", |main| {
ComponentsPageView::new(main.root()).upcast()
}));
// ...
registration.dispose(); // removes the page from the windows opened afterwardsPages are registered per thread (the UI thread), as everything the developer tools show. A registration applies to the developer tools windows opened after it.
Implementations§
Source§impl DevToolsPage
impl DevToolsPage
Sourcepub fn new(
title: impl Into<String>,
create_view: impl Fn(&Rc<MainViewModel>) -> Ref<Control> + 'static,
) -> Self
pub fn new( title: impl Into<String>, create_view: impl Fn(&Rc<MainViewModel>) -> Ref<Control> + 'static, ) -> Self
A page with the title of its tab and the factory of its view.
Sourcepub fn create_view(&self, main_view_model: &Rc<MainViewModel>) -> Ref<Control>
pub fn create_view(&self, main_view_model: &Rc<MainViewModel>) -> Ref<Control>
Creates the view of the page for the view model of a developer tools window.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DevToolsPage
impl !Send for DevToolsPage
impl !Sync for DevToolsPage
impl !UnwindSafe for DevToolsPage
impl Freeze for DevToolsPage
impl Unpin for DevToolsPage
impl UnsafeUnpin for DevToolsPage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more