pub struct InteractionState {
pub pointer_pos: Option<(i16, i16)>,
pub is_pressed: bool,
pub focused_index: Option<u16>,
pub focus_visible: bool,
pub focus_ring_color: Color,
}Expand description
引擎交互伪类与焦点状态(用于驱动 hover_bg、active_bg 与 :focus-visible 主题融合焦点边框)。
Fields§
§pointer_pos: Option<(i16, i16)>§is_pressed: bool§focused_index: Option<u16>§focus_visible: bool是否由键盘导航(Tab / BackTab / 方向键)激活可见焦点环(模拟标准 :focus-visible,鼠标点击普通控件不弹出多余方框)。
focus_ring_color: Color当前生效主题的默认焦点边框色(由引擎同步自 theme().ring,彻底消除硬编码青蓝框)。
Implementations§
Source§impl InteractionState
impl InteractionState
Sourcepub const fn const_default() -> Self
pub const fn const_default() -> Self
编译期默认交互状态常量(支持 VeloxEngine::new 的 #![no_std] const fn 构造)。
Trait Implementations§
Source§impl Clone for InteractionState
impl Clone for InteractionState
impl Copy for InteractionState
Source§impl Debug for InteractionState
impl Debug for InteractionState
Auto Trait Implementations§
impl Forget for InteractionState
impl Freeze for InteractionState
impl Move for InteractionState
impl RefUnwindSafe for InteractionState
impl Send for InteractionState
impl Sync for InteractionState
impl Unpin for InteractionState
impl UnsafeUnpin for InteractionState
impl UnwindSafe for InteractionState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。