Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8598 in orxonox.OLD for branches/gui/src/lib/gui/gl/glgui_slider.cc


Ignore:
Timestamp:
Jun 20, 2006, 1:45:44 AM (18 years ago)
Author:
bensch
Message:

style enbedded into gui, as it was redundant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl/glgui_slider.cc

    r8584 r8598  
    7474    else
    7575      this->_value = value;
    76     this->_handle.setCenter(this->sliderPosition(), style().borderTop() + (this->getSizeY2D() - style().borderTop() - style().borderBottom()) / 2.0);
     76    this->_handle.setCenter(this->sliderPosition(), borderTop() + (this->getSizeY2D() - borderTop() - borderBottom()) / 2.0);
    7777
    7878    emit(valueChanged(this->_value));
     
    165165//    this->frontRect().setTopLeft(this->borderLeft(), this->getSizeY2D()/2.0 - 2.0);
    166166//    this->frontRect().setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0);
    167     this->_slider.setTopLeft(style().borderLeft(), this->getSizeY2D() / 2.0 -2.0);
    168     this->_slider.setSize(this->getSizeX2D() - style().borderLeft() - style().borderRight(), 4.0);
    169     this->_handle.setSize(this->_sliderWidth, this->getSizeY2D() - style().borderTop() - style().borderBottom());
     167    this->_slider.setTopLeft(borderLeft(), this->getSizeY2D() / 2.0 -2.0);
     168    this->_slider.setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0);
     169    this->_handle.setSize(this->_sliderWidth, this->getSizeY2D() - borderTop() - borderBottom());
    170170  }
    171171
     
    211211  {
    212212    return (this->_value - this->_minValue)/( this->_maxValue - this->_minValue) *
    213         (this->getSizeX2D() - (style().borderLeft() + style().borderRight() + 2.0*_sliderWidth)) +
    214         (style().borderLeft() +_sliderWidth);
     213        (this->getSizeX2D() - (borderLeft() + borderRight() + 2.0*_sliderWidth)) +
     214        (borderLeft() +_sliderWidth);
    215215  }
    216216
     
    221221  float GLGuiSlider::sliderValue(float position) const
    222222  {
    223     return (position - (style().borderLeft()+_sliderWidth)) / (this->getSizeX2D() - (style().borderLeft() + style().borderRight() + 2.0*_sliderWidth))
     223    return (position - (borderLeft()+_sliderWidth)) / (this->getSizeX2D() - (borderLeft() + borderRight() + 2.0*_sliderWidth))
    224224           *( this->_maxValue - this->_minValue) +
    225225           this->_minValue ;
     
    239239    GLGuiWidget::draw();
    240240
    241     glColor4fv(&this->style().foregroundColor()[0]);
     241    glColor4fv(&this->foregroundColor()[0]);
    242242    this->drawRect(this->_slider);
    243243    this->drawRect(this->_handle);
Note: See TracChangeset for help on using the changeset viewer.