fix ToolTips on split buttons not working correctly (button overrode them), fix tooltips displaying on disabled buttons
This commit is contained in:
parent
1d00e712ad
commit
69961956bf
@ -51,6 +51,23 @@ public:
|
|||||||
void SetShowSplit(bool split) { showSplit = split; }
|
void SetShowSplit(bool split) { showSplit = split; }
|
||||||
SplitButtonAction * GetSplitActionCallback() { return splitActionCallback; }
|
SplitButtonAction * GetSplitActionCallback() { return splitActionCallback; }
|
||||||
void SetSplitActionCallback(SplitButtonAction * newAction) { splitActionCallback = newAction; }
|
void SetSplitActionCallback(SplitButtonAction * newAction) { splitActionCallback = newAction; }
|
||||||
|
void SetToolTip(int x, int y)
|
||||||
|
{
|
||||||
|
if(x >= splitPosition || !showSplit)
|
||||||
|
{
|
||||||
|
if(toolTip2.length()>0 && GetParentWindow())
|
||||||
|
{
|
||||||
|
GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(x < splitPosition)
|
||||||
|
{
|
||||||
|
if(toolTip.length()>0 && GetParentWindow())
|
||||||
|
{
|
||||||
|
GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
virtual void OnMouseUnclick(int x, int y, unsigned int button)
|
virtual void OnMouseUnclick(int x, int y, unsigned int button)
|
||||||
{
|
{
|
||||||
if(isButtonDown)
|
if(isButtonDown)
|
||||||
@ -63,42 +80,20 @@ public:
|
|||||||
ui::Button::OnMouseUnclick(x, y, button);
|
ui::Button::OnMouseUnclick(x, y, button);
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual void OnMouseMovedInside(int x, int y, int dx, int dy)
|
virtual void OnMouseHover(int x, int y, int dx, int dy)
|
||||||
{
|
{
|
||||||
if(x >= splitPosition || !showSplit)
|
SetToolTip(x, y);
|
||||||
{
|
}
|
||||||
if(toolTip.length()>0 && GetParentWindow())
|
virtual void OnMouseHover(int x, int y)
|
||||||
{
|
{
|
||||||
GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip2);
|
SetToolTip(x, y);
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(x < splitPosition)
|
|
||||||
{
|
|
||||||
if(toolTip2.length()>0 && GetParentWindow())
|
|
||||||
{
|
|
||||||
GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
virtual void OnMouseEnter(int x, int y)
|
virtual void OnMouseEnter(int x, int y)
|
||||||
{
|
{
|
||||||
isMouseInside = true;
|
isMouseInside = true;
|
||||||
if(!Enabled)
|
if(!Enabled)
|
||||||
return;
|
return;
|
||||||
if(x >= splitPosition || !showSplit)
|
SetToolTip(x, y);
|
||||||
{
|
|
||||||
if(toolTip.length()>0 && GetParentWindow())
|
|
||||||
{
|
|
||||||
GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(x < splitPosition)
|
|
||||||
{
|
|
||||||
if(toolTip2.length()>0 && GetParentWindow())
|
|
||||||
{
|
|
||||||
GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
virtual void TextPosition()
|
virtual void TextPosition()
|
||||||
{
|
{
|
||||||
|
@ -196,7 +196,7 @@ void Button::OnMouseEnter(int x, int y)
|
|||||||
|
|
||||||
void Button::OnMouseHover(int x, int y)
|
void Button::OnMouseHover(int x, int y)
|
||||||
{
|
{
|
||||||
if(toolTip.length()>0 && GetParentWindow())
|
if(Enabled && toolTip.length()>0 && GetParentWindow())
|
||||||
{
|
{
|
||||||
GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip);
|
GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user