Move jwidget_relayout() to Widget::layout().

This commit is contained in:
David Capello 2011-03-08 23:18:04 -03:00
parent f6c48645f9
commit bb7d3a0b71
3 changed files with 17 additions and 8 deletions

View File

@ -664,6 +664,16 @@ Widget* Widget::findSibling(const char* name)
return getRoot()->findChild(name);
}
// ===============================================================
// LAYOUT & CONSTRAINT
// ===============================================================
void Widget::layout()
{
jwidget_set_rect(this, rc);
invalidate();
}
/**********************************************************************/
/* position and geometry */
@ -696,12 +706,6 @@ void Widget::setBorder(const Border& br)
border_width.b = br.bottom();
}
void jwidget_relayout(JWidget widget)
{
jwidget_set_rect(widget, widget->rc);
widget->invalidate();
}
/* gets the position of the widget */
JRect jwidget_get_rect(JWidget widget)
{

View File

@ -63,7 +63,6 @@ void jwidget_replace_child(JWidget widget, JWidget old_child,
/* position and geometry */
void jwidget_relayout(JWidget widget);
JRect jwidget_get_rect(JWidget widget);
JRect jwidget_get_child_rect(JWidget widget);
JRegion jwidget_get_region(JWidget widget);
@ -237,6 +236,12 @@ public:
return dynamic_cast<T*>(findChild(name));
}
// ===============================================================
// LAYOUT & CONSTRAINT
// ===============================================================
void layout();
// ===============================================================
// POSITION & GEOMETRY
// ===============================================================

View File

@ -236,7 +236,7 @@ void ColorButton::openSelectorDialog()
m_frame->position_window(x, y);
jmanager_dispatch_messages(m_frame->getManager());
jwidget_relayout(m_frame);
m_frame->layout();
/* setup the hot-region */
{