예제 #1
0
	void GUIWidget::_updateLayout()
	{
		bs_frame_mark();

		// Determine dirty contents and layouts
		FrameStack<GUIElementBase*> todo;
		todo.push(mPanel);

		while (!todo.empty())
		{
			GUIElementBase* currentElem = todo.top();
			todo.pop();

			if (currentElem->_isDirty())
			{
				GUIElementBase* updateParent = currentElem->_getUpdateParent();
				assert(updateParent != nullptr || currentElem == mPanel);

				if (updateParent != nullptr)
					_updateLayout(updateParent);
				else // Must be root panel
					_updateLayout(mPanel);
			}
			else
			{
				UINT32 numChildren = currentElem->_getNumChildren();
				for (UINT32 i = 0; i < numChildren; i++)
					todo.push(currentElem->_getChild(i));
			}
		}

		bs_frame_clear();
	}
void MagatamasBoxItem::update() {
    _updateLayout();
    _autoAdjustPos();
    QGraphicsItem::update();
}
void MagatamasBoxItem::setIconSize(QSize size) {
    m_iconSize = size;
    _updateLayout();
}
void MagatamasBoxItem::setOrientation(Qt::Orientation orientation) {
    m_orientation = orientation;
    _updateLayout();
}