From f91d439ac062c8b845a563e5cc40f9328e0bb406 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Thu, 5 Jun 2014 17:32:14 +0200 Subject: [PATCH] canvas.gui: Update ScrollArea for layouting system. --- Nasal/canvas/gui/widgets/ScrollArea.nas | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Nasal/canvas/gui/widgets/ScrollArea.nas b/Nasal/canvas/gui/widgets/ScrollArea.nas index 4be78e877..edbf9f840 100644 --- a/Nasal/canvas/gui/widgets/ScrollArea.nas +++ b/Nasal/canvas/gui/widgets/ScrollArea.nas @@ -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.