summaryrefslogtreecommitdiff
path: root/otk
diff options
context:
space:
mode:
authorMarius Nita <marius@cs.pdx.edu>2002-11-13 10:39:35 +0000
committerMarius Nita <marius@cs.pdx.edu>2002-11-13 10:39:35 +0000
commitb33e8f66129db596fcf22499c2abc7c4505a8f48 (patch)
treef99c3689535ed290678f4768901a05658eeaea1c /otk
parentf0a1bdd6061adb933d9fd079768f78ee1f4e6499 (diff)
adding vertical dynamic resize code
Diffstat (limited to 'otk')
-rw-r--r--otk/widget.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/otk/widget.cc b/otk/widget.cc
index 4522a1c0..124431c5 100644
--- a/otk/widget.cc
+++ b/otk/widget.cc
@@ -296,11 +296,29 @@ void OtkWidget::adjustVert(void)
int widest = 0;
int height = _bevel_width;
+ OtkWidgetList stretchable;
+
for (it = _children.begin(); it != end; ++it) {
tmp = *it;
+ if (tmp->isStretchableVert() && _fixed_height)
+ stretchable.push_back(tmp);
+ else
+ height += tmp->_rect.height() + _bevel_width;
+
if (tmp->_rect.width() > widest)
widest = tmp->_rect.width();
- height += tmp->_rect.height() + _bevel_width;
+ }
+
+ if (stretchable.size() > 0) {
+ OtkWidgetList::iterator str_it = stretchable.begin(),
+ str_end = stretchable.end();
+
+ int str_height = _rect.height() - height / stretchable.size();
+
+ for (; str_it != str_end; ++str_it) {
+ (*str_it)->setHeight(str_height - _bevel_width);
+ (*str_it)->update();
+ }
}
OtkWidget *prev_widget = 0;