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 | |
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')
-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 | ||||
-rw-r--r-- | indra/newview/llexpandabletextbox.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llexpandabletextbox.h | 10 | ||||
-rw-r--r-- | indra/newview/llpanelpicks.cpp | 8 | ||||
-rw-r--r-- | indra/newview/skins/default/textures/textures.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_pick_list_item.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/expandable_text.xml | 2 |
14 files changed, 86 insertions, 74 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*> diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 48b5fc11b7..7bc48185e6 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -51,7 +51,7 @@ public: /*virtual*/ void getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { // more label always spans width of text box - width = mEditor.getTextRect().getWidth(); + width = mEditor.getTextRect().getWidth() - mEditor.getHPad(); height = llceil(mStyle->getFont()->getLineHeight()); } /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const @@ -153,6 +153,11 @@ void LLExpandableTextBox::LLTextBoxEx::showExpandText() { if (!mExpanderVisible) { + // make sure we're scrolled to top when collapsing + if (mScroller) + { + mScroller->goToTop(); + } // get fully visible lines std::pair<S32, S32> visible_lines = getVisibleLines(true); S32 last_line = visible_lines.second - 1; diff --git a/indra/newview/llexpandabletextbox.h b/indra/newview/llexpandabletextbox.h index d45527aabb..3fe646c29c 100644 --- a/indra/newview/llexpandabletextbox.h +++ b/indra/newview/llexpandabletextbox.h @@ -69,16 +69,6 @@ protected: virtual S32 getVerticalTextDelta(); /** - * Returns text vertical padding - */ - virtual S32 getVPad() { return mVPad; } - - /** - * Returns text horizontal padding - */ - virtual S32 getHPad() { return mHPad; } - - /** * Shows "More" link */ void showExpandText(); diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index aa6909560d..6181531f82 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -73,10 +73,10 @@ LLPanelPicks::LLPanelPicks() mPopupMenu(NULL), mProfilePanel(NULL), mPickPanel(NULL), - mPicksList(NULL) - , mPanelPickInfo(NULL) - , mPanelPickEdit(NULL) - , mOverflowMenu(NULL) + mPicksList(NULL), + mPanelPickInfo(NULL), + mPanelPickEdit(NULL), + mOverflowMenu(NULL) { } diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index f0d27ac11d..9aa73c28d1 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -726,4 +726,7 @@ <texture name="media_panel_bg.png" preload="true" scale_left="9" scale_top="9" scale_right="9" scale_bottom="9" /> <texture name="media_panel_hoverrectangle.png" preload="true" scale_left="9" scale_top="9" scale_right="9" scale_bottom="9" /> + <texture name="square_btn_32x128.tga" scale_left="2" scale_bottom="2" scale_right="126" scale_top="30"/> + <texture name="square_btn_selected_32x128.tga" scale_left="2" scale_bottom="2" scale_right="126" scale_top="30"/> + </textures> diff --git a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml index 1074dd4627..38ea6b6196 100644 --- a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml @@ -57,7 +57,7 @@ use_ellipses="false" width="197" word_wrap="false" /> - <text + <expandable_text follows="top|left|right" font="SansSerifSmall" height="40" diff --git a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml index 319beac291..f59c46b2f5 100644 --- a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml +++ b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml @@ -3,7 +3,7 @@ max_height="300" > <textbox more_label="More" - follows="left|top" + follows="left|top|right" name="text" allow_scroll="true" use_ellipses="true" |