跳到正文

Tooltip

在核心精确控制的延迟后显示辅助信息,并支持 Provider 级预热。

正在加载交互演示…

#导入

从 quickgui 导入 Tooltip。

use quickgui::*;

#用法

let tooltip = Tooltip::new("hint");
tooltip.trigger().child("Save")

#结构

  • Tooltip::provider_part
  • Tooltip::root
  • Tooltip::trigger
  • Tooltip::portal
  • Tooltip::positioner
  • Tooltip::popup
  • Tooltip::arrow

#API 参考

展开条目查看说明和完整签名。短横线表示声明中未记录默认值。

pub fn new(content: impl IntoElement) -> Self

Create a tooltip from an arbitrary GPU element tree.

textpub fn text(label: impl Into<Arc<str>>) -> Self—

Create a compact native-style text tooltip.

pub fn text(label: impl Into<Arc<str>>) -> Self
查看源码
placementpub fn placement(mut self, placement: AnchorPlacement) -> Self—

Configures placement for this part.

pub fn placement(mut self, placement: AnchorPlacement) -> Self
查看源码
delaypub fn delay(mut self, delay: Duration) -> Self—

Configures delay for this part.

pub fn delay(mut self, delay: Duration) -> Self
查看源码
gappub fn gap(mut self, gap: f32) -> Self—

Configures gap for this part.

pub fn gap(mut self, gap: f32) -> Self
查看源码
viewport_marginpub fn viewport_margin(mut self, margin: f32) -> Self—

Configures viewport margin for this part.

pub fn viewport_margin(mut self, margin: f32) -> Self
查看源码
accessibility_descriptionpub fn accessibility_description(mut self, description: impl Into<Arc<str>>) -> Self—

Text exposed as the trigger's native accessibility description while the visual tooltip stays transient.

pub fn accessibility_description(mut self, description: impl Into<Arc<str>>) -> Self
查看源码