summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-01-06 16:38:19 -0800
committerLeyla Farazha <leyla@lindenlab.com>2010-01-06 16:38:19 -0800
commit35bb14951f686da538264db349f4bfbe045b8c82 (patch)
tree31d37e3e67863aba03b2c6aef5abc5629a784e65 /indra/llui
parent95f14d73138a4f0eb9163fdc560a0dcad9564c4c (diff)
parente28eac929b8d26d133be5c1953cfdd0b7d0eb9e5 (diff)
Merge
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcheckboxctrl.cpp2
-rw-r--r--indra/llui/llconsole.cpp8
-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/llmenugl.cpp55
-rw-r--r--indra/llui/lltextbase.cpp7
-rw-r--r--indra/llui/llurlentry.cpp8
10 files changed, 87 insertions, 37 deletions
diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp
index cd10dfdb1c..3d32157406 100644
--- a/indra/llui/llcheckboxctrl.cpp
+++ b/indra/llui/llcheckboxctrl.cpp
@@ -107,8 +107,8 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p)
{
tbparams.font(p.font);
}
+ tbparams.text_color( p.enabled() ? p.text_enabled_color() : p.text_disabled_color() );
mLabel = LLUICtrlFactory::create<LLTextBox> (tbparams);
-
addChild(mLabel);
// Button
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index fa0abd55d0..e08d93b232 100644
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -330,7 +330,7 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, b
skip_chars = 0;
}
- U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_end - paragraph_offset, TRUE);
+ U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_end - paragraph_offset, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);
if (drawable != 0)
{
@@ -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/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 2648cbf08d..527c0a1b87 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1143,37 +1143,41 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask )
if (!branch)
return LLMenuItemGL::handleKeyHere(key, mask);
- if (getMenu()->getVisible() && branch->getVisible() && key == KEY_LEFT)
+ // an item is highlighted, my menu is open, and I have an active sub menu or we are in
+ // keyboard navigation mode
+ if (getHighlight()
+ && getMenu()->isOpen()
+ && (isActive() || LLMenuGL::getKeyboardMode()))
{
- // switch to keyboard navigation mode
- LLMenuGL::setKeyboardMode(TRUE);
-
- BOOL handled = branch->clearHoverItem();
- if (branch->getTornOff())
+ if (branch->getVisible() && key == KEY_LEFT)
{
- ((LLFloater*)branch->getParent())->setFocus(FALSE);
- }
- if (handled && getMenu()->getTornOff())
- {
- ((LLFloater*)getMenu()->getParent())->setFocus(TRUE);
- }
- return handled;
- }
+ // switch to keyboard navigation mode
+ LLMenuGL::setKeyboardMode(TRUE);
- if (getHighlight() &&
- getMenu()->isOpen() &&
- key == KEY_RIGHT && !branch->getHighlightedItem())
- {
- // switch to keyboard navigation mode
- LLMenuGL::setKeyboardMode(TRUE);
+ BOOL handled = branch->clearHoverItem();
+ if (branch->getTornOff())
+ {
+ ((LLFloater*)branch->getParent())->setFocus(FALSE);
+ }
+ if (handled && getMenu()->getTornOff())
+ {
+ ((LLFloater*)getMenu()->getParent())->setFocus(TRUE);
+ }
+ return handled;
+ }
- LLMenuItemGL* itemp = branch->highlightNextItem(NULL);
- if (itemp)
+ if (key == KEY_RIGHT && !branch->getHighlightedItem())
{
- return TRUE;
+ // switch to keyboard navigation mode
+ LLMenuGL::setKeyboardMode(TRUE);
+
+ LLMenuItemGL* itemp = branch->highlightNextItem(NULL);
+ if (itemp)
+ {
+ return TRUE;
+ }
}
}
-
return LLMenuItemGL::handleKeyHere(key, mask);
}
@@ -1431,7 +1435,7 @@ BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask)
{
BOOL menu_open = getBranch()->getVisible();
// don't do keyboard navigation of top-level menus unless in keyboard mode, or menu expanded
- if (getHighlight() && getMenu()->getVisible() && (isActive() || LLMenuGL::getKeyboardMode()))
+ if (getHighlight() && getMenu()->isOpen() && (isActive() || LLMenuGL::getKeyboardMode()))
{
if (key == KEY_LEFT)
{
@@ -2836,6 +2840,7 @@ BOOL LLMenuGL::handleScrollWheel( S32 x, S32 y, S32 clicks )
return TRUE;
}
+
void LLMenuGL::draw( void )
{
if (mNeedsArrange)
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 7447a984ac..5ebf49c488 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2509,10 +2509,15 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
// set max characters to length of segment, or to first newline
max_chars = llmin(max_chars, last_char - (mStart + segment_offset));
+ // if no character yet displayed on this line, don't require word wrapping since
+ // we can just move to the next line, otherwise insist on it so we make forward progress
+ LLFontGL::EWordWrapStyle word_wrap_style = (line_offset == 0)
+ ? LLFontGL::WORD_BOUNDARY_IF_POSSIBLE
+ : LLFontGL::ONLY_WORD_BOUNDARIES;
S32 num_chars = mStyle->getFont()->maxDrawableChars(text.c_str() + segment_offset + mStart,
(F32)num_pixels,
max_chars,
- TRUE);
+ word_wrap_style);
if (num_chars == 0
&& line_offset == 0
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");
}