diff options
author | richard <none@none> | 2009-10-30 17:46:01 -0700 |
---|---|---|
committer | richard <none@none> | 2009-10-30 17:46:01 -0700 |
commit | b82bda605d85fe9b1ad69ce36a36de18a2924924 (patch) | |
tree | 813faac1cc247553f5cb32325840fb0b7e87e3da /indra/llui | |
parent | fd1e10a4ca7e32a7f1cfe29637dd994c69625e84 (diff) |
EXT-2018 PRofile "Real World" descripton scrolls before showing "More" link
EXT-2011 titles of IM sessions aren't aligned to center
EXT-3025 Pick's description overlaps picks name
also moved tool tip param default to tool_tip.xml
also made default param<const LLFontGL*> be SansSerif
reviewed by Leyla
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llscrolllistcolumn.cpp | 15 | ||||
-rw-r--r-- | indra/llui/llscrolllistcolumn.h | 15 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 29 | ||||
-rw-r--r-- | indra/llui/lltextbase.h | 3 | ||||
-rw-r--r-- | indra/llui/lltooltip.cpp | 32 | ||||
-rw-r--r-- | indra/llui/lltooltip.h | 15 | ||||
-rw-r--r-- | indra/llui/llui.cpp | 5 | ||||
-rw-r--r-- | indra/llui/llui.h | 14 |
8 files changed, 71 insertions, 57 deletions
diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp index 073e14386f..ba53f84877 100644 --- a/indra/llui/llscrolllistcolumn.cpp +++ b/indra/llui/llscrolllistcolumn.cpp @@ -47,6 +47,21 @@ const S32 MIN_COLUMN_WIDTH = 20; //--------------------------------------------------------------------------- // LLScrollColumnHeader //--------------------------------------------------------------------------- +LLScrollColumnHeader::Params::Params() +: column("column") +{ + name = "column_header"; + image_unselected.name("square_btn_32x128.tga"); + image_selected.name("square_btn_selected_32x128.tga"); + image_disabled.name("square_btn_32x128.tga"); + image_disabled_selected.name("square_btn_selected_32x128.tga"); + image_overlay.name("combobox_arrow.tga"); + image_overlay_alignment("right"); + font_halign = LLFontGL::LEFT; + tab_stop(false); + scale_image(true); +} + LLScrollColumnHeader::LLScrollColumnHeader(const LLScrollColumnHeader::Params& p) : LLButton(p), // use combobox params to steal images diff --git a/indra/llui/llscrolllistcolumn.h b/indra/llui/llscrolllistcolumn.h index 23318fd7c4..5aef6e8e94 100644 --- a/indra/llui/llscrolllistcolumn.h +++ b/indra/llui/llscrolllistcolumn.h @@ -50,20 +50,7 @@ public: { Mandatory<LLScrollListColumn*> column; - Params() - : column("column") - { - name = "column_header"; - image_unselected.name("square_btn_32x128.tga"); - image_selected.name("square_btn_selected_32x128.tga"); - image_disabled.name("square_btn_32x128.tga"); - image_disabled_selected.name("square_btn_selected_32x128.tga"); - image_overlay.name("combobox_arrow.tga"); - image_overlay_alignment("right"); - font_halign = LLFontGL::LEFT; - tab_stop(false); - scale_image(true); - } + Params(); }; LLScrollColumnHeader(const Params&); ~LLScrollColumnHeader(); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 2b1d677ffb..9a26f0b472 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -933,13 +933,16 @@ BOOL LLTextBase::handleToolTip(S32 x, S32 y, MASK mask) void LLTextBase::reshape(S32 width, S32 height, BOOL called_from_parent) { - LLUICtrl::reshape( width, height, called_from_parent ); + if (width != getRect().getWidth() || height != getRect().getHeight()) + { + LLUICtrl::reshape( width, height, called_from_parent ); - // do this first after reshape, because other things depend on - // up-to-date mTextRect - updateRects(); - - needsReflow(); + // do this first after reshape, because other things depend on + // up-to-date mTextRect + updateRects(); + + needsReflow(); + } } void LLTextBase::draw() @@ -1193,11 +1196,10 @@ void LLTextBase::reflow(S32 start_index) //llassert_always(getLocalRectFromDocIndex(mScrollIndex).mBottom == first_char_rect.mBottom); } } - } - - // reset desired x cursor position - updateCursorXPos(); + // reset desired x cursor position + updateCursorXPos(); + } } LLRect LLTextBase::getContentsRect() @@ -2108,9 +2110,12 @@ LLRect LLTextBase::getVisibleDocumentRect() const } else { - // entire document rect when not scrolling + // entire document rect is visible when not scrolling + // but offset according to height of widget LLRect doc_rect = mDocumentView->getLocalRect(); - doc_rect.translate(-mDocumentView->getRect().mLeft, -mDocumentView->getRect().mBottom); + doc_rect.mLeft -= mDocumentView->getRect().mLeft; + // adjust for height of text above widget baseline + doc_rect.mBottom = llmin(0, doc_rect.getHeight() - mTextRect.getHeight()); return doc_rect; } } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 14fd786127..4cca522a23 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -154,6 +154,9 @@ public: LLRect getContentsRect(); LLRect getVisibleDocumentRect() const; + S32 getVPad() { return mVPad; } + S32 getHPad() { return mHPad; } + S32 getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const; LLRect getLocalRectFromDocIndex(S32 pos) const; diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 34501ae080..23c87c7522 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -161,10 +161,7 @@ LLToolTip::Params::Params() web_based_media("web_based_media", false), media_playing("media_playing", false) { - name = "tooltip"; - font = LLFontGL::getFontSansSerif(); - bg_opaque_color = LLUIColorTable::instance().getColor( "ToolTipBgColor" ); - background_visible = true; + chrome = true; } LLToolTip::LLToolTip(const LLToolTip::Params& p) @@ -208,6 +205,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) icon_params.rect = icon_rect; //icon_params.follows.flags = FOLLOWS_LEFT | FOLLOWS_BOTTOM; icon_params.image_unselected(imagep); + icon_params.image_selected(imagep); icon_params.scale_image(true); icon_params.flash_color(icon_params.highlight_color()); mInfoButton = LLUICtrlFactory::create<LLButton>(icon_params); @@ -221,7 +219,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) mTextBox->translate(TOOLTIP_ICON_SIZE + mPadding, 0); } - if (p.time_based_media.isProvided() && p.time_based_media == true) + if (p.time_based_media) { LLButton::Params p_button; p_button.name(std::string("play_media")); @@ -238,17 +236,14 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) { mPlayMediaButton->setCommitCallback(boost::bind(p.click_playmedia_callback())); } - if(p.media_playing.isProvided()) - { - mPlayMediaButton->setToggleState(p.media_playing); - } + mPlayMediaButton->setToggleState(p.media_playing); addChild(mPlayMediaButton); // move text over to fit image in mTextBox->translate(TOOLTIP_PLAYBUTTON_SIZE + mPadding, 0); } - if (p.web_based_media.isProvided() && p.web_based_media == true) + if (p.web_based_media) { LLButton::Params p_w_button; p_w_button.name(std::string("home_page")); @@ -455,7 +450,10 @@ void LLToolTipMgr::show(const std::string& msg) void LLToolTipMgr::show(const LLToolTip::Params& params) { - if (!params.validateBlock()) + // fill in default tooltip params from tool_tip.xml + LLToolTip::Params params_with_defaults(params); + params_with_defaults.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLToolTip>()); + if (!params_with_defaults.validateBlock()) { llwarns << "Could not display tooltip!" << llendl; return; @@ -467,12 +465,12 @@ void LLToolTipMgr::show(const LLToolTip::Params& params) // are we ready to show the tooltip? if (!mToolTipsBlocked // we haven't hit a key, moved the mouse, etc. - && LLUI::getMouseIdleTime() > params.delay_time) // the mouse has been still long enough + && LLUI::getMouseIdleTime() > params_with_defaults.delay_time) // the mouse has been still long enough { - bool tooltip_changed = mLastToolTipParams.message() != params.message() - || mLastToolTipParams.pos() != params.pos() - || mLastToolTipParams.time_based_media() != params.time_based_media() - || mLastToolTipParams.web_based_media() != params.web_based_media(); + bool tooltip_changed = mLastToolTipParams.message() != params_with_defaults.message() + || mLastToolTipParams.pos() != params_with_defaults.pos() + || mLastToolTipParams.time_based_media() != params_with_defaults.time_based_media() + || mLastToolTipParams.web_based_media() != params_with_defaults.web_based_media(); bool tooltip_shown = mToolTip && mToolTip->getVisible() @@ -480,7 +478,7 @@ void LLToolTipMgr::show(const LLToolTip::Params& params) mNeedsToolTip = tooltip_changed || !tooltip_shown; // store description of tooltip for later creation - mNextToolTipParams = params; + mNextToolTipParams = params_with_defaults; } } diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 4a5f60f93d..30d251266c 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -78,16 +78,13 @@ public: visible_time_far; // time for which tooltip is visible while mouse moved away Optional<LLRect> sticky_rect; Optional<const LLFontGL*> font; - - Optional<click_callback_t> click_callback; Optional<LLUIImage*> image; - - - Optional<bool> time_based_media; - Optional<bool> web_based_media; - Optional<bool> media_playing; - Optional<click_callback_t> click_playmedia_callback; - Optional<click_callback_t> click_homepage_callback; + Optional<bool> time_based_media, + web_based_media, + media_playing; + Optional<click_callback_t> click_callback, + click_playmedia_callback, + click_homepage_callback; Optional<S32> max_width; Optional<S32> padding; Optional<bool> wrap; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 48504a1e54..a82e6eb372 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1953,11 +1953,6 @@ namespace LLInitParam } } - if (mData.mValue == NULL) - { - mData.mValue = LLFontGL::getFontDefault(); - } - // default to current value return mData.mValue; } diff --git a/indra/llui/llui.h b/indra/llui/llui.h index efb1b0a36f..5ec07f1941 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -404,6 +404,20 @@ namespace LLInitParam LLUIColor getValueFromBlock() const; }; + // provide a better default for Optional<const LLFontGL*> than NULL + template <> + struct DefaultInitializer<const LLFontGL*> + { + // return reference to a single default instance of T + // built-in types will be initialized to zero, default constructor otherwise + static const LLFontGL* get() + { + static const LLFontGL* sDefaultFont = LLFontGL::getFontDefault(); + return sDefaultFont; + } + }; + + template<> class TypedParam<const LLFontGL*> : public BlockValue<const LLFontGL*> |