Merge branch 'web' into merge-master-to-web

This commit is contained in:
Ryan Goldstein 2019-09-24 19:41:59 -04:00
commit 86bafdc104
10 changed files with 61 additions and 19 deletions

View file

@ -303,6 +303,10 @@ impl WindowBuilder {
/// Builds the window.
///
/// Possible causes of error include denied permission, incompatible system, and lack of memory.
///
/// Platform-specific behavior:
/// - **Web**: The window is created but not inserted into the web page automatically. Please
/// see the web platform module for more information.
#[inline]
pub fn build<T: 'static>(
self,
@ -321,6 +325,10 @@ impl Window {
///
/// Error should be very rare and only occur in case of permission denied, incompatible system,
/// out of memory, etc.
///
/// Platform-specific behavior:
/// - **Web**: The window is created but not inserted into the web page automatically. Please
/// see the web platform module for more information.
#[inline]
pub fn new<T: 'static>(event_loop: &EventLoopWindowTarget<T>) -> Result<Window, OsError> {
let builder = WindowBuilder::new();
@ -476,6 +484,7 @@ impl Window {
/// ## Platform-specific
///
/// - **iOS:** Has no effect.
/// - **Web:** Has no effect.
#[inline]
pub fn set_min_inner_size(&self, dimensions: Option<LogicalSize>) {
self.window.set_min_inner_size(dimensions)
@ -486,6 +495,7 @@ impl Window {
/// ## Platform-specific
///
/// - **iOS:** Has no effect.
/// - **Web:** Has no effect.
#[inline]
pub fn set_max_inner_size(&self, dimensions: Option<LogicalSize>) {
self.window.set_max_inner_size(dimensions)
@ -511,6 +521,7 @@ impl Window {
///
/// - **Android:** Has no effect.
/// - **iOS:** Can only be called on the main thread.
/// - **Web:** Has no effect.
#[inline]
pub fn set_visible(&self, visible: bool) {
self.window.set_visible(visible)
@ -530,6 +541,7 @@ impl Window {
/// ## Platform-specific
///
/// - **iOS:** Has no effect.
/// - **Web:** Has no effect.
#[inline]
pub fn set_resizable(&self, resizable: bool) {
self.window.set_resizable(resizable)
@ -540,6 +552,7 @@ impl Window {
/// ## Platform-specific
///
/// - **iOS:** Has no effect.
/// - **Web:** Has no effect.
#[inline]
pub fn set_maximized(&self, maximized: bool) {
self.window.set_maximized(maximized)
@ -585,8 +598,11 @@ impl Window {
/// Turn window decorations on or off.
///
/// ## Platform-specific
/// - **iOS:** Can only be called on the main thread. Controls whether the status bar is hidden
/// via [`setPrefersStatusBarHidden`].
/// - **Web:** Has no effect.
///
/// - **iOS:** Has no effect.
/// [`setPrefersStatusBarHidden`]: https://developer.apple.com/documentation/uikit/uiviewcontroller/1621440-prefersstatusbarhidden?language=objc
#[inline]
pub fn set_decorations(&self, decorations: bool) {
self.window.set_decorations(decorations)
@ -597,6 +613,7 @@ impl Window {
/// ## Platform-specific
///
/// - **iOS:** Has no effect.
/// - **Web:** Has no effect.
#[inline]
pub fn set_always_on_top(&self, always_on_top: bool) {
self.window.set_always_on_top(always_on_top)
@ -620,6 +637,7 @@ impl Window {
/// ## Platform-specific
///
/// **iOS:** Has no effect.
/// - **Web:** Has no effect.
#[inline]
pub fn set_ime_position(&self, position: LogicalPosition) {
self.window.set_ime_position(position)
@ -644,6 +662,7 @@ impl Window {
/// ## Platform-specific
///
/// - **iOS:** Always returns an `Err`.
/// - **Web:** Has no effect.
#[inline]
pub fn set_cursor_position(&self, position: LogicalPosition) -> Result<(), ExternalError> {
self.window.set_cursor_position(position)
@ -657,6 +676,7 @@ impl Window {
/// awkward.
/// - **Android:** Has no effect.
/// - **iOS:** Always returns an Err.
/// - **Web:** Has no effect.
#[inline]
pub fn set_cursor_grab(&self, grab: bool) -> Result<(), ExternalError> {
self.window.set_cursor_grab(grab)