MCPcopy Index your code
hub / github.com/material-shell/material-shell / createTooltip

Method createTooltip

src/manager/tooltipManager.ts:60–84  ·  view source on GitHub ↗
(
        actor: Clutter.Actor,
        params: Partial<MatTooltipParams>
    )

Source from the content-addressed store, hash-verified

58 }
59
60 createTooltip(
61 actor: Clutter.Actor,
62 params: Partial<MatTooltipParams>
63 ): MatTooltip | undefined {
64 // If actor has text, use it instead because it may be updated
65 let actorText: string | undefined;
66 if (actor instanceof St.Label || actor instanceof Clutter.Text) {
67 const clutterText =
68 actor instanceof St.Label
69 ? (actor.get_clutter_text() as Clutter.Text)
70 : actor;
71 if (clutterText.get_layout().is_ellipsized()) {
72 actorText = clutterText.get_text()!;
73 }
74 }
75 if (actorText) params.text = actorText;
76
77 if (!params.text) {
78 return;
79 }
80 const tooltip = new MatTooltip(actor, params);
81 Main.layoutManager.addChrome(tooltip);
82 tooltip.show();
83 return tooltip;
84 }
85}
86
87enum TooltipSide {

Callers 1

tooltipCallbackMethod · 0.95

Calls 5

showMethod · 0.95
is_ellipsizedMethod · 0.80
get_clutter_textMethod · 0.65
get_layoutMethod · 0.65
get_textMethod · 0.65

Tested by

no test coverage detected