Automated merge with ssh://rick@hg.lindenlab.com/viewer/viewer-2-0/

meow-7.2.2
Rick Pasetto 2009-11-11 16:14:19 -08:00
commit 4a376104f1
4 changed files with 69 additions and 29 deletions

View File

@ -71,7 +71,8 @@ LLScrollListCell* LLScrollListCell::create(const LLScrollListCell::Params& cell_
LLScrollListCell::LLScrollListCell(const LLScrollListCell::Params& p)
: mWidth(p.width)
: mWidth(p.width),
mToolTip(p.tool_tip)
{}
// virtual
@ -204,12 +205,27 @@ BOOL LLScrollListText::isText() const
return TRUE;
}
BOOL LLScrollListText::needsToolTip() const
// virtual
const std::string &LLScrollListText::getToolTip() const
{
// show tooltips for truncated text
return mFont->getWidth(mText.getString()) > getWidth();
// If base class has a tooltip, return that
if (! LLScrollListCell::getToolTip().empty())
return LLScrollListCell::getToolTip();
// ...otherwise, return the value itself as the tooltip
return mText.getString();
}
// virtual
BOOL LLScrollListText::needsToolTip() const
{
// If base class has a tooltip, return that
if (LLScrollListCell::needsToolTip())
return LLScrollListCell::needsToolTip();
// ...otherwise, show tooltips for truncated text
return mFont->getWidth(mText.getString()) > getWidth();
}
//virtual
BOOL LLScrollListText::getVisible() const

View File

@ -66,6 +66,7 @@ public:
Optional<void*> userdata;
Optional<LLSD> value;
Optional<std::string> tool_tip;
Optional<const LLFontGL*> font;
Optional<LLColor4> font_color;
@ -80,6 +81,7 @@ public:
enabled("enabled", true),
visible("visible", true),
value("value"),
tool_tip("tool_tip", ""),
font("font", LLFontGL::getFontSansSerifSmall()),
font_color("font_color", LLColor4::black),
color("color", LLColor4::white),
@ -101,11 +103,13 @@ public:
virtual S32 getHeight() const { return 0; }
virtual const LLSD getValue() const;
virtual void setValue(const LLSD& value) { }
virtual const std::string &getToolTip() const { return mToolTip; }
virtual void setToolTip(const std::string &str) { mToolTip = str; }
virtual BOOL getVisible() const { return TRUE; }
virtual void setWidth(S32 width) { mWidth = width; }
virtual void highlightText(S32 offset, S32 num_chars) {}
virtual BOOL isText() const { return FALSE; }
virtual BOOL needsToolTip() const { return FALSE; }
virtual BOOL needsToolTip() const { return ! mToolTip.empty(); }
virtual void setColor(const LLColor4&) {}
virtual void onCommit() {};
@ -114,6 +118,7 @@ public:
private:
S32 mWidth;
std::string mToolTip;
};
class LLScrollListSpacer : public LLScrollListCell
@ -143,6 +148,7 @@ public:
/*virtual*/ void setColor(const LLColor4&);
/*virtual*/ BOOL isText() const;
/*virtual*/ const std::string & getToolTip() const;
/*virtual*/ BOOL needsToolTip() const;
void setText(const LLStringExplicit& text);

View File

@ -1565,7 +1565,7 @@ BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, MASK mask)
// display tooltip exactly over original cell, in same font
LLToolTipMgr::instance().show(LLToolTip::Params()
.message(hit_cell->getValue().asString())
.message(hit_cell->getToolTip())
.font(LLFontGL::getFontSansSerifSmall())
.pos(LLCoordGL(sticky_rect.mLeft - 5, sticky_rect.mTop + 6))
.delay_time(0.2f)

View File

@ -118,21 +118,33 @@ LLPanelPrimMediaControls::~LLPanelPrimMediaControls()
BOOL LLPanelPrimMediaControls::postBuild()
{
LLButton* scroll_up_ctrl = getChild<LLButton>("scrollup");
scroll_up_ctrl->setClickedCallback(onScrollUp, this);
scroll_up_ctrl->setHeldDownCallback(onScrollUpHeld, this);
scroll_up_ctrl->setMouseUpCallback(onScrollStop, this);
if (scroll_up_ctrl)
{
scroll_up_ctrl->setClickedCallback(onScrollUp, this);
scroll_up_ctrl->setHeldDownCallback(onScrollUpHeld, this);
scroll_up_ctrl->setMouseUpCallback(onScrollStop, this);
}
LLButton* scroll_left_ctrl = getChild<LLButton>("scrollleft");
scroll_left_ctrl->setClickedCallback(onScrollLeft, this);
scroll_left_ctrl->setHeldDownCallback(onScrollLeftHeld, this);
scroll_left_ctrl->setMouseUpCallback(onScrollStop, this);
if (scroll_left_ctrl)
{
scroll_left_ctrl->setClickedCallback(onScrollLeft, this);
scroll_left_ctrl->setHeldDownCallback(onScrollLeftHeld, this);
scroll_left_ctrl->setMouseUpCallback(onScrollStop, this);
}
LLButton* scroll_right_ctrl = getChild<LLButton>("scrollright");
scroll_right_ctrl->setClickedCallback(onScrollRight, this);
scroll_right_ctrl->setHeldDownCallback(onScrollRightHeld, this);
scroll_right_ctrl->setMouseUpCallback(onScrollStop, this);
if (scroll_right_ctrl)
{
scroll_right_ctrl->setClickedCallback(onScrollRight, this);
scroll_right_ctrl->setHeldDownCallback(onScrollRightHeld, this);
scroll_right_ctrl->setMouseUpCallback(onScrollStop, this);
}
LLButton* scroll_down_ctrl = getChild<LLButton>("scrolldown");
scroll_down_ctrl->setClickedCallback(onScrollDown, this);
scroll_down_ctrl->setHeldDownCallback(onScrollDownHeld, this);
scroll_down_ctrl->setMouseUpCallback(onScrollStop, this);
if (scroll_down_ctrl)
{
scroll_down_ctrl->setClickedCallback(onScrollDown, this);
scroll_down_ctrl->setHeldDownCallback(onScrollDownHeld, this);
scroll_down_ctrl->setMouseUpCallback(onScrollStop, this);
}
LLUICtrl* media_address = getChild<LLUICtrl>("media_address");
media_address->setFocusReceivedCallback(boost::bind(&LLPanelPrimMediaControls::onInputURL, _1, this ));
@ -326,11 +338,14 @@ void LLPanelPrimMediaControls::updateShape()
whitelist_icon->setVisible(false);
secure_lock_icon->setVisible(false);
scroll_up_ctrl->setVisible(false);
scroll_left_ctrl->setVisible(false);
scroll_right_ctrl->setVisible(false);
scroll_down_ctrl->setVisible(false);
// media_panel_scroll->setVisible(false);
if (media_panel_scroll)
{
media_panel_scroll->setVisible(false);
scroll_up_ctrl->setVisible(false);
scroll_left_ctrl->setVisible(false);
scroll_right_ctrl->setVisible(false);
scroll_down_ctrl->setVisible(false);
}
F32 volume = media_impl->getVolume();
// movie's url changed
@ -422,12 +437,15 @@ void LLPanelPrimMediaControls::updateShape()
volume_ctrl->setEnabled(FALSE);
volume_up_ctrl->setEnabled(FALSE);
volume_down_ctrl->setEnabled(FALSE);
scroll_up_ctrl->setVisible(has_focus);
scroll_left_ctrl->setVisible(has_focus);
scroll_right_ctrl->setVisible(has_focus);
scroll_down_ctrl->setVisible(has_focus);
// media_panel_scroll->setVisible(has_focus);
if (media_panel_scroll)
{
media_panel_scroll->setVisible(has_focus);
scroll_up_ctrl->setVisible(has_focus);
scroll_left_ctrl->setVisible(has_focus);
scroll_right_ctrl->setVisible(has_focus);
scroll_down_ctrl->setVisible(has_focus);
}
// TODO: get the secure lock bool from media plug in
std::string prefix = std::string("https://");
std::string test_prefix = mCurrentURL.substr(0, prefix.length());