summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2010-01-06 14:29:26 -0500
committerNat Goodspeed <nat@lindenlab.com>2010-01-06 14:29:26 -0500
commit657cbc3b74f0005290faf852e97d697296374566 (patch)
treec37c60962641816531e3d735a79df60b5b067e9b /indra/llui
parent0f89155e295f632187704999d8ecc01f464a88d8 (diff)
parentaf61dd45b3afe8b62dceeb55a2ded7a9cfa34117 (diff)
Merge previously-unmerged product-engine commit
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llconsole.cpp6
-rw-r--r--indra/llui/lldockablefloater.cpp9
-rw-r--r--indra/llui/lldockablefloater.h17
-rw-r--r--indra/llui/lldockcontrol.cpp12
-rw-r--r--indra/llui/llflatlistview.cpp3
-rw-r--r--indra/llui/lllayoutstack.h3
-rw-r--r--indra/llui/llurlentry.cpp8
7 files changed, 49 insertions, 9 deletions
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index fa0abd55d0..c9090d388d 100644
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -392,4 +392,10 @@ void LLConsole::addLine(const LLWString& wline, F32 size, const LLColor4 &color)
Paragraph paragraph(wline, color, mTimer.getElapsedTimeF32(), mFont, (F32)getRect().getWidth() );
mParagraphs.push_back ( paragraph );
+
+ // remove old paragraphs which can't possibly be visible any more. ::draw() will do something similar but more conservative - we do this here because ::draw() isn't guaranteed to ever be called! (i.e. the console isn't visible)
+ while ((S32)mParagraphs.size() > llmax((S32)0, (S32)(mMaxLines)))
+ {
+ mParagraphs.pop_front();
+ }
}
diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp
index 6a5b475134..74438b184a 100644
--- a/indra/llui/lldockablefloater.cpp
+++ b/indra/llui/lldockablefloater.cpp
@@ -57,6 +57,7 @@ LLDockableFloater::LLDockableFloater(LLDockControl* dockControl,
, mOverlapsScreenChannel(false)
{
init(this);
+ mUseTongue = true;
}
LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, bool uniqueDocking,
@@ -64,6 +65,14 @@ LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, bool uniqueDock
LLFloater(key, params), mDockControl(dockControl), mUniqueDocking(uniqueDocking)
{
init(this);
+ mUseTongue = true;
+}
+
+LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, bool uniqueDocking,
+ bool useTongue, const LLSD& key, const Params& params) :
+ LLFloater(key, params), mDockControl(dockControl), mUseTongue(useTongue), mUniqueDocking(uniqueDocking)
+{
+ init(this);
}
LLDockableFloater::~LLDockableFloater()
diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h
index ae4f99e205..2b1ce99ae2 100644
--- a/indra/llui/lldockablefloater.h
+++ b/indra/llui/lldockablefloater.h
@@ -62,6 +62,20 @@ public:
*/
LLDockableFloater(LLDockControl* dockControl, bool uniqueDocking,
const LLSD& key, const Params& params = getDefaultParams());
+
+ /**
+ * Constructor.
+ * @param dockControl a pointer to the doc control instance
+ * @param uniqueDocking - a flag defines is docking should work as tab(at one
+ * moment only one docked floater can be shown).
+ * @praram useTongue - a flag defines is dock tongue should be used.
+ * @params key a floater key.
+ * @params params a floater parameters
+ */
+ LLDockableFloater(LLDockControl* dockControl, bool uniqueDocking,
+ bool useTongue, const LLSD& key,
+ const Params& params = getDefaultParams());
+
virtual ~LLDockableFloater();
static LLHandle<LLFloater> getInstanceHandle() { return sInstanceHandle; }
@@ -104,6 +118,7 @@ public:
virtual void setOverlapsScreenChannel(bool overlaps) { mOverlapsScreenChannel = overlaps; }
bool getUniqueDocking() { return mUniqueDocking; }
+ bool getUseTongue() { return mUseTongue; }
private:
/**
* Provides unique of dockable floater.
@@ -125,6 +140,8 @@ private:
*/
bool mUniqueDocking;
+ bool mUseTongue;
+
bool mOverlapsScreenChannel;
};
diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp
index 1c3c8449c5..0d8e54aa48 100644
--- a/indra/llui/lldockcontrol.cpp
+++ b/indra/llui/lldockcontrol.cpp
@@ -182,12 +182,12 @@ void LLDockControl::moveDockable()
LLRect rootRect;
mGetAllowedRectCallback(rootRect);
- bool unique_docking = false;
+ bool use_tongue = false;
LLDockableFloater* dockable_floater =
dynamic_cast<LLDockableFloater*> (mDockableFloater);
if (dockable_floater != NULL)
{
- unique_docking = dockable_floater->getUniqueDocking();
+ use_tongue = dockable_floater->getUseTongue();
}
LLRect dockableRect = mDockableFloater->calcScreenRect();
@@ -218,7 +218,7 @@ void LLDockControl::moveDockable()
x = dockRect.getCenterX() - dockableRect.getWidth() / 2;
y = dockRect.mTop + dockableRect.getHeight();
// unique docking used with dock tongue, so add tongue height o the Y coordinate
- if (unique_docking)
+ if (use_tongue)
{
y += mDockTongue->getHeight();
}
@@ -287,15 +287,15 @@ void LLDockControl::forceRecalculatePosition()
void LLDockControl::drawToungue()
{
- bool unique_docking = false;
+ bool use_tongue = false;
LLDockableFloater* dockable_floater =
dynamic_cast<LLDockableFloater*> (mDockableFloater);
if (dockable_floater != NULL)
{
- unique_docking = dockable_floater->getUniqueDocking();
+ use_tongue = dockable_floater->getUseTongue();
}
- if (mEnabled && unique_docking)
+ if (mEnabled && use_tongue)
{
mDockTongue->draw(mDockTongueX, mDockTongueY);
}
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index 3754d155cf..9cfc67af14 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -906,7 +906,8 @@ void LLFlatListView::notifyParentItemsRectChanged()
params["width"] = req_rect.getWidth();
params["height"] = req_rect.getHeight();
- getParent()->notifyParent(params);
+ if (getParent()) // dummy widgets don't have a parent
+ getParent()->notifyParent(params);
}
void LLFlatListView::setNoItemsCommentVisible(bool visible) const
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index cde383b047..aba35773ee 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -91,6 +91,9 @@ public:
bool getPanelMinSize(const std::string& panel_name, S32* min_widthp, S32* min_heightp);
void updateLayout(BOOL force_resize = FALSE);
+
+ S32 getPanelSpacing() const { return mPanelSpacing; }
+
static void updateClass();
protected:
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 983f0a2d49..f7528bc62a 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -201,8 +201,12 @@ std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string)
//
LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol()
{
- mPattern = boost::regex("(\\bwww\\.\\S+\\.\\S+|\\b[^ \t\n\r\f\v:/]+.com\\S*|\\b[^ \t\n\r\f\v:/]+.net\\S*|\\b[^ \t\n\r\f\v:/]+.edu\\S*|\\b[^ \t\n\r\f\v:/]+.org\\S*)",
- boost::regex::perl|boost::regex::icase);
+ mPattern = boost::regex("("
+ "\\bwww\\.\\S+\\.\\S+" // i.e. www.FOO.BAR
+ "|" // or
+ "\\b[^ \\t\\n\\r\\f\\v:/]+\\.(?:com|net|edu|org)[^[:space:][:alnum:]]*\\>" // i.e. FOO.net
+ ")",
+ boost::regex::perl|boost::regex::icase);
mMenuName = "menu_url_http.xml";
mTooltip = LLTrans::getString("TooltipHttpUrl");
}