added tooltips

This commit is contained in:
MihailRis
2024-05-24 08:03:05 +03:00
parent 1c45236693
commit eb10904069
10 changed files with 146 additions and 11 deletions
+11 -1
View File
@@ -109,6 +109,8 @@ namespace gui {
ActionsSet actions;
/// @brief 'ondoubleclick' callbacks
ActionsSet doubleClickCallbacks;
/// @brief element tooltip text
std::wstring tooltip;
UINode(glm::vec2 size);
public:
@@ -197,6 +199,9 @@ namespace gui {
virtual void setResizing(bool flag);
virtual bool isResizing() const;
virtual void setTooltip(const std::wstring& text);
virtual const std::wstring getTooltip() const;
virtual glm::vec4 calcColor() const;
/// @brief Get inner content offset. Used for scroll
@@ -237,9 +242,14 @@ namespace gui {
/// @brief collect all nodes having id
static void getIndices(
std::shared_ptr<UINode> node,
const std::shared_ptr<UINode> node,
std::unordered_map<std::string, std::shared_ptr<UINode>>& map
);
static std::shared_ptr<UINode> find(
const std::shared_ptr<UINode> node,
const std::string& id
);
};
}