teksilo_core/styles/tooltip_style.rs
1// SPDX-License-Identifier: MPL-2.0
2// SPDX-FileCopyrightText: 2026 FernTech
3
4//! Tier-3 style protocol for `Tooltip`. See `docs/styling-system.md`.
5//!
6//! Distinct from [`crate::styles::PopoverStyle`] (which paints the
7//! generic popover surface): this is the tooltip-flavored chrome
8//! shipped by all three tooltip tiers (plain / rich / composite).
9
10use std::rc::Rc;
11
12use crate::build_context::BuildContext;
13use crate::widget_id::WidgetId;
14
15#[derive(Clone, Debug)]
16pub struct TooltipStyleConfig {
17 /// Pre-built body subtree (text widget for plain; structured
18 /// content for rich / composite).
19 pub content: WidgetId,
20}
21
22pub trait TooltipStyle: 'static {
23 fn make_body(&self, cfg: &TooltipStyleConfig, ctx: &mut BuildContext) -> WidgetId;
24}
25
26pub type SharedTooltipStyle = Rc<dyn TooltipStyle>;