[DEV] try to correct the expand error... (START)

This commit is contained in:
Edouard DUPIN 2016-01-31 22:28:58 +01:00
parent 44749e4a6f
commit 46699c20b6
2 changed files with 23 additions and 1 deletions

View File

@ -69,6 +69,13 @@ void ewol::widget::Button::calculateSize(const vec2& _availlable) {
//EWOL_DEBUG(" configuring : origin=" << origin << " size=" << subElementSize << "");
m_selectableAreaPos = vec2(ret.xLeft(), ret.yButtom());
m_selectableAreaSize = m_size - (m_selectableAreaPos + vec2(ret.xRight(), ret.yTop()));
if (m_userExpand->x() == true) {
m_size.setX(std::max(m_size.x(), _availlable.x()));
}
if (m_userExpand->y() == true) {
m_size.setY(std::max(m_size.y(), _availlable.y()));
}
}

View File

@ -86,7 +86,22 @@ void ewol::widget::Sizer::calculateSize(const vec2& _availlable) {
// Now update his size his size in X and the curent sizer size in Y:
if (m_mode == ewol::widget::Sizer::modeVert) {
if (it->canExpand().y() == true) {
it->calculateSize(vec2ClipInt32(vec2(m_size.x(), tmpSize.y()+sizeToAddAtEveryOne)));
vec2 expectedSize = vec2ClipInt32(vec2(m_size.x(), tmpSize.y()+sizeToAddAtEveryOne));
it->calculateSize(expectedSize);
vec2 underSize = it->getSize();
if (it->canExpand().x() == true) {
if (underSize.x() < expectedSize.x()) {
EWOL_WARNING("Subwidget request exapnd and does not expand ... ==> rules impose it ...");
//it->setSize(vec2(expectedSize.x(), underSize.y());
//underSize = it->getSize();
}
}
if (it->canExpand().y() == true) {
if (underSize.y() < expectedSize.y()) {
EWOL_WARNING("Subwidget request exapnd and does not expand ... ==> rules impose it ...");
//it->setSize(vec2(underSize.y(), expectedSize.x());
}
}
tmpOrigin.setY(tmpOrigin.y() + tmpSize.y()+sizeToAddAtEveryOne);
} else {
it->calculateSize(vec2ClipInt32(vec2(m_size.x(), tmpSize.y())));