mirror of
https://github.com/edubart/otclient.git
synced 2025-11-07 13:56:22 +01:00
fix and changes
* win32 compilation fix * add buttons to miniwindow * dispatcher events fixes * ui fixes
This commit is contained in:
@@ -35,16 +35,17 @@ void UIHorizontalLayout::applyStyle(const OTMLNodePtr& styleNode)
|
||||
}
|
||||
}
|
||||
|
||||
void UIHorizontalLayout::internalUpdate()
|
||||
bool UIHorizontalLayout::internalUpdate()
|
||||
{
|
||||
UIWidgetPtr parentWidget = getParentWidget();
|
||||
if(!parentWidget)
|
||||
return;
|
||||
return false;
|
||||
UIWidgetList widgets = parentWidget->getChildren();
|
||||
|
||||
if(m_alignRight)
|
||||
std::reverse(widgets.begin(), widgets.end());
|
||||
|
||||
bool changed = false;
|
||||
Rect clippingRect = parentWidget->getClippingRect();
|
||||
Point pos = (m_alignRight) ? clippingRect.topRight() : clippingRect.topLeft();
|
||||
int prefferedWidth = 0;
|
||||
@@ -70,7 +71,8 @@ void UIHorizontalLayout::internalUpdate()
|
||||
pos.y = clippingRect.top() + (clippingRect.height() - size.height())/2;
|
||||
}
|
||||
|
||||
widget->setRect(Rect(pos - parentWidget->getVirtualOffset(), size));
|
||||
if(widget->setRect(Rect(pos - parentWidget->getVirtualOffset(), size)))
|
||||
changed = true;
|
||||
|
||||
gap = (m_alignRight) ? -widget->getMarginLeft() : (widget->getWidth() + widget->getMarginRight());
|
||||
gap += m_spacing;
|
||||
@@ -87,4 +89,6 @@ void UIHorizontalLayout::internalUpdate()
|
||||
parentWidget->setWidth(prefferedWidth);
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user