diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-15 04:22:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-15 04:22:11 +0300 |
commit | c91bc5201596eda73f9df2222d76d9f413426a85 (patch) | |
tree | cbdcf7fb76eee35baf7265e5c04da2f13633ab5d /src/guichan/widgets/slider.cpp | |
parent | 255b1c29f47ef3b1e7a9b058c56ef72bfa10c5e3 (diff) | |
download | plus-c91bc5201596eda73f9df2222d76d9f413426a85.tar.gz plus-c91bc5201596eda73f9df2222d76d9f413426a85.tar.bz2 plus-c91bc5201596eda73f9df2222d76d9f413426a85.tar.xz plus-c91bc5201596eda73f9df2222d76d9f413426a85.zip |
Remove some diplicated code from embeded guichan.
Diffstat (limited to 'src/guichan/widgets/slider.cpp')
-rw-r--r-- | src/guichan/widgets/slider.cpp | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/guichan/widgets/slider.cpp b/src/guichan/widgets/slider.cpp index eba88382c..f0eabd627 100644 --- a/src/guichan/widgets/slider.cpp +++ b/src/guichan/widgets/slider.cpp @@ -117,74 +117,6 @@ namespace gcn mScaleEnd = scaleEnd; } - void Slider::draw(gcn::Graphics* graphics) - { - Color shadowColor = getBaseColor() - 0x101010; - int alpha = getBaseColor().a; - shadowColor.a = alpha; - - graphics->setColor(shadowColor); - graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight())); - - drawMarker(graphics); - } - - void Slider::drawMarker(gcn::Graphics* graphics) - { - gcn::Color faceColor = getBaseColor(); - Color highlightColor, shadowColor; - int alpha = getBaseColor().a; - highlightColor = faceColor + 0x303030; - highlightColor.a = alpha; - shadowColor = faceColor - 0x303030; - shadowColor.a = alpha; - - graphics->setColor(faceColor); - - if (getOrientation() == HORIZONTAL) - { - int v = getMarkerPosition(); - graphics->fillRectangle(gcn::Rectangle(v + 1, 1, - getMarkerLength() - 2, getHeight() - 2)); - graphics->setColor(highlightColor); - graphics->drawLine(v, 0, v + getMarkerLength() - 1, 0); - graphics->drawLine(v, 0, v, getHeight() - 1); - graphics->setColor(shadowColor); - graphics->drawLine(v + getMarkerLength() - 1, 1, - v + getMarkerLength() - 1, getHeight() - 1); - graphics->drawLine(v + 1, getHeight() - 1, - v + getMarkerLength() - 1, getHeight() - 1); - - if (isFocused()) - { - graphics->setColor(getForegroundColor()); - graphics->drawRectangle(Rectangle(v + 2, 2, - getMarkerLength() - 4, getHeight() - 4)); - } - } - else - { - int v = (getHeight() - getMarkerLength()) - getMarkerPosition(); - graphics->fillRectangle(gcn::Rectangle(1, v + 1, getWidth() - 2, - getMarkerLength() - 2)); - graphics->setColor(highlightColor); - graphics->drawLine(0, v, 0, v + getMarkerLength() - 1); - graphics->drawLine(0, v, getWidth() - 1, v); - graphics->setColor(shadowColor); - graphics->drawLine(1, v + getMarkerLength() - 1, getWidth() - 1, - v + getMarkerLength() - 1); - graphics->drawLine(getWidth() - 1, v + 1, getWidth() - 1, - v + getMarkerLength() - 1); - - if (isFocused()) - { - graphics->setColor(getForegroundColor()); - graphics->drawRectangle(Rectangle(2, v + 2, getWidth() - 4, - getMarkerLength() - 4)); - } - } - } - void Slider::mousePressed(MouseEvent& mouseEvent) { if (mouseEvent.getButton() == gcn::MouseEvent::LEFT |