pub enum Action {
Show 28 variants
Open(Id, Settings, Sender<Id>),
Close(Id),
GetOldest(Sender<Option<Id>>),
GetLatest(Sender<Option<Id>>),
Drag(Id),
Resize(Id, Size),
GetSize(Id, Sender<Size>),
GetMaximized(Id, Sender<bool>),
Maximize(Id, bool),
GetMinimized(Id, Sender<Option<bool>>),
Minimize(Id, bool),
GetPosition(Id, Sender<Option<Point>>),
GetScaleFactor(Id, Sender<f32>),
Move(Id, Point),
ChangeMode(Id, Mode),
GetMode(Id, Sender<Mode>),
ToggleMaximize(Id),
ToggleDecorations(Id),
RequestUserAttention(Id, Option<UserAttention>),
GainFocus(Id),
ChangeLevel(Id, Level),
ShowSystemMenu(Id),
GetRawId(Id, Sender<u64>),
ChangeIcon(Id, Icon),
RunWithHandle(Id, Box<dyn FnOnce(WindowHandle<'_>) + Send>),
Screenshot(Id, Sender<Screenshot>),
EnableMousePassthrough(Id),
DisableMousePassthrough(Id),
}
Expand description
An operation to be performed on some window.
Variants§
Open(Id, Settings, Sender<Id>)
Opens a new window with some [Settings
].
Close(Id)
Close the window and exits the application.
GetOldest(Sender<Option<Id>>)
Gets the [Id
] of the oldest window.
GetLatest(Sender<Option<Id>>)
Gets the [Id
] of the latest window.
Drag(Id)
Move the window with the left mouse button until the button is released.
There’s no guarantee that this will work unless the left mouse button was pressed immediately before this function is called.
Resize(Id, Size)
Resize the window to the given logical dimensions.
GetSize(Id, Sender<Size>)
Get the current logical dimensions of the window.
GetMaximized(Id, Sender<bool>)
Get if the current window is maximized or not.
Maximize(Id, bool)
Set the window to maximized or back
GetMinimized(Id, Sender<Option<bool>>)
Minimize(Id, bool)
Set the window to minimized or back
GetPosition(Id, Sender<Option<Point>>)
Get the current logical coordinates of the window.
GetScaleFactor(Id, Sender<f32>)
Get the current scale factor (DPI) of the window.
Move(Id, Point)
Move the window to the given logical coordinates.
Unsupported on Wayland.
ChangeMode(Id, Mode)
Change the [Mode
] of the window.
GetMode(Id, Sender<Mode>)
Get the current [Mode
] of the window.
ToggleMaximize(Id)
Toggle the window to maximized or back
ToggleDecorations(Id)
RequestUserAttention(Id, Option<UserAttention>)
Request user attention to the window, this has no effect if the application
is already focused. How requesting for user attention manifests is platform dependent,
see [UserAttention
] for details.
Providing None
will unset the request for user attention. Unsetting the request for
user attention might not be done automatically by the WM when the window receives input.
§Platform-specific
- iOS / Android / Web: Unsupported.
- macOS:
None
has no effect. - X11: Requests for user attention must be manually cleared.
- Wayland: Requires
xdg_activation_v1
protocol,None
has no effect.
GainFocus(Id)
Bring the window to the front and sets input focus. Has no effect if the window is already in focus, minimized, or not visible.
This method steals input focus from other applications. Do not use this method unless you are certain that’s what the user wants. Focus stealing can cause an extremely disruptive user experience.
§Platform-specific
- Web / Wayland: Unsupported.
ChangeLevel(Id, Level)
Change the window [Level
].
ShowSystemMenu(Id)
Show the system menu at cursor position.
§Platform-specific
Android / iOS / macOS / Orbital / Web / X11: Unsupported.
GetRawId(Id, Sender<u64>)
Get the raw identifier unique to the window.
ChangeIcon(Id, Icon)
Change the window [Icon
].
On Windows and X11, this is typically the small icon in the top-left corner of the titlebar.
§Platform-specific
-
Web / Wayland / macOS: Unsupported.
-
Windows: Sets
ICON_SMALL
. The base size for a window icon is 16x16, but it’s recommended to account for screen scaling and pick a multiple of that, i.e. 32x32. -
X11: Has no universal guidelines for icon sizes, so you’re at the whims of the WM. That said, it’s usually in the same ballpark as on Windows.
RunWithHandle(Id, Box<dyn FnOnce(WindowHandle<'_>) + Send>)
Runs the closure with the native window handle of the window with the given [Id
].
Screenshot(Id, Sender<Screenshot>)
Screenshot the viewport of the window.
EnableMousePassthrough(Id)
Enables mouse passthrough for the given window.
This disables mouse events for the window and passes mouse events through to whatever window is underneath.
DisableMousePassthrough(Id)
Disable mouse passthrough for the given window.
This enables mouse events for the window and stops mouse events from being passed to whatever is underneath.
Auto Trait Implementations§
impl Freeze for Action
impl !RefUnwindSafe for Action
impl Send for Action
impl !Sync for Action
impl Unpin for Action
impl !UnwindSafe for Action
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters
when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle
.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other
into Self
, while performing the appropriate scaling,
rounding and clamping.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T
.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters
when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self
into T
, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors
fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more