diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-30 22:53:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-30 22:53:27 +0300 |
commit | 5cbd0d2cb7086fda592c00dbc3b07d06af95f080 (patch) | |
tree | d36b4ac344f31f34311c7cb7a9a637ed48356e3e /src/gui/widgets/slider.cpp | |
parent | 4210163dae7d6266923ab11f78b631173c9533e3 (diff) | |
download | manaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.gz manaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.bz2 manaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.xz manaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.zip |
Add const to more classes.
Diffstat (limited to 'src/gui/widgets/slider.cpp')
-rw-r--r-- | src/gui/widgets/slider.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index 0a130f60e..c5eac9769 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -43,14 +43,14 @@ static std::string const data[2] = "slider_highlighted.xml" }; -Slider::Slider(double scaleEnd): +Slider::Slider(const double scaleEnd) : gcn::Slider(scaleEnd), mHasMouse(false) { init(); } -Slider::Slider(double scaleStart, double scaleEnd): +Slider::Slider(const double scaleStart, const double scaleEnd) : gcn::Slider(scaleStart, scaleEnd), mHasMouse(false) { @@ -62,7 +62,7 @@ Slider::~Slider() mInstances--; if (mInstances == 0 && Theme::instance()) { - Theme *theme = Theme::instance(); + Theme *const theme = Theme::instance(); for (int mode = 0; mode < 2; mode ++) theme->unloadRect(buttons[mode]); } @@ -94,8 +94,8 @@ void Slider::init() void Slider::updateAlpha() { - float alpha = std::max(Client::getGuiAlpha(), - Theme::instance()->getMinimumOpacity()); + const float alpha = std::max(Client::getGuiAlpha(), + Theme::instance()->getMinimumOpacity()); if (alpha != mAlpha) { @@ -120,9 +120,9 @@ void Slider::draw(gcn::Graphics *graphics) } int w = getWidth(); - int h = getHeight(); + const int h = getHeight(); int x = 0; - int y = mHasMouse ? (h - buttons[1].grid[HSTART]->getHeight()) / 2 : + const int y = mHasMouse ? (h - buttons[1].grid[HSTART]->getHeight()) / 2 : (h - buttons[0].grid[HSTART]->getHeight()) / 2; updateAlpha(); @@ -138,7 +138,7 @@ void Slider::draw(gcn::Graphics *graphics) if (buttons[0].grid[HMID]) { - const Image *hMid = buttons[0].grid[HMID]; + const Image *const hMid = buttons[0].grid[HMID]; static_cast<Graphics*>(graphics)-> drawImagePattern(hMid, x, y, w, hMid->getHeight()); } @@ -160,7 +160,7 @@ void Slider::draw(gcn::Graphics *graphics) if (buttons[1].grid[HMID]) { - const Image *hMid = buttons[1].grid[HMID]; + const Image *const hMid = buttons[1].grid[HMID]; static_cast<Graphics*>(graphics)->drawImagePattern( hMid, x, y, w, hMid->getHeight()); @@ -177,9 +177,9 @@ void Slider::draw(gcn::Graphics *graphics) drawMarker(graphics); } -void Slider::drawMarker(gcn::Graphics *graphics) +void Slider::drawMarker(gcn::Graphics *const graphics) { - const Image *img = (mHasMouse ? buttons[1].grid[HGRIP] + const Image *const img = (mHasMouse ? buttons[1].grid[HGRIP] : buttons[0].grid[HGRIP]); if (!img) return; @@ -200,7 +200,7 @@ void Slider::mouseExited(gcn::MouseEvent& event A_UNUSED) void Slider::keyPressed(gcn::KeyEvent& keyEvent) { - int action = static_cast<KeyEvent*>(&keyEvent)->getActionId(); + const int action = static_cast<KeyEvent*>(&keyEvent)->getActionId(); if (getOrientation() == HORIZONTAL) { |