Hoverable class no longer drives tooltips. Rather, a tooltip widget can be parented to any widget.
This commit is contained in:
@@ -31,11 +31,11 @@ namespace JUI
|
||||
virtual void OnExit(const Vector2& MousePos);
|
||||
|
||||
void Update(const Vector2& m_pos, float delta);
|
||||
virtual void SetTooltip(const std::string& content, float delay) {}
|
||||
//virtual void SetTooltip(const std::string& content, float delay) {}
|
||||
protected:
|
||||
Tooltip* tooltip = nullptr;
|
||||
float tooltip_threshold = 0.f;
|
||||
float tooltip_limit = 0.125f;
|
||||
//Tooltip* tooltip = nullptr;
|
||||
//float tooltip_threshold = 0.f;
|
||||
//float tooltip_limit = 0.125f;
|
||||
bool hovered = false;
|
||||
bool hover_debounce = false;
|
||||
};
|
||||
|
@@ -7,12 +7,12 @@ void JUI::Hoverable::OnHover(const Vector2 &MousePos) {
|
||||
void JUI::Hoverable::OnExit(const Vector2 &MousePos) {
|
||||
OnExitEvent.Invoke(MousePos);
|
||||
|
||||
tooltip_threshold = 0;
|
||||
//tooltip_threshold = 0;
|
||||
}
|
||||
|
||||
void JUI::Hoverable::Update(const Vector2 &m_pos, float delta) {
|
||||
|
||||
if (tooltip != nullptr)
|
||||
/*if (tooltip != nullptr)
|
||||
{
|
||||
if (IsHovered()) {
|
||||
tooltip->Visible(true);
|
||||
@@ -20,7 +20,7 @@ void JUI::Hoverable::Update(const Vector2 &m_pos, float delta) {
|
||||
} else {
|
||||
tooltip->Visible(false);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
if (IsHovered() && !hover_debounce) {
|
||||
|
Reference in New Issue
Block a user