diff options
author | James Cook <james@lindenlab.com> | 2009-10-27 15:01:09 -0700 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-10-27 15:01:09 -0700 |
commit | e018ecf4696aa17c7696c2b8f8bed2ac2d149eae (patch) | |
tree | a1d84bc5babf9ac4ab3173a058f559466433980f /indra/llui/llfloater.cpp | |
parent | 34398aac4b269a8c5d531fd45e48ece366f58b07 (diff) |
EXT-1352 First pass background images for floaters and panels, including pretty header.
Reviewed with Leyla.
Diffstat (limited to 'indra/llui/llfloater.cpp')
-rw-r--r-- | indra/llui/llfloater.cpp | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 021e2e94ac..f80e8df79f 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -219,7 +219,7 @@ void LLFloater::initClass() static LLWidgetNameRegistry::StaticRegistrar sRegisterFloaterParams(&typeid(LLFloater::Params), "floater"); LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) -: LLPanel(), +: LLPanel(p), mDragHandle(NULL), mTitle(p.title), mShortTitle(p.short_title), @@ -1548,26 +1548,42 @@ void LLFloater::draw() shadow_color % alpha, llround(shadow_offset)); - // No transparent windows in simple UI + LLUIImage* image = NULL; + LLColor4 color; if (isBackgroundOpaque()) { - gl_rect_2d( left, top, right, bottom, getBackgroundColor() % alpha ); + // NOTE: image may not be set + image = getBackgroundImage(); + color = getBackgroundColor(); } else { - gl_rect_2d( left, top, right, bottom, getTransparentColor() % alpha ); + image = getTransparentImage(); + color = getTransparentColor(); } - if(hasFocus() - && !getIsChrome() - && !getCurrentTitle().empty()) + if (image) { - static LLUIColor titlebar_focus_color = LLUIColorTable::instance().getColor("TitleBarFocusColor"); + // We're using images for this floater's backgrounds + image->draw(getLocalRect(), UI_VERTEX_COLOR % alpha); + } + else + { + // We're not using images, use old-school flat colors + gl_rect_2d( left, top, right, bottom, color % alpha ); + // draw highlight on title bar to indicate focus. RDW - const LLFontGL* font = LLFontGL::getFontSansSerif(); - LLRect r = getRect(); - gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1, - titlebar_focus_color % alpha, 0, TRUE); + if(hasFocus() + && !getIsChrome() + && !getCurrentTitle().empty()) + { + static LLUIColor titlebar_focus_color = LLUIColorTable::instance().getColor("TitleBarFocusColor"); + + const LLFontGL* font = LLFontGL::getFontSansSerif(); + LLRect r = getRect(); + gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1, + titlebar_focus_color % alpha, 0, TRUE); + } } } @@ -1617,18 +1633,6 @@ void LLFloater::draw() drawChild(focused_child); } - if( isBackgroundVisible() ) - { - // add in a border to improve spacialized visual aclarity ;) - // use lines instead of gl_rect_2d so we can round the edges as per james' recommendation - static LLUIColor focus_border_color = LLUIColorTable::instance().getColor("FloaterFocusBorderColor"); - static LLUIColor unfocus_border_color = LLUIColorTable::instance().getColor("FloaterUnfocusBorderColor"); - LLUI::setLineWidth(1.5f); - LLColor4 outlineColor = gFocusMgr.childHasKeyboardFocus(this) ? focus_border_color : unfocus_border_color; - gl_rect_2d_offset_local(0, getRect().getHeight() + 1, getRect().getWidth() + 1, 0, outlineColor % alpha, -LLPANEL_BORDER_WIDTH, FALSE); - LLUI::setLineWidth(1.f); - } - // update tearoff button for torn off floaters // when last host goes away if (mCanTearOff && !getHost()) |