added 'tooltip-delay' property
This commit is contained in:
@@ -109,6 +109,7 @@ SlotView::SlotView(
|
||||
layout(layout)
|
||||
{
|
||||
setColor(glm::vec4(0, 0, 0, 0.2f));
|
||||
setTooltipDelay(0.05f);
|
||||
}
|
||||
|
||||
void SlotView::draw(const DrawContext* pctx, Assets* assets) {
|
||||
|
||||
@@ -137,6 +137,15 @@ const std::wstring UINode::getTooltip() const {
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
void UINode::setTooltipDelay(float delay) {
|
||||
tooltipDelay = delay;
|
||||
}
|
||||
|
||||
float UINode::getTooltipDelay() const {
|
||||
return tooltipDelay;
|
||||
}
|
||||
|
||||
|
||||
glm::vec2 UINode::calcPos() const {
|
||||
if (parent) {
|
||||
return pos + parent->calcPos() + parent->contentOffset();
|
||||
|
||||
@@ -111,6 +111,8 @@ namespace gui {
|
||||
ActionsSet doubleClickCallbacks;
|
||||
/// @brief element tooltip text
|
||||
std::wstring tooltip;
|
||||
/// @brief element tooltip delay
|
||||
float tooltipDelay = 0.5f;
|
||||
|
||||
UINode(glm::vec2 size);
|
||||
public:
|
||||
@@ -202,6 +204,9 @@ namespace gui {
|
||||
virtual void setTooltip(const std::wstring& text);
|
||||
virtual const std::wstring getTooltip() const;
|
||||
|
||||
virtual void setTooltipDelay(float delay);
|
||||
virtual float getTooltipDelay() const;
|
||||
|
||||
virtual glm::vec4 calcColor() const;
|
||||
|
||||
/// @brief Get inner content offset. Used for scroll
|
||||
|
||||
Reference in New Issue
Block a user