diff options
Diffstat (limited to 'indra/llui/lltooltip.cpp')
-rw-r--r-- | indra/llui/lltooltip.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 6390039794..f737d48abf 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -55,7 +55,7 @@ static LLDefaultChildRegistry::Register<LLToolTipView> register_tooltip_view("to LLToolTipView::Params::Params() { - mouse_opaque = false; + changeDefault(mouse_opaque, false); } LLToolTipView::LLToolTipView(const LLToolTipView::Params& p) @@ -156,7 +156,7 @@ LLToolTip::Params::Params() web_based_media("web_based_media", false), media_playing("media_playing", false) { - chrome = true; + changeDefault(chrome, true); } LLToolTip::LLToolTip(const LLToolTip::Params& p) @@ -180,6 +180,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) params.font = p.font; params.use_ellipses = true; params.wrap = p.wrap; + params.font_valign = LLFontGL::VCENTER; params.parse_urls = false; // disallow hyperlinks in tooltips, as they want to spawn their own explanatory tooltips mTextBox = LLUICtrlFactory::create<LLTextBox> (params); addChild(mTextBox); @@ -190,7 +191,6 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) { LLButton::Params icon_params; icon_params.name = "tooltip_info"; - icon_params.label(""); // provid label but set to empty so name does not overwrite it -angela LLRect icon_rect; LLUIImage* imagep = p.image; TOOLTIP_ICON_SIZE = (imagep ? imagep->getWidth() : 16); @@ -200,7 +200,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) icon_params.image_selected(imagep); icon_params.scale_image(true); - icon_params.flash_color(icon_params.highlight_color()); + icon_params.flash_color.control = "ButtonUnselectedFgColor"; mInfoButton = LLUICtrlFactory::create<LLButton>(icon_params); if (p.click_callback.isProvided()) { @@ -291,6 +291,12 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p) S32 text_width = llmin(p.max_width(), mTextBox->getTextPixelWidth()); S32 text_height = mTextBox->getTextPixelHeight(); mTextBox->reshape(text_width, text_height); + if (mInfoButton) + { + LLRect text_rect = mTextBox->getRect(); + LLRect icon_rect = mInfoButton->getRect(); + mTextBox->translate(0, icon_rect.getCenterY() - text_rect.getCenterY()); + } // reshape tooltip panel to fit text box LLRect tooltip_rect = calcBoundingRect(); @@ -299,6 +305,8 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p) tooltip_rect.mBottom = 0; tooltip_rect.mLeft = 0; + mTextBox->reshape(mTextBox->getRect().getWidth(), llmax(mTextBox->getRect().getHeight(), tooltip_rect.getHeight() - 2 * mPadding)); + setShape(tooltip_rect); } @@ -402,12 +410,12 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params) LLToolTip::Params tooltip_params(params); // block mouse events if there is a click handler registered (specifically, hover) - if (params.click_callback.isProvided()) + if (params.click_callback.isProvided() && !params.mouse_opaque.isProvided()) { // set mouse_opaque to true if it wasn't already set to something else // this prevents mouse down from going "through" the tooltip and ultimately // causing the tooltip to disappear - tooltip_params.mouse_opaque.setIfNotProvided(true); + tooltip_params.mouse_opaque = true; } tooltip_params.rect = LLRect (0, 1, 1, 0); |