diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2009-08-14 14:44:36 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2009-08-14 14:44:36 -0400 |
commit | 21bfcbde7ec6e6b3e8a92237b7c33879216c4e82 (patch) | |
tree | 5346bb05d7f74d2f2021883ff0ee4f32bbb56f4a /indra/llui/llslider.cpp | |
parent | 2da8eb43d57ae6876f9955386f604f2c56849211 (diff) | |
parent | aff85ed92c5aad3a9445cf4ec5447cc56c44dfc0 (diff) |
Merge changes
Diffstat (limited to 'indra/llui/llslider.cpp')
-rw-r--r-- | indra/llui/llslider.cpp | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp index 9483cca104..840dd9b089 100644 --- a/indra/llui/llslider.cpp +++ b/indra/llui/llslider.cpp @@ -51,6 +51,8 @@ LLSlider::Params::Params() thumb_outline_color("thumb_outline_color"), thumb_center_color("thumb_center_color"), thumb_image("thumb_image"), + thumb_image_pressed("thumb_image_pressed"), + thumb_image_disabled("thumb_image_disabled"), track_image("track_image"), track_highlight_image("track_highlight_image"), mouse_down_callback("mouse_down_callback"), @@ -66,6 +68,8 @@ LLSlider::LLSlider(const LLSlider::Params& p) mThumbOutlineColor(p.thumb_outline_color()), mThumbCenterColor(p.thumb_center_color()), mThumbImage(p.thumb_image), + mThumbImagePressed(p.thumb_image_pressed), + mThumbImageDisabled(p.thumb_image_disabled), mTrackImage(p.track_image), mTrackHighlightImage(p.track_highlight_image) { @@ -245,10 +249,6 @@ void LLSlider::draw() // drawing solids requires texturing be disabled gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - F32 opacity = getEnabled() ? 1.f : 0.3f; - LLColor4 center_color = (mThumbCenterColor.get() % opacity); - LLColor4 track_color = (mTrackColor.get() % opacity); - // Track LLRect track_rect(mThumbImage->getWidth() / 2, getLocalRect().getCenterY() + (mTrackImage->getHeight() / 2), @@ -259,18 +259,38 @@ void LLSlider::draw() mTrackHighlightImage->draw(highlight_rect); // Thumb - if( hasMouseCapture() ) - { - // Show ghost where thumb was before dragging began. - mThumbImage->draw(mDragStartThumbRect, mThumbCenterColor.get() % 0.3f); - } if (hasFocus()) { // Draw focus highlighting. mThumbImage->drawBorder(mThumbRect, gFocusMgr.getFocusColor(), gFocusMgr.getFocusFlashWidth()); } - // Fill in the thumb. - mThumbImage->draw(mThumbRect, hasMouseCapture() ? mThumbOutlineColor.get() : center_color); + if( hasMouseCapture() ) // currently clicking on slider + { + // Show ghost where thumb was before dragging began. + if (mThumbImage.notNull()) + { + mThumbImage->draw(mDragStartThumbRect, mThumbCenterColor.get() % 0.3f); + } + if (mThumbImagePressed.notNull()) + { + mThumbImagePressed->draw(mThumbRect, mThumbOutlineColor); + } + } + else if (!isInEnabledChain()) + { + if (mThumbImageDisabled.notNull()) + { + mThumbImageDisabled->draw(mThumbRect, mThumbCenterColor); + } + } + else + { + if (mThumbImage.notNull()) + { + mThumbImage->draw(mThumbRect, mThumbCenterColor); + } + } + LLUICtrl::draw(); } |