-void OtkWidget::focus(void)
-{
- _focused = true;
-
- OtkWidget::OtkWidgetList::iterator it = _children.begin(),
- end = _children.end();
- for (; it != end; ++it)
- (*it)->focus();
+ for (it = _children.begin(); it != end; ++it) {
+ const otk::Size &min = (*it)->minSize();
+ const otk::Size &max = (*it)->maxSize();
+ if (_direction == Horizontal) {
+ if (min.height() > min_biggest) min_biggest = min.height();
+ if (max.height() > max_biggest) max_biggest = max.height();
+ min_sum += _bevel + min.width();
+ if (max.width() == INT_MAX)
+ fullmax = true;
+ else if (!fullmax)
+ max_sum += _bevel + max.width();
+ } else {
+ if (min.width() > min_biggest) min_biggest = min.width();
+ if (max.width() > max_biggest) max_biggest = max.width();
+ min_sum += _bevel + min.height();
+ if (max.height() == INT_MAX)
+ fullmax = true;
+ else if (!fullmax)
+ max_sum += _bevel + max.height();
+ }
+ }
+ if (_direction == Horizontal) {
+ _min_size = otk::Size(min_sum + (_bevel + _borderwidth) * 2,
+ min_biggest + (_bevel + _borderwidth) * 2);
+ _max_size = otk::Size((fullmax ? INT_MAX :
+ max_sum + (_bevel + _borderwidth) * 2),
+ max_biggest);
+ } else {
+ _min_size = otk::Size(min_biggest + (_bevel + _borderwidth) * 2,
+ min_sum + (_bevel + _borderwidth) * 2);
+ _max_size = otk::Size(max_biggest, (fullmax ? INT_MAX : max_sum +
+ (_bevel + _borderwidth) * 2));
+ }
+ update();