Fix Window platform support documentation
This resolves various problems with the documentation about platform support on the Window struct. It also completely removes pointless runtime errors in favor of consistent no-ops on all platforms that do not support a certain features.
This commit is contained in:
parent
6919c2fb2d
commit
55dff53a98
6 changed files with 35 additions and 43 deletions
|
|
@ -419,7 +419,7 @@ impl Window {
|
|||
}
|
||||
|
||||
pub fn set_inner_size(&self, _size: Size) {
|
||||
panic!("Cannot set window size on Android");
|
||||
warn!("Cannot set window size on Android");
|
||||
}
|
||||
|
||||
pub fn outer_size(&self) -> PhysicalSize<u32> {
|
||||
|
|
@ -441,7 +441,7 @@ impl Window {
|
|||
pub fn set_maximized(&self, _maximized: bool) {}
|
||||
|
||||
pub fn set_fullscreen(&self, _monitor: Option<window::Fullscreen>) {
|
||||
panic!("Cannot set fullscreen on Android");
|
||||
warn!("Cannot set fullscreen on Android");
|
||||
}
|
||||
|
||||
pub fn fullscreen(&self) -> Option<window::Fullscreen> {
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ impl Inner {
|
|||
}
|
||||
|
||||
pub fn set_inner_size(&self, _size: Size) {
|
||||
unimplemented!("not clear what `Window::set_inner_size` means on iOS");
|
||||
warn!("not clear what `Window::set_inner_size` means on iOS");
|
||||
}
|
||||
|
||||
pub fn set_min_inner_size(&self, _dimensions: Option<Size>) {
|
||||
|
|
|
|||
|
|
@ -171,14 +171,12 @@ impl Window {
|
|||
|
||||
#[inline]
|
||||
pub fn set_cursor_position(&self, _position: Position) -> Result<(), ExternalError> {
|
||||
// Intentionally a no-op, as the web does not support setting cursor positions
|
||||
Ok(())
|
||||
Err(ExternalError::NotSupported(NotSupportedError::new()))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_cursor_grab(&self, _grab: bool) -> Result<(), ExternalError> {
|
||||
// Intentionally a no-op, as the web does not (properly) support grabbing the cursor
|
||||
Ok(())
|
||||
Err(ExternalError::NotSupported(NotSupportedError::new()))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
|
|
@ -609,7 +609,7 @@ impl Window {
|
|||
|
||||
#[inline]
|
||||
pub fn set_ime_position(&self, _position: Position) {
|
||||
unimplemented!();
|
||||
warn!("`Window::set_ime_position` is ignored on Windows")
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue