1
0
Fork 0

canvas.gui: Update ScrollArea for layouting system.

This commit is contained in:
Thomas Geymayer 2014-06-05 17:32:14 +02:00
parent 1db2300263
commit f91d439ac0

View file

@ -10,6 +10,12 @@ gui.widgets.ScrollArea = {
m._max_scroll = [0, 0];
m._content_size = [0, 0];
m.setMinimumSize([16, 16]);
m.setSizeHint([128, 128]);
m.setMaximumSize([m._MAX_SIZE, m._MAX_SIZE]);
m.setSetGeometryFunc(m.setGeometry);
if( style != nil )
{
m._scroll = style.createWidget(parent, "scroll-area", cfg);
@ -102,6 +108,12 @@ gui.widgets.ScrollArea = {
me.update(bb);
},
setGeometry: func(geom)
{
me.move(geom[0], geom[1]);
me.setSize([geom[2] - geom[0], geom[3] - geom[1]]);
return me;
},
# Update scroll bar and content area.
#
# Needs to be called when the size of the content changes.