pub trait PopoverTrigger:
Widget
+ Sized
+ 'static {
// Required methods
fn default_has_popup() -> HasPopup;
fn default_show_caret() -> bool;
fn caret_role(
&self,
interaction: &Signal<InteractionState>,
) -> Signal<TextRole>;
fn with_shared_interaction(self, signal: Signal<InteractionState>) -> Self;
fn with_has_popup(self, kind: HasPopup) -> Self;
fn with_expanded_when(self, open: Signal<bool>) -> Self;
fn with_on_activate(
self,
f: impl Fn(&mut EventContext<'_>) + 'static,
) -> Self;
fn has_on_activate(&self) -> bool;
// Provided method
fn suppress_caret(&self) -> bool { ... }
}Expand description
A trigger widget usable with PopoverWidget. Implemented for
Button and IconButton. Captures the few points where the two
triggers differ; everything else is handled by the generic wrapper.
Required Methods§
Sourcefn default_has_popup() -> HasPopup
fn default_has_popup() -> HasPopup
The has_popup kind announced by AT when the caller doesn’t
override it. Button → [HasPopup::Dialog]; IconButton →
[HasPopup::Menu].
Sourcefn default_show_caret() -> bool
fn default_show_caret() -> bool
Whether the disclosure caret is painted by default. Button →
false (text buttons advertise via an inline trailing chevron);
IconButton → true (icon-only triggers have no label slot).
Sourcefn caret_role(&self, interaction: &Signal<InteractionState>) -> Signal<TextRole>
fn caret_role(&self, interaction: &Signal<InteractionState>) -> Signal<TextRole>
The TextRole the disclosure caret tints with, derived from the
shared interaction signal so the caret and trigger tint together
across hover / press / focus / disabled. Only called when a caret
is shown.
Share an externally-allocated interaction signal so the caret colour tracks the trigger’s state (hover / press / focus / disabled) exactly.
Sourcefn with_has_popup(self, kind: HasPopup) -> Self
fn with_has_popup(self, kind: HasPopup) -> Self
Annotate the trigger with the given has_popup kind for AT.
Sourcefn with_expanded_when(self, open: Signal<bool>) -> Self
fn with_expanded_when(self, open: Signal<bool>) -> Self
Bind the trigger’s set_expanded disclosure state to open.
Sourcefn with_on_activate(self, f: impl Fn(&mut EventContext<'_>) + 'static) -> Self
fn with_on_activate(self, f: impl Fn(&mut EventContext<'_>) + 'static) -> Self
Install the popover’s open/close handler as the trigger’s activate callback.
Sourcefn has_on_activate(&self) -> bool
fn has_on_activate(&self) -> bool
Return true if the trigger already has an activate handler set by
the caller — the wrapper replaces it and will warn at build time.
Provided Methods§
Sourcefn suppress_caret(&self) -> bool
fn suppress_caret(&self) -> bool
Whether the caret must be suppressed for this trigger regardless
of the flag (e.g. IconButton at Compact has no room).
Default: never suppressed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".