diff options
author | Dennis Friis <peavey@placid.dk> | 2008-04-27 22:40:27 +0000 |
---|---|---|
committer | Dennis Friis <peavey@placid.dk> | 2008-04-27 22:40:27 +0000 |
commit | 044151cee3dc6a65ba21f93db331844d6c8f3974 (patch) | |
tree | ed49f83b57a0fc85d26ceadf1d154b12fc324873 /src/gui/scrollarea.cpp | |
parent | ab08248a2da802de38bb017b994c22e8f7999424 (diff) | |
download | mana-044151cee3dc6a65ba21f93db331844d6c8f3974.tar.gz mana-044151cee3dc6a65ba21f93db331844d6c8f3974.tar.bz2 mana-044151cee3dc6a65ba21f93db331844d6c8f3974.tar.xz mana-044151cee3dc6a65ba21f93db331844d6c8f3974.zip |
Add methods to get width and height adjusted for any visible scrollbars.
Diffstat (limited to 'src/gui/scrollarea.cpp')
-rw-r--r-- | src/gui/scrollarea.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp index 255aa2d8..21f37510 100644 --- a/src/gui/scrollarea.cpp +++ b/src/gui/scrollarea.cpp @@ -296,3 +296,15 @@ void ScrollArea::drawHMarker(gcn::Graphics *graphics) static_cast<Graphics*>(graphics)-> drawImageRect(dim.x, dim.y, dim.width, dim.height, vMarker); } + +int ScrollArea::getAdjustedWidth() const +{ + return ScrollArea::getDimension().width - + (mVBarVisible ? ScrollArea::getScrollbarWidth() : 0); +} + +int ScrollArea::getAdjustedHeight() const +{ + return ScrollArea::getDimension().height - + (mHBarVisible ? ScrollArea::getScrollbarWidth() : 0); +} |