diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/scrollarea.cpp | 28 | ||||
-rw-r--r-- | src/gui/scrollarea.h | 1 |
2 files changed, 25 insertions, 4 deletions
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp index d652c94c..9d2ccb10 100644 --- a/src/gui/scrollarea.cpp +++ b/src/gui/scrollarea.cpp @@ -80,6 +80,11 @@ void ScrollArea::init() a++; } } + + hscrolll = resman->getImage("graphics/gui/hscrolll.png"); + hscrollr = resman->getImage("graphics/gui/hscrollr.png"); + vscrolld = resman->getImage("graphics/gui/vscrolld.png"); + vscrollu = resman->getImage("graphics/gui/vscrollu.png"); } void ScrollArea::draw(gcn::Graphics *graphics) @@ -156,22 +161,37 @@ void ScrollArea::drawBorder(gcn::Graphics *graphics) void ScrollArea::drawUpButton(gcn::Graphics *graphics) { - gcn::ScrollArea::drawUpButton(graphics); + gcn::Rectangle dim = getUpButtonDimension(); + int x, y; + getAbsolutePosition(x, y); + vscrollu->draw(screen, x + dim.x, y + dim.y); } void ScrollArea::drawDownButton(gcn::Graphics *graphics) { - gcn::ScrollArea::drawDownButton(graphics); + gcn::Rectangle dim = getDownButtonDimension(); + int x, y; + getAbsolutePosition(x, y); + vscrolld->draw(screen, x + dim.x, y + dim.y); + } void ScrollArea::drawLeftButton(gcn::Graphics *graphics) { - gcn::ScrollArea::drawLeftButton(graphics); + gcn::Rectangle dim = getLeftButtonDimension(); + int x, y; + getAbsolutePosition(x, y); + hscrolll->draw(screen, x + dim.x, y + dim.y); + } void ScrollArea::drawRightButton(gcn::Graphics *graphics) { - gcn::ScrollArea::drawRightButton(graphics); + gcn::Rectangle dim = getRightButtonDimension(); + int x, y; + getAbsolutePosition(x, y); + hscrollr->draw(screen, x + dim.x, y + dim.y); + } void ScrollArea::drawVBar(gcn::Graphics *graphics) diff --git a/src/gui/scrollarea.h b/src/gui/scrollarea.h index 27f14372..56bbbe26 100644 --- a/src/gui/scrollarea.h +++ b/src/gui/scrollarea.h @@ -72,6 +72,7 @@ class ScrollArea : public gcn::ScrollArea { ImageRect background; ImageRect vMarker; + Image *hscrolll, *hscrollr, *vscrolld, *vscrollu; float guiAlpha; }; |