From 082530d18ccfdb41a0bb635f2e29a49bcb8e2592 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sun, 5 May 2013 00:18:28 -0400 Subject: [PATCH] fix tooltip issues in render options too --- src/gui/interface/Checkbox.cpp | 4 ++++ src/gui/interface/Checkbox.h | 1 + src/gui/render/RenderView.cpp | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/interface/Checkbox.cpp b/src/gui/interface/Checkbox.cpp index 7caf18b22..d2a59191e 100644 --- a/src/gui/interface/Checkbox.cpp +++ b/src/gui/interface/Checkbox.cpp @@ -53,6 +53,10 @@ void Checkbox::OnMouseUp(int x, int y, unsigned int button) void Checkbox::OnMouseEnter(int x, int y) { isMouseOver = true; +} + +void Checkbox::OnMouseHover(int x, int y) +{ if(toolTip.length()>0 && GetParentWindow()) { GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip); diff --git a/src/gui/interface/Checkbox.h b/src/gui/interface/Checkbox.h index f82cef7a6..4877ade1b 100644 --- a/src/gui/interface/Checkbox.h +++ b/src/gui/interface/Checkbox.h @@ -25,6 +25,7 @@ public: void SetIcon(Icon icon); void Draw(const Point& screenPos); virtual void OnMouseEnter(int x, int y); + virtual void OnMouseHover(int x, int y); virtual void OnMouseLeave(int x, int y); virtual void OnMouseClick(int x, int y, unsigned int button); virtual void OnMouseUp(int x, int y, unsigned int button); diff --git a/src/gui/render/RenderView.cpp b/src/gui/render/RenderView.cpp index 508ff47a2..3b3a91afe 100644 --- a/src/gui/render/RenderView.cpp +++ b/src/gui/render/RenderView.cpp @@ -394,7 +394,8 @@ void RenderView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bo void RenderView::ToolTip(ui::Component * sender, ui::Point mousePosition, std::string toolTip) { this->toolTip = toolTip; - toolTipPresence = 500; + if (toolTipPresence < 120) + toolTipPresence += 3; } RenderView::~RenderView() {