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
master
richard 2009-10-30 17:46:01 -07:00
parent fd1e10a4ca
commit b82bda605d
14 changed files with 86 additions and 74 deletions

View File

@ -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

View File

@ -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();

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;

View File

@ -1953,11 +1953,6 @@ namespace LLInitParam
}
}
if (mData.mValue == NULL)
{
mData.mValue = LLFontGL::getFontDefault();
}
// default to current value
return mData.mValue;
}

View File

@ -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*>

View File

@ -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;

View File

@ -68,16 +68,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
*/

View File

@ -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)
{
}

View File

@ -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>

View File

@ -57,7 +57,7 @@
use_ellipses="false"
width="197"
word_wrap="false" />
<text
<expandable_text
follows="top|left|right"
font="SansSerifSmall"
height="40"

View File

@ -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"