diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llaccordionctrl.cpp | 25 | ||||
-rw-r--r-- | indra/llui/llaccordionctrl.h | 15 | ||||
-rw-r--r-- | indra/llui/llaccordionctrltab.cpp | 13 | ||||
-rw-r--r-- | indra/llui/llaccordionctrltab.h | 4 | ||||
-rw-r--r-- | indra/llui/llfloater.cpp | 2 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 4 |
6 files changed, 54 insertions, 9 deletions
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index fc93793ed8..237d42090f 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -68,8 +68,9 @@ LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) , mSelectedTab( NULL ) , mTabComparator( NULL ) , mNoVisibleTabsHelpText(NULL) + , mNoVisibleTabsOrigString(params.no_visible_tabs_text.initial_value().asString()) { - initNoTabsWidget(params.empty_accordion_text); + initNoTabsWidget(params.no_matched_tabs_text); mSingleExpansion = params.single_expansion; if(mFitParent && !mSingleExpansion) @@ -379,7 +380,7 @@ void LLAccordionCtrl::initNoTabsWidget(const LLTextBox::Params& tb_params) { LLTextBox::Params tp = tb_params; tp.rect(getLocalRect()); - mNoVisibleTabsOrigString = tp.initial_value().asString(); + mNoMatchedTabsOrigString = tp.initial_value().asString(); mNoVisibleTabsHelpText = LLUICtrlFactory::create<LLTextBox>(tp, this); } @@ -820,12 +821,30 @@ void LLAccordionCtrl::setFilterSubString(const std::string& filter_string) { LLStringUtil::format_map_t args; args["[SEARCH_TERM]"] = LLURI::escape(filter_string); - std::string text = filter_string.empty() ? LLStringUtil::null : mNoVisibleTabsOrigString; + std::string text = filter_string.empty() ? mNoVisibleTabsOrigString : mNoMatchedTabsOrigString; LLStringUtil::format(text, args); mNoVisibleTabsHelpText->setValue(text); } +const LLAccordionCtrlTab* LLAccordionCtrl::getExpandedTab() const +{ + typedef std::vector<LLAccordionCtrlTab*>::const_iterator tabs_const_iterator; + + const LLAccordionCtrlTab* result = 0; + + for (tabs_const_iterator i = mAccordionTabs.begin(); i != mAccordionTabs.end(); ++i) + { + if ((*i)->isExpanded()) + { + result = *i; + break; + } + } + + return result; +} + S32 LLAccordionCtrl::calcExpandedTabHeight(S32 tab_index /* = 0 */, S32 available_height /* = 0 */) { if(tab_index < 0) diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index fc6f2d896c..3ad5274085 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -78,12 +78,14 @@ public: accordion tabs are responsible for scrolling their content. *NOTE fit_parent works best when combined with single_expansion. Accordion view should implement getRequiredRect() and provide valid height*/ - Optional<LLTextBox::Params> empty_accordion_text; + Optional<LLTextBox::Params> no_matched_tabs_text; + Optional<LLTextBox::Params> no_visible_tabs_text; Params() : single_expansion("single_expansion",false) , fit_parent("fit_parent", false) - , empty_accordion_text("empty_accordion_text") + , no_matched_tabs_text("no_matched_tabs_text") + , no_visible_tabs_text("no_visible_tabs_text") {}; }; @@ -129,6 +131,13 @@ public: */ void setFilterSubString(const std::string& filter_string); + /** + * This method returns the first expanded accordion tab. + * It is expected to be called for accordion which doesn't allow multiple + * tabs to be expanded. Use with care. + */ + const LLAccordionCtrlTab* getExpandedTab() const; + private: void initNoTabsWidget(const LLTextBox::Params& tb_params); void updateNoTabsHelpTextVisibility(); @@ -173,6 +182,8 @@ private: bool mAutoScrolling; F32 mAutoScrollRate; LLTextBox* mNoVisibleTabsHelpText; + + std::string mNoMatchedTabsOrigString; std::string mNoVisibleTabsOrigString; LLAccordionCtrlTab* mSelectedTab; diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 1bc8086a27..54bb328a18 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -968,3 +968,16 @@ BOOL LLAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask) } return LLUICtrl::handleToolTip(x, y, mask); } +BOOL LLAccordionCtrlTab::handleScrollWheel ( S32 x, S32 y, S32 clicks ) +{ + if( LLUICtrl::handleScrollWheel(x,y,clicks)) + { + return TRUE; + } + if( mScrollbar && mScrollbar->getVisible() && mScrollbar->handleScrollWheel( 0, 0, clicks ) ) + { + return TRUE; + } + return FALSE; +} + diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 480b26e130..7bf7eeef8f 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -166,10 +166,12 @@ public: virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); + virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); + virtual bool addChild(LLView* child, S32 tab_group); - bool isExpanded() { return mDisplayChildren; } + bool isExpanded() const { return mDisplayChildren; } S32 getHeaderHeight(); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 341debc9a8..9a56372e68 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -347,7 +347,7 @@ void LLFloater::layoutDragHandle() { rect = getLocalRect(); } - mDragHandle->setRect(rect); + mDragHandle->setShape(rect); updateTitleButtons(); } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 1a4b804ce4..3c6c7d3e82 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2803,13 +2803,13 @@ S32 LLImageTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin { LLUIImagePtr image = mStyle->getImage(); S32 image_width = image->getWidth(); - if(num_pixels>image_width + IMAGE_HPAD) + if(line_offset == 0 || num_pixels>image_width + IMAGE_HPAD) { return 1; } - return 0; } + F32 LLImageTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) { if ( (start >= 0) && (end <= mEnd - mStart)) |