From 5b5ebc25d80d665bfb755da39fd0ce002a4ac9f9 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Wed, 12 Jul 2023 17:11:17 +0200 Subject: [PATCH] Improve documentation of `WindowBuilderExtWebSys` methods (#2952) --- src/platform/web.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/platform/web.rs b/src/platform/web.rs index d1dd7967..0c9ad264 100644 --- a/src/platform/web.rs +++ b/src/platform/web.rs @@ -41,6 +41,12 @@ pub trait WindowExtWebSys { } pub trait WindowBuilderExtWebSys { + /// Pass an [`HtmlCanvasElement`] to be used for this [`Window`](crate::window::Window). If + /// [`None`], [`WindowBuilder::build()`] will create one. + /// + /// In any case, the canvas won't be automatically inserted into the web page. + /// + /// [`None`] by default. fn with_canvas(self, canvas: Option) -> Self; /// Whether `event.preventDefault` should be automatically called to prevent event propagation @@ -51,10 +57,14 @@ pub trait WindowBuilderExtWebSys { /// /// Some events are impossible to prevent. E.g. Firefox allows to access the native browser /// context menu with Shift+Rightclick. + /// + /// Enabled by default. fn with_prevent_default(self, prevent_default: bool) -> Self; /// Whether the canvas should be focusable using the tab key. This is necessary to capture /// canvas keyboard events. + /// + /// Enabled by default. fn with_focusable(self, focusable: bool) -> Self; }