wip: docs
This commit is contained in:
1 parent
9839f52355
commit
a42711a324
5 files changed
+43
-36
No files matched your search
@@ -22,9 +22,10 @@ impl<'a> DesktopConfig<'a> {
|
||||
/// Initializes a new `WindowBuilder` with default values.
|
||||
#[inline]
|
||||
pub fn new() -> Self {
|
||||
let mut window = WindowBuilder::new().with_title("Dioxus app");
|
||||
Self {
|
||||
event_handler: None,
|
||||
window: Default::default(),
|
||||
window,
|
||||
pre_rendered: None,
|
||||
manual_edits: None,
|
||||
}
|
||||
@@ -43,7 +44,7 @@ impl<'a> DesktopConfig<'a> {
|
||||
pub fn with_window(&mut self, f: impl FnOnce(WindowBuilder) -> WindowBuilder) -> &mut Self {
|
||||
// gots to do a swap because the window builder only takes itself as muy self
|
||||
// I wish more people knew about returning &mut Self
|
||||
let mut builder = WindowBuilder::default();
|
||||
let mut builder = WindowBuilder::default().with_title("Dioxus App");
|
||||
std::mem::swap(&mut self.window, &mut builder);
|
||||
builder = f(builder);
|
||||
std::mem::swap(&mut self.window, &mut builder);
|
||||
|
||||
@@ -130,6 +130,7 @@ pub fn run<T: 'static + Send + Sync>(
|
||||
|
||||
let window = WindowBuilder::new()
|
||||
.with_menu(menu_bar_menu)
|
||||
.with_title("Dioxus App")
|
||||
.build(event_loop)
|
||||
.unwrap();
|
||||
let window_id = window.id();
|
||||
|
||||
Reference in new issue
Block a user