summaryrefslogtreecommitdiff
path: root/src/gui/scrollarea.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-22 00:44:09 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-22 00:44:09 +0000
commita64c5b01e683e76def759e6e871ceee330c9ae09 (patch)
treecc65bb71e89df3ce933aaa3ef52884e350f35efa /src/gui/scrollarea.cpp
parent423bd85aa1ca8051129df388aa2211dfbbe8ec1e (diff)
downloadmana-a64c5b01e683e76def759e6e871ceee330c9ae09.tar.gz
mana-a64c5b01e683e76def759e6e871ceee330c9ae09.tar.bz2
mana-a64c5b01e683e76def759e6e871ceee330c9ae09.tar.xz
mana-a64c5b01e683e76def759e6e871ceee330c9ae09.zip
Picking up now possible with Z, and fixed width of a few scroll area contents.
Diffstat (limited to 'src/gui/scrollarea.cpp')
-rw-r--r--src/gui/scrollarea.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp
index ad31ada8..319025a0 100644
--- a/src/gui/scrollarea.cpp
+++ b/src/gui/scrollarea.cpp
@@ -137,6 +137,27 @@ void ScrollArea::init()
instances++;
}
+void ScrollArea::logic()
+{
+ gcn::ScrollArea::logic();
+
+ // When no scrollbar in a certain direction, adapt content size to match
+ // the content dimension exactly.
+ if (mContent != NULL)
+ {
+ if (getHorizontalScrollPolicy() == gcn::ScrollArea::SHOW_NEVER)
+ {
+ mContent->setWidth(getContentDimension().width -
+ 2 * mContent->getBorderSize());
+ }
+ if (getVerticalScrollPolicy() == gcn::ScrollArea::SHOW_NEVER)
+ {
+ mContent->setHeight(getContentDimension().height -
+ 2 * mContent->getBorderSize());
+ }
+ }
+}
+
void ScrollArea::draw(gcn::Graphics *graphics)
{
checkPolicies();