Improved hovering over tabs (no more messed up focus when mouse leaves)
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8004 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
519770ec2f
commit
62c904c851
@ -722,11 +722,13 @@ void Skin::drawRibbonChild(const core::rect< s32 > &rect, Widget* widget, const
|
|||||||
/* tab-bar ribbons */
|
/* tab-bar ribbons */
|
||||||
if (type == RIBBON_TABS)
|
if (type == RIBBON_TABS)
|
||||||
{
|
{
|
||||||
|
const bool mouseIn = rect.isPointInside(irr_driver->getDevice()->getCursorControl()->getPosition());
|
||||||
|
|
||||||
BoxRenderParams* params;
|
BoxRenderParams* params;
|
||||||
|
|
||||||
if (mark_selected && (focused || parent_focused))
|
if (mark_selected && (focused || parent_focused))
|
||||||
params = &SkinConfig::m_render_params["tab::focused"];
|
params = &SkinConfig::m_render_params["tab::focused"];
|
||||||
else if (parentRibbon->m_mouse_focus == widget)
|
else if (parentRibbon->m_mouse_focus == widget && mouseIn)
|
||||||
params = &SkinConfig::m_render_params["tab::focused"];
|
params = &SkinConfig::m_render_params["tab::focused"];
|
||||||
else if (mark_selected)
|
else if (mark_selected)
|
||||||
params = &SkinConfig::m_render_params["tab::down"];
|
params = &SkinConfig::m_render_params["tab::down"];
|
||||||
|
@ -435,6 +435,7 @@ EventPropagation RibbonWidget::leftPressed(const int playerID)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
EventPropagation RibbonWidget::focused(const int playerID)
|
EventPropagation RibbonWidget::focused(const int playerID)
|
||||||
{
|
{
|
||||||
Widget::focused(playerID);
|
Widget::focused(playerID);
|
||||||
@ -456,6 +457,13 @@ EventPropagation RibbonWidget::focused(const int playerID)
|
|||||||
|
|
||||||
return EVENT_LET;
|
return EVENT_LET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void RibbonWidget::unfocused(const int playerID)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
EventPropagation RibbonWidget::mouseHovered(Widget* child, const int mousePlayerID)
|
EventPropagation RibbonWidget::mouseHovered(Widget* child, const int mousePlayerID)
|
||||||
{
|
{
|
||||||
|
@ -74,6 +74,7 @@ namespace GUIEngine
|
|||||||
virtual EventPropagation mouseHovered(Widget* child, const int playerID);
|
virtual EventPropagation mouseHovered(Widget* child, const int playerID);
|
||||||
virtual EventPropagation transmitEvent(Widget* w, std::string& originator, const int playerID=0);
|
virtual EventPropagation transmitEvent(Widget* w, std::string& originator, const int playerID=0);
|
||||||
virtual EventPropagation focused(const int playerID);
|
virtual EventPropagation focused(const int playerID);
|
||||||
|
virtual void unfocused(const int playerID);
|
||||||
|
|
||||||
PtrVector<irr::gui::IGUIStaticText, REF> m_labels;
|
PtrVector<irr::gui::IGUIStaticText, REF> m_labels;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user