Improve consistency of runtime::window documentation

This commit is contained in:
Héctor Ramón Jiménez 2025-11-20 01:50:17 +01:00
parent d7d8b67cdc
commit 7052bf3781
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -16,7 +16,7 @@ use raw_window_handle::{HasDisplayHandle, HasWindowHandle};
/// An operation to be performed on some window. /// An operation to be performed on some window.
pub enum Action { pub enum Action {
/// Opens a new window with some [`Settings`]. /// Open a new window with some [`Settings`].
Open(Id, Settings, oneshot::Sender<Id>), Open(Id, Settings, oneshot::Sender<Id>),
/// Close the window and exits the application. /// Close the window and exits the application.
@ -151,7 +151,7 @@ pub enum Action {
/// Screenshot the viewport of the window. /// Screenshot the viewport of the window.
Screenshot(Id, oneshot::Sender<Screenshot>), Screenshot(Id, oneshot::Sender<Screenshot>),
/// Enables mouse passthrough for the given window. /// Enable mouse passthrough for the given window.
/// ///
/// This disables mouse events for the window and passes mouse events /// This disables mouse events for the window and passes mouse events
/// through to whatever window is underneath. /// through to whatever window is underneath.
@ -175,13 +175,13 @@ pub enum Action {
/// Set the window size increment. /// Set the window size increment.
SetResizeIncrements(Id, Option<Size>), SetResizeIncrements(Id, Option<Size>),
/// Get the size of the monitor on which the window currently resides in logical dimensions. /// Get the logical dimensions of the monitor containing the window with the given [`Id`].
GetMonitorSize(Id, oneshot::Sender<Option<Size>>), GetMonitorSize(Id, oneshot::Sender<Option<Size>>),
/// Redraws all the windows. /// Redraw all the windows.
RedrawAll, RedrawAll,
/// Recomputes the layouts of all the windows. /// Recompute the layouts of all the windows.
RelayoutAll, RelayoutAll,
} }
@ -495,7 +495,7 @@ pub fn disable_mouse_passthrough<Message>(id: Id) -> Task<Message> {
task::effect(crate::Action::Window(Action::DisableMousePassthrough(id))) task::effect(crate::Action::Window(Action::DisableMousePassthrough(id)))
} }
/// Get the size of the monitor on which the window currently resides in logical dimensions. /// Get the logical dimensions of the monitor containing the window with the given [`Id`].
pub fn monitor_size(id: Id) -> Task<Option<Size>> { pub fn monitor_size(id: Id) -> Task<Option<Size>> {
task::oneshot(move |channel| { task::oneshot(move |channel| {
crate::Action::Window(Action::GetMonitorSize(id, channel)) crate::Action::Window(Action::GetMonitorSize(id, channel))