|
ZenitUI
Retained-mode C++20 UI framework
|
A portal-based hover label. More...
#include <Tooltip.hpp>
Public Member Functions | |
| Tooltip (std::string text) | |
| Construct a tooltip with the given text. | |
| void | setText (std::string text) |
| const std::string & | getText () const |
| void | setAnchor (std::weak_ptr< Layout > a) |
| Change the anchor (advanced). | |
| void | setShowDelay (float s) |
| Change the delay in seconds before the tooltip appears. | |
| void | show () |
| Begin the countdown to show. | |
| void | hide () |
| Hide immediately and cancel any pending countdown. | |
| void | arrange (Rect) override |
| No-op: the tooltip owns its rect via onUpdate. | |
| Public Member Functions inherited from ZenitUI::TLayout< Tooltip, Panel > | |
| TLayout (Args &&...args) | |
Forward constructor arguments to Base. | |
| std::shared_ptr< Tooltip > | cls (const std::string &name) |
| Fluent addClass; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Tooltip > | id (const std::string &node_id) |
| Fluent setId; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Tooltip > | withRef (const std::string &r) |
| Fluent setRef; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Tooltip > | size (Value w, Value h) |
| Fluent setSize; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Tooltip > | passThrough (bool p=true) |
| Fluent setPassThrough; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Tooltip > | with (std::shared_ptr< Layout > c) |
| Fluent addChild; returns typed shared_ptr<Derived>. | |
| std::shared_ptr< Tooltip > | self () |
| Return shared_from_this() statically cast to Derived. | |
Static Public Member Functions | |
| static std::shared_ptr< Tooltip > | attach (std::shared_ptr< Layout > owner, std::string text, float showDelay=0.4f) |
Attach a tooltip to owner. | |
| Static Public Member Functions inherited from ZenitUI::TLayout< Tooltip, Panel > | |
| static std::shared_ptr< Tooltip > | create (Args &&...args) |
| Construct a shared_ptr<Derived> and call onBuild(). | |
Protected Member Functions | |
| void | onBuild () override |
| Hook: called once after create() finishes constructing the object. | |
| void | onUpdate (float dt) override |
A portal-based hover label.
Style tag: "Tooltip". Portal by default. Not interactive, does not block raycast. arrange() is a no-op; the tooltip positions itself via onUpdate once the label has been measured.
|
explicit |
Construct a tooltip with the given text.
|
static |
Attach a tooltip to owner.
| owner | Node to attach to. Must be non-null. |
| text | Text to display. |
| showDelay | Seconds the pointer must remain over the owner before the tooltip appears. |
|
overrideprotectedvirtual |
Hook: called once after create() finishes constructing the object.
Reimplemented from ZenitUI::TLayout< Tooltip, Panel >.
| void ZenitUI::UI::Tooltip::show | ( | ) |
Begin the countdown to show.
Idempotent while hovering.