changes to uiitem

This commit is contained in:
Henrique Santiago 2012-06-08 00:02:06 -03:00
parent 066ffead08
commit 587db0d89f
2 changed files with 13 additions and 1 deletions

View File

@ -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()

View File

@ -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)