summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfolderviewmodel.h4
-rw-r--r--indra/llui/llscrollcontainer.cpp50
-rw-r--r--indra/llui/llscrollcontainer.h6
-rw-r--r--indra/llui/llxuiparser.cpp36
4 files changed, 57 insertions, 39 deletions
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index 641241a88c..f71a88c56e 100644
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -147,6 +147,10 @@ public:
virtual const std::string& getDisplayName() const = 0;
virtual const std::string& getSearchableName() const = 0;
+ virtual std::string getSearchableDescription() const = 0;
+ virtual std::string getSearchableCreatorName()const = 0;
+ virtual std::string getSearchableUUIDString() const = 0;
+
virtual LLPointer<LLUIImage> getIcon() const = 0;
virtual LLPointer<LLUIImage> getIconOpen() const { return getIcon(); }
virtual LLPointer<LLUIImage> getIconOverlay() const { return NULL; }
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index f70eebc594..6135cc56ad 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -72,6 +72,7 @@ LLScrollContainer::Params::Params()
hide_scrollbar("hide_scrollbar"),
min_auto_scroll_rate("min_auto_scroll_rate", 100),
max_auto_scroll_rate("max_auto_scroll_rate", 1000),
+ max_auto_scroll_zone("max_auto_scroll_zone", 16),
reserve_scroll_corner("reserve_scroll_corner", false),
size("size", -1)
{}
@@ -88,6 +89,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p)
mReserveScrollCorner(p.reserve_scroll_corner),
mMinAutoScrollRate(p.min_auto_scroll_rate),
mMaxAutoScrollRate(p.max_auto_scroll_rate),
+ mMaxAutoScrollZone(p.max_auto_scroll_zone),
mScrolledView(NULL),
mSize(p.size)
{
@@ -290,8 +292,22 @@ BOOL LLScrollContainer::handleDragAndDrop(S32 x, S32 y, MASK mask,
return TRUE;
}
+bool LLScrollContainer::canAutoScroll(S32 x, S32 y)
+{
+ if (mAutoScrolling)
+ {
+ return true; // already scrolling
+ }
+ return autoScroll(x, y, false);
+}
+
bool LLScrollContainer::autoScroll(S32 x, S32 y)
{
+ return autoScroll(x, y, true);
+}
+
+bool LLScrollContainer::autoScroll(S32 x, S32 y, bool do_scroll)
+{
static LLUICachedControl<S32> scrollbar_size_control ("UIScrollbarSize", 0);
S32 scrollbar_size = (mSize == -1 ? scrollbar_size_control : mSize);
@@ -302,6 +318,8 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y)
screenRectToLocal(getRootView()->getLocalRect(), &screen_local_extents);
LLRect inner_rect_local( 0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0 );
+ // Note: Will also include scrollers as scroll zones, so opposite
+ // scroll zones might have different size due to visible scrollers
if( mScrollbar[HORIZONTAL]->getVisible() )
{
inner_rect_local.mBottom += scrollbar_size;
@@ -316,8 +334,8 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y)
S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
// autoscroll region should take up no more than one third of visible scroller area
- S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, 10);
- S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, 10);
+ S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, (S32)mMaxAutoScrollZone);
+ S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, (S32)mMaxAutoScrollZone);
if( mScrollbar[HORIZONTAL]->getVisible() )
{
@@ -325,8 +343,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y)
left_scroll_rect.mRight = inner_rect_local.mLeft + auto_scroll_region_width;
if( left_scroll_rect.pointInRect( x, y ) && (mScrollbar[HORIZONTAL]->getDocPos() > 0) )
{
- mScrollbar[HORIZONTAL]->setDocPos( mScrollbar[HORIZONTAL]->getDocPos() - auto_scroll_speed );
- mAutoScrolling = TRUE;
+ if (do_scroll)
+ {
+ mScrollbar[HORIZONTAL]->setDocPos(mScrollbar[HORIZONTAL]->getDocPos() - auto_scroll_speed);
+ mAutoScrolling = TRUE;
+ }
scrolling = true;
}
@@ -334,8 +355,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y)
right_scroll_rect.mLeft = inner_rect_local.mRight - auto_scroll_region_width;
if( right_scroll_rect.pointInRect( x, y ) && (mScrollbar[HORIZONTAL]->getDocPos() < mScrollbar[HORIZONTAL]->getDocPosMax()) )
{
- mScrollbar[HORIZONTAL]->setDocPos( mScrollbar[HORIZONTAL]->getDocPos() + auto_scroll_speed );
- mAutoScrolling = TRUE;
+ if (do_scroll)
+ {
+ mScrollbar[HORIZONTAL]->setDocPos(mScrollbar[HORIZONTAL]->getDocPos() + auto_scroll_speed);
+ mAutoScrolling = TRUE;
+ }
scrolling = true;
}
}
@@ -345,8 +369,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y)
bottom_scroll_rect.mTop = inner_rect_local.mBottom + auto_scroll_region_height;
if( bottom_scroll_rect.pointInRect( x, y ) && (mScrollbar[VERTICAL]->getDocPos() < mScrollbar[VERTICAL]->getDocPosMax()) )
{
- mScrollbar[VERTICAL]->setDocPos( mScrollbar[VERTICAL]->getDocPos() + auto_scroll_speed );
- mAutoScrolling = TRUE;
+ if (do_scroll)
+ {
+ mScrollbar[VERTICAL]->setDocPos(mScrollbar[VERTICAL]->getDocPos() + auto_scroll_speed);
+ mAutoScrolling = TRUE;
+ }
scrolling = true;
}
@@ -354,8 +381,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y)
top_scroll_rect.mBottom = inner_rect_local.mTop - auto_scroll_region_height;
if( top_scroll_rect.pointInRect( x, y ) && (mScrollbar[VERTICAL]->getDocPos() > 0) )
{
- mScrollbar[VERTICAL]->setDocPos( mScrollbar[VERTICAL]->getDocPos() - auto_scroll_speed );
- mAutoScrolling = TRUE;
+ if (do_scroll)
+ {
+ mScrollbar[VERTICAL]->setDocPos(mScrollbar[VERTICAL]->getDocPos() - auto_scroll_speed);
+ mAutoScrolling = TRUE;
+ }
scrolling = true;
}
}
diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h
index c4c4d0a136..e6c7891397 100644
--- a/indra/llui/llscrollcontainer.h
+++ b/indra/llui/llscrollcontainer.h
@@ -66,6 +66,7 @@ public:
hide_scrollbar;
Optional<F32> min_auto_scroll_rate,
max_auto_scroll_rate;
+ Optional<U32> max_auto_scroll_zone;
Optional<LLUIColor> bg_color;
Optional<LLScrollbar::callback_t> scroll_callback;
Optional<S32> size;
@@ -114,7 +115,8 @@ public:
virtual void draw();
virtual bool addChild(LLView* view, S32 tab_group = 0);
-
+
+ bool canAutoScroll(S32 x, S32 y);
bool autoScroll(S32 x, S32 y);
S32 getSize() const { return mSize; }
@@ -128,6 +130,7 @@ private:
virtual void scrollHorizontal( S32 new_pos );
virtual void scrollVertical( S32 new_pos );
void updateScroll();
+ bool autoScroll(S32 x, S32 y, bool do_scroll);
void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const;
LLScrollbar* mScrollbar[ORIENTATION_COUNT];
@@ -141,6 +144,7 @@ private:
F32 mAutoScrollRate;
F32 mMinAutoScrollRate;
F32 mMaxAutoScrollRate;
+ U32 mMaxAutoScrollZone;
bool mHideScrollbar;
};
diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp
index 99a0869ce3..138ba8bf02 100644
--- a/indra/llui/llxuiparser.cpp
+++ b/indra/llui/llxuiparser.cpp
@@ -58,10 +58,6 @@ static LLInitParam::Parser::parser_inspect_func_map_t sSimpleXUIInspectFuncs;
const char* NO_VALUE_MARKER = "no_value";
-#ifdef LL_WINDOWS
-const S32 LINE_NUMBER_HERE = 0;
-#endif
-
struct MaxOccursValues : public LLInitParam::TypeValuesHelper<U32, MaxOccursValues>
{
static void declareValues()
@@ -1313,22 +1309,14 @@ bool LLXUIParser::writeSDValue(Parser& parser, const void* val_ptr, name_stack_t
void LLXUIParser::parserWarning(const std::string& message)
{
-#ifdef LL_WINDOWS
- // use Visual Studio friendly formatting of output message for easy access to originating xml
- LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()) << LL_ENDL;
-#else
- Parser::parserWarning(message);
-#endif
+ std::string warning_msg = llformat("%s:\t%s(%d)", message.c_str(), mCurFileName.c_str(), mCurReadNode->getLineNumber());
+ Parser::parserWarning(warning_msg);
}
void LLXUIParser::parserError(const std::string& message)
{
-#ifdef LL_WINDOWS
- // use Visual Studio friendly formatting of output message for easy access to originating xml
- LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()) << LL_ENDL;
-#else
- Parser::parserError(message);
-#endif
+ std::string error_msg = llformat("%s:\t%s(%d)", message.c_str(), mCurFileName.c_str(), mCurReadNode->getLineNumber());
+ Parser::parserError(error_msg);
}
@@ -1641,22 +1629,14 @@ bool LLSimpleXUIParser::processText()
void LLSimpleXUIParser::parserWarning(const std::string& message)
{
-#ifdef LL_WINDOWS
- // use Visual Studio friendly formatting of output message for easy access to originating xml
- LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()) << LL_ENDL;
-#else
- Parser::parserWarning(message);
-#endif
+ std::string warning_msg = llformat("%s:\t%s", message.c_str(), mCurFileName.c_str());
+ Parser::parserWarning(warning_msg);
}
void LLSimpleXUIParser::parserError(const std::string& message)
{
-#ifdef LL_WINDOWS
- // use Visual Studio friendly formatting of output message for easy access to originating xml
- LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()) << LL_ENDL;
-#else
- Parser::parserError(message);
-#endif
+ std::string error_msg = llformat("%s:\t%s", message.c_str(), mCurFileName.c_str());
+ Parser::parserError(error_msg);
}
bool LLSimpleXUIParser::readFlag(Parser& parser, void* val_ptr)