diff --git a/modules/game/widgets/uiitem.lua b/modules/game/widgets/uiitem.lua index e2adac02..3578aaec 100644 --- a/modules/game/widgets/uiitem.lua +++ b/modules/game/widgets/uiitem.lua @@ -40,6 +40,7 @@ function UIItem:onDrop(widget, mousePos) end function UIItem:onHoverChange(hovered) + UIWidget.onHoverChange(self, hovered) if self:isVirtual() then return end local draggingWidget = g_ui.getDraggingWidget() diff --git a/src/otclient/ui/uiitem.cpp b/src/otclient/ui/uiitem.cpp index 72e995a8..a76ff050 100644 --- a/src/otclient/ui/uiitem.cpp +++ b/src/otclient/ui/uiitem.cpp @@ -35,7 +35,14 @@ void UIItem::drawSelf(bool foregroundPane) if(!foregroundPane) return; - UIWidget::drawSelf(foregroundPane); + // draw style components in order + if(m_backgroundColor.aF() > Fw::MIN_ALPHA) { + Rect backgroundDestRect = m_rect; + backgroundDestRect.expand(-m_borderWidth.top, -m_borderWidth.right, -m_borderWidth.bottom, -m_borderWidth.left); + drawBackground(m_rect); + } + + drawImage(m_rect); if(m_item) { Rect drawRect = getPaddingRect(); @@ -59,6 +66,10 @@ void UIItem::drawSelf(bool foregroundPane) // debug, show item id //m_font->drawText(stdext::to_string(m_item->getId()), m_rect, Fw::AlignBottomRight); } + + drawBorder(m_rect); + drawIcon(m_rect); + drawText(m_rect); } void UIItem::setItemId(int id)