pub struct GlobalState { /* private fields */ }Implementations§
Source§impl GlobalState
impl GlobalState
Sourcepub fn suppress_text_selection(cx: &mut App)
pub fn suppress_text_selection(cx: &mut App)
Suppress the window-level text selection for the current mouse down.
Call this from a mouse-down handler (bubble phase) of a component that owns its own press/drag interaction, so that pressing it does not start a window text selection. The flag is reset on the next mouse down.
pub fn global(cx: &App) -> &Self
pub fn global_mut(cx: &mut App) -> &mut Self
Sourcepub fn is_in_deferred_context(&self) -> bool
pub fn is_in_deferred_context(&self) -> bool
Check if we are currently inside a deferred context (e.g., inside an open Popover).
Get the application menus
Set the application menus
Trait Implementations§
impl Global for GlobalState
Auto Trait Implementations§
impl !RefUnwindSafe for GlobalState
impl !Sync for GlobalState
impl !UnwindSafe for GlobalState
impl Freeze for GlobalState
impl Send for GlobalState
impl Unpin for GlobalState
impl UnsafeUnpin for GlobalState
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ReadGlobal for Twhere
T: Global,
impl<T> ReadGlobal for Twhere
T: Global,
Source§impl<T> UpdateGlobal for Twhere
T: Global,
impl<T> UpdateGlobal for Twhere
T: Global,
Source§fn update_global<C, F, R>(cx: &mut C, update: F) -> R
fn update_global<C, F, R>(cx: &mut C, update: F) -> R
使用提供的闭包更新全局实例。 Read more
Source§fn set_global<C>(cx: &mut C, global: T)where
C: BorrowAppContext,
fn set_global<C>(cx: &mut C, global: T)where
C: BorrowAppContext,
设置全局实例。