summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llaccordionctrltab.cpp3
-rw-r--r--indra/llui/llflatlistview.cpp9
-rw-r--r--indra/llui/llfloater.cpp21
-rw-r--r--indra/llui/llfloater.h3
-rw-r--r--indra/llui/lllayoutstack.h2
-rw-r--r--indra/llui/llmenugl.cpp2
-rw-r--r--indra/llui/llresizehandle.cpp81
-rw-r--r--indra/llui/llscrollcontainer.cpp5
-rw-r--r--indra/llui/llscrolllistctrl.cpp5
-rw-r--r--indra/llui/llscrolllistctrl.h3
-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
14 files changed, 103 insertions, 83 deletions
diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp
index 9d6ba57c29..4bfe44135a 100644
--- a/indra/llui/llaccordionctrltab.cpp
+++ b/indra/llui/llaccordionctrltab.cpp
@@ -157,7 +157,8 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::draw()
// because the user's mental model of focus is that it goes away after
// the accordion is closed.
if (getParent()->hasFocus()
- && !(collapsible && !expanded))
+ /*&& !(collapsible && !expanded)*/ // WHY??
+ )
{
mImageHeaderFocused->draw(0,0,width,height);
}
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 a17e306325..4f519afa06 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;
}
@@ -2360,7 +2362,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out
LLRect::tCoordType screen_width = getSnapRect().getWidth();
LLRect::tCoordType screen_height = getSnapRect().getHeight();
-
+
// only automatically resize non-minimized, resizable floaters
if( floater->isResizable() && !floater->isMinimized() )
{
@@ -2385,16 +2387,13 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out
new_width = llmax(new_width, min_width);
new_height = llmax(new_height, min_height);
+ LLRect new_rect;
+ new_rect.setLeftTopAndSize(view_rect.mLeft,view_rect.mTop,new_width, new_height);
+
floater->reshape( new_width, new_height, TRUE );
- if (floater->followsRight())
- {
- floater->translate(old_width - new_width, 0);
- }
+ floater->setRect(new_rect);
- if (floater->followsTop())
- {
- floater->translate(0, old_height - new_height);
- }
+ floater->translateIntoRect( getLocalRect(), 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/lllayoutstack.h b/indra/llui/lllayoutstack.h
index aba35773ee..c4f10038f8 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -93,6 +93,8 @@ public:
void updateLayout(BOOL force_resize = FALSE);
S32 getPanelSpacing() const { return mPanelSpacing; }
+ BOOL getAnimate () const { return mAnimate; }
+ void setAnimate (BOOL animate) { mAnimate = animate; }
static void updateClass();
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/llresizehandle.cpp b/indra/llui/llresizehandle.cpp
index 6239a8f721..3df09d124a 100644
--- a/indra/llui/llresizehandle.cpp
+++ b/indra/llui/llresizehandle.cpp
@@ -124,7 +124,7 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask)
{
// Make sure the mouse in still over the application. We don't want to make the parent
// so big that we can't see the resize handle any more.
-
+
S32 screen_x;
S32 screen_y;
localPointToScreen(x, y, &screen_x, &screen_y);
@@ -146,68 +146,61 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask)
LLRect scaled_rect = orig_rect;
S32 delta_x = screen_x - mDragLastScreenX;
S32 delta_y = screen_y - mDragLastScreenY;
+
+ if(delta_x == 0 && delta_y == 0)
+ return FALSE;
+
LLCoordGL mouse_dir;
// use hysteresis on mouse motion to preserve user intent when mouse stops moving
mouse_dir.mX = (screen_x == mLastMouseScreenX) ? mLastMouseDir.mX : screen_x - mLastMouseScreenX;
mouse_dir.mY = (screen_y == mLastMouseScreenY) ? mLastMouseDir.mY : screen_y - mLastMouseScreenY;
+
mLastMouseScreenX = screen_x;
mLastMouseScreenY = screen_y;
mLastMouseDir = mouse_dir;
- S32 x_multiple = 1;
- S32 y_multiple = 1;
- switch( mCorner )
- {
- case LEFT_TOP:
- x_multiple = -1;
- y_multiple = 1;
- break;
- case LEFT_BOTTOM:
- x_multiple = -1;
- y_multiple = -1;
- break;
- case RIGHT_TOP:
- x_multiple = 1;
- y_multiple = 1;
- break;
- case RIGHT_BOTTOM:
- x_multiple = 1;
- y_multiple = -1;
- break;
- }
+ S32 new_width = orig_rect.getWidth();
+ S32 new_height = orig_rect.getHeight();
- S32 new_width = orig_rect.getWidth() + x_multiple * delta_x;
- if( new_width < mMinWidth )
- {
- new_width = mMinWidth;
- delta_x = x_multiple * (mMinWidth - orig_rect.getWidth());
- }
-
- S32 new_height = orig_rect.getHeight() + y_multiple * delta_y;
- if( new_height < mMinHeight )
- {
- new_height = mMinHeight;
- delta_y = y_multiple * (mMinHeight - orig_rect.getHeight());
- }
+ S32 new_pos_x = orig_rect.mLeft;
+ S32 new_pos_y = orig_rect.mTop;
switch( mCorner )
{
- case LEFT_TOP:
- scaled_rect.translate(delta_x, 0);
+ case LEFT_TOP:
+ new_width-=delta_x;
+ new_height+=delta_y;
+ new_pos_x+=delta_x;
+ new_pos_y+=delta_y;
break;
case LEFT_BOTTOM:
- scaled_rect.translate(delta_x, delta_y);
+ new_width-=delta_x;
+ new_height-=delta_y;
+ new_pos_x+=delta_x;
break;
case RIGHT_TOP:
+ new_width+=delta_x;
+ new_height+=delta_y;
+ new_pos_y+=delta_y;
break;
case RIGHT_BOTTOM:
- scaled_rect.translate(0, delta_y);
+ new_width+=delta_x;
+ new_height-=delta_y;
break;
}
+ new_width = llmax(new_width,mMinWidth);
+ new_height = llmax(new_height,mMinHeight);
+
+ LLRect::tCoordType screen_width = resizing_view->getParent()->getSnapRect().getWidth();
+ LLRect::tCoordType screen_height = resizing_view->getParent()->getSnapRect().getHeight();
+
+ new_width = llmin(new_width, screen_width);
+ new_height = llmin(new_height, screen_height);
+
// temporarily set new parent rect
- scaled_rect.mRight = scaled_rect.mLeft + new_width;
- scaled_rect.mTop = scaled_rect.mBottom + new_height;
+ scaled_rect.setLeftTopAndSize(new_pos_x,new_pos_y,new_width,new_height);
+
resizing_view->setRect(scaled_rect);
LLView* snap_view = NULL;
@@ -258,7 +251,11 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask)
resizing_view->setRect(orig_rect);
// translate and scale to new shape
- resizing_view->setShape(scaled_rect, true);
+ resizing_view->reshape(scaled_rect.getWidth(),scaled_rect.getHeight());
+ resizing_view->setRect(scaled_rect);
+ //set shape to handle dependent floaters...
+ resizing_view->handleReshape(scaled_rect, false);
+
// update last valid mouse cursor position based on resized view's actual size
LLRect new_rect = resizing_view->getRect();
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/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index a53a30b501..4e84013db0 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -142,6 +142,7 @@ LLScrollListCtrl::Params::Params()
contents(""),
scroll_bar_bg_visible("scroll_bar_bg_visible"),
scroll_bar_bg_color("scroll_bar_bg_color")
+ , border("border")
{
name = "scroll_list";
mouse_opaque = true;
@@ -231,10 +232,8 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
if (p.has_border)
{
LLRect border_rect = getLocalRect();
- LLViewBorder::Params params;
- params.name("dig border");
+ LLViewBorder::Params params = p.border;
params.rect(border_rect);
- params.bevel_style(LLViewBorder::BEVEL_IN);
mBorder = LLUICtrlFactory::create<LLViewBorder> (params);
addChild(mBorder);
}
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index 78bc60db6e..907dc90bea 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -51,6 +51,7 @@
#include "lldate.h"
#include "llscrolllistitem.h"
#include "llscrolllistcolumn.h"
+#include "llviewborder.h"
class LLScrollListCell;
class LLTextBox;
@@ -109,6 +110,8 @@ public:
scroll_bar_bg_color;
Optional<Contents> contents;
+
+ Optional<LLViewBorder::Params> border;
Params();
};
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",
"");