summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorYchebotarev ProductEngine <ychebotarev@productengine.com>2010-01-19 17:13:21 +0200
committerYchebotarev ProductEngine <ychebotarev@productengine.com>2010-01-19 17:13:21 +0200
commit82de841c52357642d30b6d89b11da079f9c0f5d1 (patch)
tree8ed3ec82392b6afd2ddf2023035fdfa45cd74c0b /indra/llui
parent4610e911c959cdd21728822ae80b9e717ccd3012 (diff)
parent00c05a885fb1cbee967065798f57d74bf47f2478 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llflatlistview.cpp9
-rw-r--r--indra/llui/llfloater.cpp6
-rw-r--r--indra/llui/llfloater.h3
-rw-r--r--indra/llui/llmenugl.cpp2
-rw-r--r--indra/llui/llscrollcontainer.cpp5
-rw-r--r--indra/llui/lltextbase.cpp14
-rw-r--r--indra/llui/lluictrl.cpp16
-rw-r--r--indra/llui/llurlentry.cpp2
-rw-r--r--indra/llui/tests/llurlentry_test.cpp20
9 files changed, 49 insertions, 28 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index 9cfc67af14..3694ecd4f4 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -711,19 +711,12 @@ void LLFlatListView::selectLastItem ()
void LLFlatListView::ensureSelectedVisible()
{
- LLRect visible_rc = getVisibleContentRect();
LLRect selected_rc = getLastSelectedItemRect();
- if ( !visible_rc.contains (selected_rc) )
+ if ( selected_rc.isValid() )
{
- // But scroll in Items panel coordinates
scrollToShowRect(selected_rc);
}
-
- // In case we are in accordion tab notify parent to show selected rectangle
- LLRect screen_rc;
- localRectToScreen(selected_rc, &screen_rc);
- notifyParent(LLSD().with("scrollToShowRect",screen_rc.getValue()));
}
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 194325cc20..3734a22f7e 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -233,6 +233,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
mAutoFocus(TRUE), // automatically take focus when opened
mCanDock(false),
mDocked(false),
+ mTornOff(false),
mHasBeenDraggedWhileMinimized(FALSE),
mPreviousMinimizedBottom(0),
mPreviousMinimizedLeft(0)
@@ -1456,6 +1457,7 @@ void LLFloater::onClickTearOff(LLFloater* self)
}
self->setTornOff(false);
}
+ self->updateButtons();
}
// static
@@ -1748,8 +1750,8 @@ void LLFloater::updateButtons()
if (i == BUTTON_HELP)
{
// don't show the help button if the floater is minimized
- // or if it is a tear-off hosted floater
- if (isMinimized() || mButtonsEnabled[BUTTON_TEAR_OFF])
+ // or if it is a docked tear-off floater
+ if (isMinimized() || (mButtonsEnabled[BUTTON_TEAR_OFF] && ! mTornOff))
{
enabled = false;
}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index daf558de24..f70495c0f0 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -256,7 +256,7 @@ public:
bool isDocked() const { return mDocked; }
virtual void setDocked(bool docked, bool pop_on_undock = true);
- virtual void setTornOff(bool torn_off) {}
+ virtual void setTornOff(bool torn_off) { mTornOff = torn_off; }
// Return a closeable floater, if any, given the current focus.
static LLFloater* getClosableFloaterFromFocus();
@@ -387,6 +387,7 @@ private:
bool mCanDock;
bool mDocked;
+ bool mTornOff;
static LLMultiFloater* sHostp;
static BOOL sQuitting;
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 21f3f15739..c172a2b714 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -99,7 +99,7 @@ const S32 TEAROFF_SEPARATOR_HEIGHT_PIXELS = 10;
const S32 MENU_ITEM_PADDING = 4;
const std::string BOOLEAN_TRUE_PREFIX( "\xE2\x9C\x94" ); // U+2714 HEAVY CHECK MARK
-const std::string BRANCH_SUFFIX( ">" );
+const std::string BRANCH_SUFFIX( "\xE2\x96\xB6" ); // U+25B6 BLACK RIGHT-POINTING TRIANGLE
const std::string ARROW_UP ("^^^^^^^");
const std::string ARROW_DOWN("vvvvvvv");
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index a5e47e8547..94465a67ce 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -668,6 +668,11 @@ void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLRect& const
// propagate scroll to document
updateScroll();
+
+ // In case we are in accordion tab notify parent to show selected rectangle
+ LLRect screen_rc;
+ localRectToScreen(rect_to_constrain, &screen_rc);
+ notifyParent(LLSD().with("scrollToShowRect",screen_rc.getValue()));
}
void LLScrollContainer::pageUp(S32 overlap)
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 5ebf49c488..17aecaf32f 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -346,7 +346,8 @@ void LLTextBase::drawSelectionBackground()
S32 segment_line_start = segmentp->getStart() + segment_offset;
S32 segment_line_end = llmin(segmentp->getEnd(), line_iter->mDocIndexEnd);
- S32 segment_width, segment_height;
+ S32 segment_width = 0;
+ S32 segment_height = 0;
// if selection after beginning of segment
if(selection_left >= segment_line_start)
@@ -433,7 +434,8 @@ void LLTextBase::drawCursor()
if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection())
{
- S32 segment_width, segment_height;
+ S32 segment_width = 0;
+ S32 segment_height = 0;
segmentp->getDimensions(mCursorPos - segmentp->getStart(), 1, segment_width, segment_height);
S32 width = llmax(CURSOR_THICKNESS, segment_width);
cursor_rect.mRight = cursor_rect.mLeft + width;
@@ -2443,10 +2445,12 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip)
bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const
{
- height = mFontHeight;
+ height = 0;
+ width = 0;
bool force_newline = false;
if (num_chars > 0)
{
+ height = mFontHeight;
LLWString text = mEditor.getWText();
// if last character is a newline, then return true, forcing line break
llwchar last_char = text[mStart + first_char + num_chars - 1];
@@ -2461,10 +2465,6 @@ bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt
width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars);
}
}
- else
- {
- width = 0;
- }
LLUIImagePtr image = mStyle->getImage();
if( image.notNull())
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index f016c0af89..3ade46d367 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -868,14 +868,6 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out)
if (panel)
{
- // does the panel have an active tab with a help topic?
- LLPanel *tab = panel->childGetVisibleTabWithHelp();
- if (tab)
- {
- help_topic_out = tab->getHelpTopic();
- return true; // success (tab)
- }
-
// does the panel have a sub-panel with a help topic?
LLPanel *subpanel = panel->childGetVisiblePanelWithHelp();
if (subpanel)
@@ -884,6 +876,14 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out)
return true; // success (subpanel)
}
+ // does the panel have an active tab with a help topic?
+ LLPanel *tab = panel->childGetVisibleTabWithHelp();
+ if (tab)
+ {
+ help_topic_out = tab->getHelpTopic();
+ return true; // success (tab)
+ }
+
// otherwise, does the panel have a help topic itself?
if (!panel->getHelpTopic().empty())
{
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 1b6dd1b264..4927e57a52 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -204,7 +204,7 @@ LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol()
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
+ "(?<!@)\\b[^[:space:]:@/]+\\.(?:com|net|edu|org)([/:]\\S*)?\\b" // i.e. FOO.net
")",
boost::regex::perl|boost::regex::icase);
mMenuName = "menu_url_http.xml";
diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index 38cf7124ce..80be8fcbf7 100644
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -571,6 +571,26 @@ namespace tut
"MIT web site is at web.mit.edu and also www.mit.edu",
"web.mit.edu");
+ testRegex("don't match e-mail addresses", r,
+ "test@lindenlab.com",
+ "");
+
+ testRegex(".com URL with path", r,
+ "see secondlife.com/status for grid status",
+ "secondlife.com/status");
+
+ testRegex(".com URL with port", r,
+ "secondlife.com:80",
+ "secondlife.com:80");
+
+ testRegex(".com URL with port and path", r,
+ "see secondlife.com:80/status",
+ "secondlife.com:80/status");
+
+ testRegex("www.*.com URL with port and path", r,
+ "see www.secondlife.com:80/status",
+ "www.secondlife.com:80/status");
+
testRegex("invalid .com URL [1]", r,
"..com",
"");