summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-09-28 21:40:32 -0700
committerMerov Linden <merov@lindenlab.com>2014-09-28 21:40:32 -0700
commit4b80a5ed059d91bc37558db8ed664365e39d21d6 (patch)
tree55cfddc381448a72b54c03347deabada9687f629 /indra/llui
parent896f48229e577b1bcf94f2cb80d73a6bf1a9330c (diff)
parent499f5aa9a4b46d61ee94b26d5c86bc032766af70 (diff)
Pull merge from lindenlab/viewer-release
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llfolderview.cpp3
-rw-r--r--indra/llui/llfolderviewitem.cpp30
-rw-r--r--indra/llui/llfolderviewitem.h1
-rwxr-xr-xindra/llui/lllineeditor.cpp1
-rwxr-xr-xindra/llui/llstatgraph.cpp3
-rwxr-xr-xindra/llui/lltextbase.cpp17
-rwxr-xr-xindra/llui/lltexteditor.cpp1
-rwxr-xr-xindra/llui/llui.h1
8 files changed, 42 insertions, 15 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 244957fc5a..72422cf427 100755
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -1370,7 +1370,8 @@ BOOL LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc
}
}
- const std::string current_item_label(search_item->getViewModelItem()->getSearchableName());
+ std::string current_item_label(search_item->getViewModelItem()->getSearchableName());
+ LLStringUtil::toUpper(current_item_label);
S32 search_string_length = llmin(upper_case_string.size(), current_item_label.size());
if (!current_item_label.compare(0, search_string_length, upper_case_string))
{
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 942dd76af9..8e5f0b97f5 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -258,6 +258,24 @@ BOOL LLFolderViewItem::passedFilter(S32 filter_generation)
return getViewModelItem()->passedFilter(filter_generation);
}
+BOOL LLFolderViewItem::isPotentiallyVisible(S32 filter_generation)
+{
+ // Item should be visible if:
+ // 1. item passed current filter
+ // 2. item was updated (gen < 0) but has descendants that passed filter
+ // 3. item was recently updated and was visible before update
+
+ LLFolderViewModelItem* model = getViewModelItem();
+ if (model->getLastFilterGeneration() < 0 && !getFolderViewModel()->getFilter().isModified())
+ {
+ return model->descendantsPassedFilter(filter_generation) || getVisible();
+ }
+ else
+ {
+ return model->passedFilter(filter_generation);
+ }
+}
+
void LLFolderViewItem::refresh()
{
LLFolderViewModelItem& vmi = *getViewModelItem();
@@ -657,7 +675,7 @@ void LLFolderViewItem::drawOpenFolderArrow(const Params& default_params, const L
//
const S32 TOP_PAD = default_params.item_top_pad;
- if (hasVisibleChildren() || getViewModelItem()->hasChildren())
+ if (hasVisibleChildren())
{
LLUIImage* arrow_image = default_params.folder_arrow_image;
gl_draw_scaled_rotated_image(
@@ -970,7 +988,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
getRoot()->getFolderViewModel()->sort(this);
LL_RECORD_BLOCK_TIME(FTM_ARRANGE);
-
+
// evaluate mHasVisibleChildren
mHasVisibleChildren = false;
if (getViewModelItem()->descendantsPassedFilter())
@@ -981,7 +999,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
for (items_t::iterator iit = mItems.begin(); iit != mItems.end(); ++iit)
{
LLFolderViewItem* itemp = (*iit);
- found = itemp->passedFilter();
+ found = itemp->isPotentiallyVisible();
if (found)
break;
}
@@ -991,7 +1009,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
for (folders_t::iterator fit = mFolders.begin(); fit != mFolders.end(); ++fit)
{
LLFolderViewFolder* folderp = (*fit);
- found = folderp->passedFilter();
+ found = folderp->isPotentiallyVisible();
if (found)
break;
}
@@ -1024,7 +1042,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
for(folders_t::iterator fit = mFolders.begin(); fit != mFolders.end(); ++fit)
{
LLFolderViewFolder* folderp = (*fit);
- folderp->setVisible(folderp->passedFilter()); // passed filter or has descendants that passed filter
+ folderp->setVisible(folderp->isPotentiallyVisible());
if (folderp->getVisible())
{
@@ -1043,7 +1061,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
iit != mItems.end(); ++iit)
{
LLFolderViewItem* itemp = (*iit);
- itemp->setVisible(itemp->passedFilter());
+ itemp->setVisible(itemp->isPotentiallyVisible());
if (itemp->getVisible())
{
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index ffeaf0d1b7..4c2bb09cc5 100644
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -256,6 +256,7 @@ public:
S32 getIndentation() { return mIndentation; }
virtual BOOL passedFilter(S32 filter_generation = -1);
+ virtual BOOL isPotentiallyVisible(S32 filter_generation = -1);
// refresh information from the object being viewed.
virtual void refresh();
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index b09c927782..45f4272aa7 100755
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -254,6 +254,7 @@ void LLLineEditor::onCommit()
setControlValue(getValue());
LLUICtrl::onCommit();
+ resetDirty();
// Selection on commit needs to be turned off when evaluating maths
// expressions, to allow indication of the error position
diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp
index a44bc18733..98962aff9a 100755
--- a/indra/llui/llstatgraph.cpp
+++ b/indra/llui/llstatgraph.cpp
@@ -44,9 +44,10 @@ LLStatGraph::LLStatGraph(const Params& p)
: LLView(p),
mMin(p.min),
mMax(p.max),
- mPerSec(true),
+ mPerSec(p.per_sec),
mPrecision(p.precision),
mValue(p.value),
+ mUnits(p.units),
mNewStatFloatp(p.stat.count_stat_float)
{
setToolTip(p.name());
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 71db0ac030..9b125a85b9 100755
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1307,14 +1307,14 @@ void LLTextBase::replaceWithSuggestion(U32 index)
if ( (it->first <= (U32)mCursorPos) && (it->second >= (U32)mCursorPos) )
{
deselect();
-
- // Delete the misspelled word
- removeStringNoUndo(it->first, it->second - it->first);
-
// Insert the suggestion in its place
LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]);
insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index]));
+ // Delete the misspelled word
+ removeStringNoUndo(it->first + (S32)suggestion.length(), it->second - it->first);
+
+
setCursorPos(it->first + (S32)suggestion.length());
break;
@@ -2381,7 +2381,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round,
// binary search for line that starts before local_y
line_list_t::const_iterator line_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), doc_y, compare_bottom());
- if (line_iter == mLineInfoList.end())
+ if (!mLineInfoList.size() || line_iter == mLineInfoList.end())
{
return getLength(); // past the end
}
@@ -2473,7 +2473,6 @@ LLRect LLTextBase::getDocRectFromDocIndex(S32 pos) const
// clamp pos to valid values
pos = llclamp(pos, 0, mLineInfoList.back().mDocIndexEnd - 1);
- // find line that contains cursor
line_list_t::const_iterator line_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), pos, line_end_compare());
doc_rect.mLeft = line_iter->mRect.mLeft;
@@ -2649,6 +2648,12 @@ void LLTextBase::changeLine( S32 delta )
LLRect visible_region = getVisibleDocumentRect();
S32 new_cursor_pos = getDocIndexFromLocalCoord(mDesiredXPixel,
mLineInfoList[new_line].mRect.mBottom + mVisibleTextRect.mBottom - visible_region.mBottom, TRUE);
+ S32 actual_line = getLineNumFromDocIndex(new_cursor_pos);
+ if (actual_line != new_line)
+ {
+ // line edge, correcting position by 1 to move onto proper line
+ new_cursor_pos += new_line - actual_line;
+ }
setCursorPos(new_cursor_pos, true);
}
}
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 576e8f7600..cf5fdef539 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1126,7 +1126,6 @@ void LLTextEditor::addChar(llwchar wc)
}
}
-
void LLTextEditor::addLineBreakChar(BOOL group_together)
{
if( !getEnabled() )
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index b162f25887..c727f75c4f 100755
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -86,6 +86,7 @@ enum EAcceptance
{
ACCEPT_POSTPONED, // we are asynchronously determining acceptance
ACCEPT_NO, // Uninformative, general purpose denial.
+ ACCEPT_NO_CUSTOM, // Denial with custom message.
ACCEPT_NO_LOCKED, // Operation would be valid, but permissions are set to disallow it.
ACCEPT_YES_COPY_SINGLE, // We'll take a copy of a single item
ACCEPT_YES_SINGLE, // Accepted. OK to drag and drop single item here.