From 7632861fc40ffd05b6a1704f629a38250600c294 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 18 Sep 2012 12:54:32 -0400 Subject: STORM-1855: fix performance problem with pasting many lines in script editor --- indra/llui/lltexteditor.cpp | 24 ++++++++++++++++-------- indra/llui/lltexteditor.h | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 144b6960a1..1e3a99c088 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1095,7 +1095,8 @@ void LLTextEditor::addChar(llwchar wc) setCursorPos(mCursorPos + addChar( mCursorPos, wc )); } -void LLTextEditor::addLineBreakChar() + +void LLTextEditor::addLineBreakChar(BOOL group_together) { if( !getEnabled() ) { @@ -1113,7 +1114,7 @@ void LLTextEditor::addLineBreakChar() LLStyleConstSP sp(new LLStyle(LLStyle::Params())); LLTextSegmentPtr segment = new LLLineBreakTextSegment(sp, mCursorPos); - S32 pos = execute(new TextCmdAddChar(mCursorPos, FALSE, '\n', segment)); + S32 pos = execute(new TextCmdAddChar(mCursorPos, group_together, '\n', segment)); setCursorPos(mCursorPos + pos); } @@ -1436,21 +1437,28 @@ void LLTextEditor::pasteHelper(bool is_primary) std::basic_string::size_type start = 0; std::basic_string::size_type pos = clean_string.find('\n',start); - while(pos!=-1) + while((pos != -1) && (pos != clean_string.length() -1)) { if(pos!=start) { std::basic_string str = std::basic_string(clean_string,start,pos-start); - setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + setCursorPos(mCursorPos + insert(mCursorPos, str, TRUE, LLTextSegmentPtr())); } - addLineBreakChar(); - + addLineBreakChar(TRUE); // Add a line break and group with the next addition. + start = pos+1; pos = clean_string.find('\n',start); } - std::basic_string str = std::basic_string(clean_string,start,clean_string.length()-start); - setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + if (pos != start) + { + std::basic_string str = std::basic_string(clean_string,start,clean_string.length()-start); + setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + } + else + { + addLineBreakChar(FALSE); // Add a line break and end the grouping. + } deselect(); diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 40821ae9fb..7d2dd09a28 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -239,7 +239,7 @@ protected: // Undoable operations void addChar(llwchar c); // at mCursorPos S32 addChar(S32 pos, llwchar wc); - void addLineBreakChar(); + void addLineBreakChar(BOOL group_together = FALSE); S32 overwriteChar(S32 pos, llwchar wc); void removeChar(); S32 removeChar(S32 pos); -- cgit v1.2.3 From 07cc38e9cbd3dafe1373fa59aedbe7fb868cfd68 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 9 Nov 2012 15:12:15 -0500 Subject: STORM-1855: Improve performance of pasting large blocks of text in the script editor --- indra/llui/lltexteditor.cpp | 24 ++++++++++++++++-------- indra/llui/lltexteditor.h | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 144b6960a1..1e3a99c088 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1095,7 +1095,8 @@ void LLTextEditor::addChar(llwchar wc) setCursorPos(mCursorPos + addChar( mCursorPos, wc )); } -void LLTextEditor::addLineBreakChar() + +void LLTextEditor::addLineBreakChar(BOOL group_together) { if( !getEnabled() ) { @@ -1113,7 +1114,7 @@ void LLTextEditor::addLineBreakChar() LLStyleConstSP sp(new LLStyle(LLStyle::Params())); LLTextSegmentPtr segment = new LLLineBreakTextSegment(sp, mCursorPos); - S32 pos = execute(new TextCmdAddChar(mCursorPos, FALSE, '\n', segment)); + S32 pos = execute(new TextCmdAddChar(mCursorPos, group_together, '\n', segment)); setCursorPos(mCursorPos + pos); } @@ -1436,21 +1437,28 @@ void LLTextEditor::pasteHelper(bool is_primary) std::basic_string::size_type start = 0; std::basic_string::size_type pos = clean_string.find('\n',start); - while(pos!=-1) + while((pos != -1) && (pos != clean_string.length() -1)) { if(pos!=start) { std::basic_string str = std::basic_string(clean_string,start,pos-start); - setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + setCursorPos(mCursorPos + insert(mCursorPos, str, TRUE, LLTextSegmentPtr())); } - addLineBreakChar(); - + addLineBreakChar(TRUE); // Add a line break and group with the next addition. + start = pos+1; pos = clean_string.find('\n',start); } - std::basic_string str = std::basic_string(clean_string,start,clean_string.length()-start); - setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + if (pos != start) + { + std::basic_string str = std::basic_string(clean_string,start,clean_string.length()-start); + setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + } + else + { + addLineBreakChar(FALSE); // Add a line break and end the grouping. + } deselect(); diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 40821ae9fb..7d2dd09a28 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -239,7 +239,7 @@ protected: // Undoable operations void addChar(llwchar c); // at mCursorPos S32 addChar(S32 pos, llwchar wc); - void addLineBreakChar(); + void addLineBreakChar(BOOL group_together = FALSE); S32 overwriteChar(S32 pos, llwchar wc); void removeChar(); S32 removeChar(S32 pos); -- cgit v1.2.3 From d7e041d0c7a6f5e19b12efb434a722d6b4969b24 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 25 Mar 2013 16:11:04 -0400 Subject: correct merge error --- indra/llui/lltexteditor.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 4a950638a4..57446e9c56 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1501,11 +1501,6 @@ void LLTextEditor::pasteTextWithLinebreaks(LLWString & clean_string) { addLineBreakChar(FALSE); // Add a line break and end the grouping. } - } - else - { - addLineBreakChar(FALSE); // Add a line break and end the grouping. - } } // copy selection to primary -- cgit v1.2.3 From 52b9b52ff70c9dcd602d1c96c5d0429f90208a20 Mon Sep 17 00:00:00 2001 From: mberezhnoy Date: Mon, 8 Apr 2013 22:05:59 +0300 Subject: CHUI-748 (Right click does not produce context menu for landmarks in Trash in Places Floater) --- indra/llui/llmenugl.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index f7bf39c897..f854e1785d 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3146,6 +3146,13 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) const S32 CURSOR_HEIGHT = 22; // Approximate "normal" cursor size const S32 CURSOR_WIDTH = 12; + if (menu->getChildList()->empty()) + { + return; + } + + menu->setVisible( TRUE ); + //Do not show menu if all menu items are disabled BOOL item_enabled = false; for (LLView::child_list_t::const_iterator itor = menu->getChildList()->begin(); @@ -3156,8 +3163,9 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) item_enabled = item_enabled || menu_item->getEnabled(); } - if(menu->getChildList()->empty() || !item_enabled) + if(!item_enabled) { + menu->setVisible( FALSE ); return; } @@ -3173,8 +3181,6 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) menu->mFirstVisibleItem = NULL; } - menu->setVisible( TRUE ); - // Fix menu rect if needed. menu->needsArrange(); menu->arrangeAndClear(); -- cgit v1.2.3 From d533a33f4229244405ed0b247fce410513b6c3e9 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 8 Apr 2013 18:59:21 -0700 Subject: CHUI-912 : WIP : Add traces to various aspects of the inventory filtering, sorting and arranging (to be deleted) --- indra/llui/llfolderview.cpp | 2 ++ indra/llui/llfolderviewitem.cpp | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 8feaf654f0..c6868c9538 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -323,6 +323,7 @@ static LLFastTimer::DeclareTimer FTM_FILTER("Filter Folder View"); void LLFolderView::filter( LLFolderViewFilter& filter ) { + //llinfos << "Merov : LLFolderView::filter (fast timed)" << llendl; LLFastTimer t2(FTM_FILTER); filter.setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); @@ -1615,6 +1616,7 @@ void LLFolderView::update() { getFolderViewModel()->getFilter().clearModified(); } + llinfos << "Merov : LLFolderView::update: modified = " << getFolderViewModel()->getFilter().isModified() << ", default = " << getFolderViewModel()->getFilter().isNotDefault() << ", count = " << getFolderViewModel()->getFilter().getFilterCount() << llendl; // automatically show matching items, and select first one if we had a selection if (mNeedsAutoSelect) diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index fdb4108afb..3693920e05 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -274,6 +274,11 @@ void LLFolderViewItem::refresh() } mLabelWidthDirty = true; + // Merov ?? + if (vmi.getSearchableName() == "A NOUNOURS") + { + llinfos << "Merov : LLFolderViewItem::refresh : Dirty filter for NOUNOURS" << llendl; + } vmi.dirtyFilter(); } @@ -951,6 +956,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) getRoot()->getFolderViewModel()->sort(this); LLFastTimer t2(FTM_ARRANGE); + llinfos << "Merov : LLFolderViewFolder::arrange" << llendl; // evaluate mHasVisibleChildren mHasVisibleChildren = false; -- cgit v1.2.3 From c59aeef9664a1d9b6357a66a6eff0eab6d24b3eb Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 11 Apr 2013 00:18:00 +0300 Subject: CHUI-921 FIXED Default position of open floaters starts at left edge of viewer behind toolbar --- indra/llui/llfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 09e27a264a..5873df5169 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2788,7 +2788,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } // move window fully onscreen - if (floater->translateIntoRect( getSnapRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) + if (floater->translateIntoRect( gFloaterView->getRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) { floater->clearSnapTarget(); } -- cgit v1.2.3 From 3c2c897cac98e39dcc0447c2d7d458ba313a8cd6 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 12 Apr 2013 20:27:28 +0300 Subject: CHUI-916 FIXED Clear mMisspellRanges if spell check is not needed. --- indra/llui/lltextbase.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index a815cfc176..def1277ba7 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -652,6 +652,10 @@ void LLTextBase::drawText() mSpellCheckEnd = end; } } + else + { + mMisspellRanges.clear(); + } LLTextSegmentPtr cur_segment = *seg_iter; -- cgit v1.2.3 From fa36f85b007a124c418fd8cfc0e836cc7fdc86cf Mon Sep 17 00:00:00 2001 From: PavelK ProductEngine Date: Tue, 9 Apr 2013 20:50:54 +0300 Subject: CHUI-797 FIXED Only one separated conversation window is shown after exiting from mouselook view Added all separated conversation floaters to skip list used in gFloaterView->popVisibleAll(skip_list) in llagent.cpp since LLFloaterIMContainer::setVisible() takes control of them by itself. --- indra/llui/llfloater.cpp | 5 +++++ indra/llui/llfloater.h | 1 + 2 files changed, 6 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 5873df5169..6816137e52 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -3258,6 +3258,11 @@ bool LLFloater::isShown() const return ! isMinimized() && isInVisibleChain(); } +bool LLFloater::isDetachedAndNotMinimized() +{ + return !getHost() && !isMinimized(); +} + /* static */ bool LLFloater::isShown(const LLFloater* floater) { diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 4dba1e645f..26ac4a98ad 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -238,6 +238,7 @@ public: void center(); LLMultiFloater* getHost(); + bool isDetachedAndNotMinimized(); void applyTitle(); std::string getCurrentTitle() const; -- cgit v1.2.3 From b05bf882dbf5cdcb4683b4c6201ea50a38491a7b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 11 Apr 2013 19:02:16 -0700 Subject: CHUI-912 : WIP : Fix resize test when folder is empty, add more traces (to be deleted) --- indra/llui/llfolderview.cpp | 4 ++-- indra/llui/llfolderviewitem.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index c6868c9538..5bca589bc4 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -662,7 +662,7 @@ void LLFolderView::draw() // get preferable text height... S32 pixel_height = mStatusTextBox->getTextPixelHeight(); - bool height_changed = local_rect.getHeight() != pixel_height; + bool height_changed = (local_rect.getHeight() < pixel_height); if (height_changed) { // ... if it does not match current height, lets rearrange current view. @@ -1616,7 +1616,7 @@ void LLFolderView::update() { getFolderViewModel()->getFilter().clearModified(); } - llinfos << "Merov : LLFolderView::update: modified = " << getFolderViewModel()->getFilter().isModified() << ", default = " << getFolderViewModel()->getFilter().isNotDefault() << ", count = " << getFolderViewModel()->getFilter().getFilterCount() << llendl; + llinfos << "Merov : LLFolderView::update: parent = " << mParentPanel->getName() << ", modified = " << getFolderViewModel()->getFilter().isModified() << ", not default = " << getFolderViewModel()->getFilter().isNotDefault() << ", count = " << getFolderViewModel()->getFilter().getFilterCount() << llendl; // automatically show matching items, and select first one if we had a selection if (mNeedsAutoSelect) diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 3693920e05..43267b428e 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -795,6 +795,12 @@ void LLFolderViewItem::drawLabel(const LLFontGL * font, const F32 x, const F32 y void LLFolderViewItem::draw() { + LLFolderViewModelItem& vmi = *getViewModelItem(); + if (vmi.getSearchableName() == "A NOUNOURS") + { + llinfos << "Merov : LLFolderViewItem::draw : Special NOUNOURS, draw it!" << llendl; + } + const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE); const BOOL filled = show_context || (getRoot() ? getRoot()->getParentPanel()->hasFocus() : FALSE); // If we have keyboard focus, draw selection filled -- cgit v1.2.3 From 0ecbbe9571be298284c2410ea441877b611bd875 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 15 Apr 2013 11:16:57 -0700 Subject: CHUI-912 : WIP : Try to change the return value of filter() so to trigger arrange on the fly. --- indra/llui/llfolderview.cpp | 13 ++++++++++++- indra/llui/llfolderviewitem.h | 1 - 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 5bca589bc4..3ca549ae72 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -327,7 +327,13 @@ void LLFolderView::filter( LLFolderViewFilter& filter ) LLFastTimer t2(FTM_FILTER); filter.setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); - getViewModelItem()->filter(filter); + bool filtered_items = getViewModelItem()->filter(filter); + //if (getViewModelItem()->descendantsPassedFilter(filter.getCurrentGeneration())) + if (filtered_items) + { + llinfos << "Merov : LLFolderView::filter, request arrange, new elements passed the filter" << llendl; + requestArrange(); + } } void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent) @@ -1665,9 +1671,14 @@ void LLFolderView::update() { S32 height = 0; S32 width = 0; + llinfos << "Merov : LLFolderView::update: parent = " << mParentPanel->getName() << ", is been arranged, last arrange = " << mLastArrangeGeneration << ", root arrange = " << getRoot()->getArrangeGeneration() << llendl; S32 total_height = arrange( &width, &height ); notifyParent(LLSD().with("action", "size_changes").with("height", total_height)); } + else + { + llinfos << "Merov : LLFolderView::update: parent = " << mParentPanel->getName() << ", doesn't need arranging, last arrange = " << mLastArrangeGeneration << ", root arrange = " << getRoot()->getArrangeGeneration() << llendl; + } } // during filtering process, try to pin selected item's location on screen diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index ca31931e19..a9b0201236 100755 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -316,7 +316,6 @@ protected: F32 mAutoOpenCountdown; S32 mLastArrangeGeneration; S32 mLastCalculatedWidth; - S32 mMostFilteredDescendantGeneration; bool mNeedsSort; public: -- cgit v1.2.3 From 4106d203e016077fe9e233da8fbaa9e2e9a24403 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 18 Apr 2013 19:13:28 +0300 Subject: CHUI-938 FIXED Pop up (?) notification steals focus --- indra/llui/llfloater.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 6816137e52..d97569839a 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -507,22 +507,11 @@ LLFloater::~LLFloater() { LLFloaterReg::removeInstance(mInstanceName, mKey); -// delete mNotificationContext; -// mNotificationContext = NULL; - - //// am I not hosted by another floater? - //if (mHostHandle.isDead()) - //{ - // LLFloaterView* parent = (LLFloaterView*) getParent(); - - // if( parent ) - // { - // parent->removeChild( this ); - // } - //} - - // Just in case we might still have focus here, release it. - releaseFocus(); + if( gFocusMgr.childHasKeyboardFocus(this)) + { + // Just in case we might still have focus here, release it. + releaseFocus(); + } // This is important so that floaters with persistent rects (i.e., those // created with rect control rather than an LLRect) are restored in their -- cgit v1.2.3 From 0193a7b74ccc09788e8d2503244f30ac231546cc Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Tue, 16 Apr 2013 04:55:09 +0300 Subject: CHUI-808 FIXED Draggable separator between conversations and message pane is not discoverable: - final solution; --- indra/llui/lllayoutstack.cpp | 103 ++++++++++++++++++++++++++++++++-------- indra/llui/lllayoutstack.h | 10 ++++ indra/llui/llresizebar.cpp | 110 ++++++++++++++++++++++++++++++++++++++++++- indra/llui/llresizebar.h | 52 ++++++++++---------- 4 files changed, 228 insertions(+), 47 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index e642883991..c89c0203b4 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -214,8 +214,15 @@ LLLayoutStack::Params::Params() open_time_constant("open_time_constant", 0.02f), close_time_constant("close_time_constant", 0.03f), resize_bar_overlap("resize_bar_overlap", 1), - border_size("border_size", LLCachedControl(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)) -{} + border_size("border_size", LLCachedControl(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)), + show_drag_handle("show_drag_handle", false), + drag_handle_first_indent("drag_handle_first_indent", 0), + drag_handle_second_indent("drag_handle_second_indent", 0), + drag_handle_thickness("drag_handle_thickness", 5), + drag_handle_shift("drag_handle_shift", 2) +{ + addSynonym(border_size, "drag_handle_gap"); +} LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) : LLView(p), @@ -227,8 +234,14 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mClip(p.clip), mOpenTimeConstant(p.open_time_constant), mCloseTimeConstant(p.close_time_constant), - mResizeBarOverlap(p.resize_bar_overlap) -{} + mResizeBarOverlap(p.resize_bar_overlap), + mShowDragHandle(p.show_drag_handle), + mDragHandleFirstIndent(p.drag_handle_first_indent), + mDragHandleSecondIndent(p.drag_handle_second_indent), + mDragHandleThickness(p.drag_handle_thickness), + mDragHandleShift(p.drag_handle_shift) +{ +} LLLayoutStack::~LLLayoutStack() { @@ -262,6 +275,26 @@ void LLLayoutStack::draw() drawChild(panelp, 0, 0, !clip_rect.isEmpty()); } } + + const LLView::child_list_t * child_listp = getChildList(); + BOOST_FOREACH(LLView * childp, * child_listp) + { + LLResizeBar * resize_barp = dynamic_cast(childp); + if (resize_barp && resize_barp->isShowDragHandle() && resize_barp->getVisible() && resize_barp->getRect().isValid()) + { + LLRect screen_rect = resize_barp->calcScreenRect(); + if (LLUI::getRootView()->getLocalRect().overlaps(screen_rect) && LLUI::sDirtyRect.overlaps(screen_rect)) + { + LLUI::pushMatrix(); + { + const LLRect& rb_rect(resize_barp->getRect()); + LLUI::translate(rb_rect.mLeft, rb_rect.mBottom); + resize_barp->draw(); + } + LLUI::popMatrix(); + } + } + } } void LLLayoutStack::removeChild(LLView* view) @@ -390,7 +423,6 @@ void LLLayoutStack::updateLayout() BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) { F32 panel_dim = llmax(panelp->getExpandedMinDim(), panelp->mTargetDim); - F32 panel_visible_dim = panelp->getVisibleDim(); LLRect panel_rect; if (mOrientation == HORIZONTAL) @@ -407,27 +439,61 @@ void LLLayoutStack::updateLayout() getRect().getWidth(), llround(panel_dim)); } - panelp->setIgnoreReshape(true); - panelp->setShape(panel_rect); - panelp->setIgnoreReshape(false); LLRect resize_bar_rect(panel_rect); - + LLResizeBar * resize_barp = panelp->getResizeBar(); + bool show_drag_handle = resize_barp->isShowDragHandle(); F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount(); + F32 panel_visible_dim = panelp->getVisibleDim(); + S32 panel_spacing_round = (S32)(llround(panel_spacing)); + if (mOrientation == HORIZONTAL) { - resize_bar_rect.mLeft = panel_rect.mRight - mResizeBarOverlap; - resize_bar_rect.mRight = panel_rect.mRight + (S32)(llround(panel_spacing)) + mResizeBarOverlap; - cur_pos += panel_visible_dim + panel_spacing; + + if (show_drag_handle && panel_spacing_round > mDragHandleThickness) + { + resize_bar_rect.mLeft = panel_rect.mRight + mDragHandleShift; + resize_bar_rect.mRight = resize_bar_rect.mLeft + mDragHandleThickness; + } + else + { + resize_bar_rect.mLeft = panel_rect.mRight - mResizeBarOverlap; + resize_bar_rect.mRight = panel_rect.mRight + panel_spacing_round + mResizeBarOverlap; + } + + if (show_drag_handle) + { + resize_bar_rect.mBottom += mDragHandleSecondIndent; + resize_bar_rect.mTop -= mDragHandleFirstIndent; + } + } else //VERTICAL { - resize_bar_rect.mTop = panel_rect.mBottom + mResizeBarOverlap; - resize_bar_rect.mBottom = panel_rect.mBottom - (S32)(llround(panel_spacing)) - mResizeBarOverlap; - cur_pos -= panel_visible_dim + panel_spacing; + + if (show_drag_handle && panel_spacing_round > mDragHandleThickness) + { + resize_bar_rect.mTop = panel_rect.mBottom - mDragHandleShift; + resize_bar_rect.mBottom = resize_bar_rect.mTop - mDragHandleThickness; + } + else + { + resize_bar_rect.mTop = panel_rect.mBottom + mResizeBarOverlap; + resize_bar_rect.mBottom = panel_rect.mBottom - panel_spacing_round - mResizeBarOverlap; + } + + if (show_drag_handle) + { + resize_bar_rect.mLeft += mDragHandleFirstIndent; + resize_bar_rect.mRight -= mDragHandleSecondIndent; + } } + + panelp->setIgnoreReshape(true); + panelp->setShape(panel_rect); + panelp->setIgnoreReshape(false); panelp->mResizeBar->setShape(resize_bar_rect); } @@ -475,15 +541,13 @@ void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp) { if (lp->mResizeBar == NULL) { - LLResizeBar::Side side = (mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM; - LLRect resize_bar_rect = getRect(); - LLResizeBar::Params resize_params; resize_params.name("resize"); resize_params.resizing_view(lp); resize_params.min_size(lp->getRelevantMinDim()); - resize_params.side(side); + resize_params.side((mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM); resize_params.snapping_enabled(false); + resize_params.show_drag_handle(mShowDragHandle); LLResizeBar* resize_bar = LLUICtrlFactory::create(resize_params); lp->mResizeBar = resize_bar; LLView::addChild(resize_bar, 0); @@ -865,3 +929,4 @@ void LLLayoutStack::updateResizeBarLimits() previous_visible_panelp = visible_panelp; } } + diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 02c664f1a0..b570974bd6 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -62,6 +62,11 @@ public: Optional open_time_constant, close_time_constant; Optional resize_bar_overlap; + Optional show_drag_handle; + Optional drag_handle_first_indent; + Optional drag_handle_second_indent; + Optional drag_handle_thickness; + Optional drag_handle_shift; Params(); }; @@ -126,6 +131,11 @@ private: F32 mCloseTimeConstant; bool mNeedsLayout; S32 mResizeBarOverlap; + bool mShowDragHandle; + S32 mDragHandleFirstIndent; + S32 mDragHandleSecondIndent; + S32 mDragHandleThickness; + S32 mDragHandleShift; }; // end class LLLayoutStack diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index 15e56cbfe5..cfdc951542 100644 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -28,14 +28,53 @@ #include "llresizebar.h" +#include "lllocalcliprect.h" #include "llmath.h" #include "llui.h" #include "llmenugl.h" #include "llfocusmgr.h" #include "llwindow.h" +class LLImagePanel : public LLPanel +{ +public: + struct Params : public LLInitParam::Block + { + Optional horizontal; + Params() : horizontal("horizontal", false) {} + }; + LLImagePanel(const Params& p) : LLPanel(p), mHorizontal(p.horizontal) {} + virtual ~LLImagePanel() {} + + void draw() + { + const LLRect& parent_rect = getParent()->getRect(); + const LLRect& rect = getRect(); + LLRect clip_rect( -rect.mLeft, parent_rect.getHeight() - rect.mBottom - 2 + , parent_rect.getWidth() - rect.mLeft - (mHorizontal ? 2 : 0), -rect.mBottom); + LLLocalClipRect clip(clip_rect); + LLPanel::draw(); + } + +private: + bool mHorizontal; +}; + +static LLDefaultChildRegistry::Register t1("resize_bar_image_panel"); + +LLResizeBar::Params::Params() +: max_size("max_size", S32_MAX), + snapping_enabled("snapping_enabled", true), + resizing_view("resizing_view"), + side("side"), + allow_double_click_snapping("allow_double_click_snapping", true), + show_drag_handle("show_drag_handle", false) +{ + name = "resize_bar"; +} + LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) -: LLView(p), +: LLPanel(p), mDragLastScreenX( 0 ), mDragLastScreenY( 0 ), mLastMouseScreenX( 0 ), @@ -46,7 +85,9 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) mSnappingEnabled(p.snapping_enabled), mAllowDoubleClickSnapping(p.allow_double_click_snapping), mResizingView(p.resizing_view), - mResizeListener(NULL) + mResizeListener(NULL), + mShowDragHandle(p.show_drag_handle), + mImagePanel(NULL) { setFollowsNone(); // set up some generically good follow code. @@ -75,8 +116,37 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) default: break; } + + if (mShowDragHandle) + { + LLViewBorder::Params border_params; + border_params.border_thickness = 1; + border_params.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderlight"); + border_params.shadow_dark_color = LLUIColorTable::instance().getColor("ResizebarBorderDark"); + + addBorder(border_params); + setBorderVisible(TRUE); + + LLImagePanel::Params image_panel; + mDragHandleImage = LLUI::getUIImage(LLResizeBar::RIGHT == mSide ? "Vertical Drag Handle" : "Horizontal Drag Handle"); + image_panel.bg_alpha_image = mDragHandleImage; + image_panel.background_visible = true; + image_panel.horizontal = (LLResizeBar::BOTTOM == mSide); + mImagePanel = LLUICtrlFactory::create(image_panel); + setImagePanel(mImagePanel); + } } +BOOL LLResizeBar::postBuild() +{ + if (mShowDragHandle) + { + setBackgroundVisible(TRUE); + setTransparentColor(LLUIColorTable::instance().getColor("ResizebarBody")); + } + + return LLPanel::postBuild(); +} BOOL LLResizeBar::handleMouseDown(S32 x, S32 y, MASK mask) { @@ -342,3 +412,39 @@ BOOL LLResizeBar::handleDoubleClick(S32 x, S32 y, MASK mask) return TRUE; } +void LLResizeBar::setImagePanel(LLPanel * panelp) +{ + const LLView::child_list_t * children = getChildList(); + if (getChildCount() == 2) + { + LLPanel * image_panelp = dynamic_cast(children->back()); + if (image_panelp) + { + removeChild(image_panelp); + delete image_panelp; + } + } + + addChild(panelp); + sendChildToBack(panelp); +} + +LLPanel * LLResizeBar::getImagePanel() const +{ + return getChildCount() > 0 ? (LLPanel *)getChildList()->back() : NULL; +} + +void LLResizeBar::draw() +{ + if (mShowDragHandle) + { + S32 image_width = mDragHandleImage->getTextureWidth(); + S32 image_height = mDragHandleImage->getTextureHeight(); + const LLRect& panel_rect = getRect(); + S32 image_left = (panel_rect.getWidth() - image_width) / 2 - 1; + S32 image_bottom = (panel_rect.getHeight() - image_height) / 2; + mImagePanel->setRect(LLRect(image_left, image_bottom + image_height, image_left + image_width, image_bottom)); + } + + LLPanel::draw(); +} diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h index 8190a95a71..bcf8ea0b40 100644 --- a/indra/llui/llresizebar.h +++ b/indra/llui/llresizebar.h @@ -27,15 +27,14 @@ #ifndef LL_RESIZEBAR_H #define LL_RESIZEBAR_H -#include "llview.h" -#include "llcoord.h" +#include "llpanel.h" -class LLResizeBar : public LLView +class LLResizeBar : public LLPanel { public: enum Side { LEFT, TOP, RIGHT, BOTTOM }; - struct Params : public LLInitParam::Block + struct Params : public LLInitParam::Block { Mandatory resizing_view; Mandatory side; @@ -44,24 +43,19 @@ public: Optional max_size; Optional snapping_enabled; Optional allow_double_click_snapping; + Optional show_drag_handle; - Params() - : max_size("max_size", S32_MAX), - snapping_enabled("snapping_enabled", true), - resizing_view("resizing_view"), - side("side"), - allow_double_click_snapping("allow_double_click_snapping", true) - { - name = "resize_bar"; - } + Params(); }; protected: LLResizeBar(const LLResizeBar::Params& p); friend class LLUICtrlFactory; + + /*virtual*/ BOOL postBuild(); public: -// virtual void draw(); No appearance + virtual void draw(); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -72,20 +66,26 @@ public: void setAllowDoubleClickSnapping(BOOL allow) { mAllowDoubleClickSnapping = allow; } bool canResize() { return getEnabled() && mMaxSize > mMinSize; } void setResizeListener(boost::function listener) {mResizeListener = listener;} + BOOL isShowDragHandle() const { return mShowDragHandle; } + void setImagePanel(LLPanel * panelp); + LLPanel * getImagePanel() const; private: - S32 mDragLastScreenX; - S32 mDragLastScreenY; - S32 mLastMouseScreenX; - S32 mLastMouseScreenY; - LLCoordGL mLastMouseDir; - S32 mMinSize; - S32 mMaxSize; - const Side mSide; - BOOL mSnappingEnabled; - BOOL mAllowDoubleClickSnapping; - LLView* mResizingView; - boost::function mResizeListener; + S32 mDragLastScreenX; + S32 mDragLastScreenY; + S32 mLastMouseScreenX; + S32 mLastMouseScreenY; + LLCoordGL mLastMouseDir; + S32 mMinSize; + S32 mMaxSize; + const Side mSide; + BOOL mSnappingEnabled; + BOOL mAllowDoubleClickSnapping; + BOOL mShowDragHandle; + LLView* mResizingView; + boost::function mResizeListener; + LLPointer mDragHandleImage; + LLPanel * mImagePanel; }; #endif // LL_RESIZEBAR_H -- cgit v1.2.3 From e84c97e86d51b4f890695182c8087288481b6955 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 16 Apr 2013 19:24:47 -0700 Subject: CHUI-912, CHUI-849 : Propagate arrange request correctly, limit sort, improve filter perf, clear traces, add comments. --- indra/llui/llfolderview.cpp | 34 +++++++++++++-------------------- indra/llui/llfolderviewitem.cpp | 42 +++++++++++++++++------------------------ indra/llui/llfolderviewmodel.h | 22 +++++++++++---------- 3 files changed, 42 insertions(+), 56 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 3ca549ae72..c9e88ab72f 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -323,17 +323,11 @@ static LLFastTimer::DeclareTimer FTM_FILTER("Filter Folder View"); void LLFolderView::filter( LLFolderViewFilter& filter ) { - //llinfos << "Merov : LLFolderView::filter (fast timed)" << llendl; + // Entry point of inventory filtering (CHUI-849) LLFastTimer t2(FTM_FILTER); filter.setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); - - bool filtered_items = getViewModelItem()->filter(filter); - //if (getViewModelItem()->descendantsPassedFilter(filter.getCurrentGeneration())) - if (filtered_items) - { - llinfos << "Merov : LLFolderView::filter, request arrange, new elements passed the filter" << llendl; - requestArrange(); - } + // Note: we filter the model, not the view + getViewModelItem()->filter(filter); } void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent) @@ -1614,16 +1608,17 @@ void LLFolderView::update() { mNeedsAutoSelect = TRUE; } - // filter to determine visibility before arranging + + // Filter to determine visibility before arranging filter(getFolderViewModel()->getFilter()); + // Clear the modified setting on the filter only if the filter count is non-zero after running the filter process - // Note: if the filter count is zero, then the filter most likely halted before completing the entire set of items + // Note: if the filter count is zero, that means the filter exhausted its count per frame and halted before completing the entire set of items if (getFolderViewModel()->getFilter().isModified() && (getFolderViewModel()->getFilter().getFilterCount() > 0)) { getFolderViewModel()->getFilter().clearModified(); } - llinfos << "Merov : LLFolderView::update: parent = " << mParentPanel->getName() << ", modified = " << getFolderViewModel()->getFilter().isModified() << ", not default = " << getFolderViewModel()->getFilter().isNotDefault() << ", count = " << getFolderViewModel()->getFilter().getFilterCount() << llendl; - + // automatically show matching items, and select first one if we had a selection if (mNeedsAutoSelect) { @@ -1663,22 +1658,19 @@ void LLFolderView::update() BOOL is_visible = isInVisibleChain(); - //Puts folders/items in proper positions - if ( is_visible ) + // Puts folders/items in proper positions + // arrange() takes the model filter flag into account and call sort() if necessary (CHUI-849) + // It also handles the open/close folder animation + if (is_visible) { sanitizeSelection(); - if( needsArrange() ) + if (needsArrange()) { S32 height = 0; S32 width = 0; - llinfos << "Merov : LLFolderView::update: parent = " << mParentPanel->getName() << ", is been arranged, last arrange = " << mLastArrangeGeneration << ", root arrange = " << getRoot()->getArrangeGeneration() << llendl; S32 total_height = arrange( &width, &height ); notifyParent(LLSD().with("action", "size_changes").with("height", total_height)); } - else - { - llinfos << "Merov : LLFolderView::update: parent = " << mParentPanel->getName() << ", doesn't need arranging, last arrange = " << mLastArrangeGeneration << ", root arrange = " << getRoot()->getArrangeGeneration() << llendl; - } } // during filtering process, try to pin selected item's location on screen diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 43267b428e..96961e7a4f 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -274,11 +274,7 @@ void LLFolderViewItem::refresh() } mLabelWidthDirty = true; - // Merov ?? - if (vmi.getSearchableName() == "A NOUNOURS") - { - llinfos << "Merov : LLFolderViewItem::refresh : Dirty filter for NOUNOURS" << llendl; - } + // Dirty the filter flag of the model from the view (CHUI-849) vmi.dirtyFilter(); } @@ -795,12 +791,6 @@ void LLFolderViewItem::drawLabel(const LLFontGL * font, const F32 x, const F32 y void LLFolderViewItem::draw() { - LLFolderViewModelItem& vmi = *getViewModelItem(); - if (vmi.getSearchableName() == "A NOUNOURS") - { - llinfos << "Merov : LLFolderViewItem::draw : Special NOUNOURS, draw it!" << llendl; - } - const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE); const BOOL filled = show_context || (getRoot() ? getRoot()->getParentPanel()->hasFocus() : FALSE); // If we have keyboard focus, draw selection filled @@ -954,15 +944,20 @@ void LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder) static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); -// Finds width and height of this object and its children. Also -// makes sure that this view and its children are the right size. +// Make everything right and in the right place ready for drawing (CHUI-849) +// * Sort everything correctly if necessary +// * Turn widgets visible/invisible according to their model filtering state +// * Takes animation state into account for opening/closing of folders (this makes widgets visible/invisible) +// * Reposition visible widgets so that they line up correctly with no gap +// * Compute the width and height of the cuurent folder and its children +// * Makes sure that this view and its children are the right size S32 LLFolderViewFolder::arrange( S32* width, S32* height ) { - // sort before laying out contents + // Sort before laying out contents + // Note that we sort from the root (CHUI-849) getRoot()->getFolderViewModel()->sort(this); LLFastTimer t2(FTM_ARRANGE); - llinfos << "Merov : LLFolderViewFolder::arrange" << llendl; // evaluate mHasVisibleChildren mHasVisibleChildren = false; @@ -1625,16 +1620,13 @@ void LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) } void LLFolderViewFolder::requestArrange() -{ - if ( mLastArrangeGeneration != -1) - { - mLastArrangeGeneration = -1; - // flag all items up to root - if (mParentFolder) - { - mParentFolder->requestArrange(); - } - } +{ + mLastArrangeGeneration = -1; + // flag all items up to root + if (mParentFolder) + { + mParentFolder->requestArrange(); + } } void LLFolderViewFolder::toggleOpen() diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 1b61212c0e..dbcbb0edeb 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -308,26 +308,28 @@ public: virtual bool potentiallyVisible() { return passedFilter() // we've passed the filter - || getLastFilterGeneration() < mRootViewModel.getFilter().getFirstSuccessGeneration() // or we don't know yet + || (getLastFilterGeneration() < mRootViewModel.getFilter().getFirstSuccessGeneration()) // or we don't know yet || descendantsPassedFilter(); } virtual bool passedFilter(S32 filter_generation = -1) { - if (filter_generation < 0) + if (filter_generation < 0) + { filter_generation = mRootViewModel.getFilter().getFirstSuccessGeneration(); - - bool passed_folder_filter = mPassedFolderFilter && mLastFolderFilterGeneration >= filter_generation; - bool passed_filter = mPassedFilter && mLastFilterGeneration >= filter_generation; - return passed_folder_filter - && (descendantsPassedFilter(filter_generation) - || passed_filter); + } + bool passed_folder_filter = mPassedFolderFilter && (mLastFolderFilterGeneration >= filter_generation); + bool passed_filter = mPassedFilter && (mLastFilterGeneration >= filter_generation); + return passed_folder_filter && (passed_filter || descendantsPassedFilter(filter_generation)); } virtual bool descendantsPassedFilter(S32 filter_generation = -1) { - if (filter_generation < 0) filter_generation = mRootViewModel.getFilter().getFirstSuccessGeneration(); - return mMostFilteredDescendantGeneration >= filter_generation; + if (filter_generation < 0) + { + filter_generation = mRootViewModel.getFilter().getFirstSuccessGeneration(); + } + return mMostFilteredDescendantGeneration >= filter_generation; } -- cgit v1.2.3 From 88528cb901c4023817c05010ed85a11160d266ab Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 19 Apr 2013 00:45:59 +0300 Subject: CHUI-808 FIXED Draggable separator between conversations and message pane is not discoverable: minor fix; --- indra/llui/llresizebar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index cfdc951542..e67b22c977 100644 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -121,7 +121,7 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) { LLViewBorder::Params border_params; border_params.border_thickness = 1; - border_params.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderlight"); + border_params.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderLight"); border_params.shadow_dark_color = LLUIColorTable::instance().getColor("ResizebarBorderDark"); addBorder(border_params); -- cgit v1.2.3 From 03ad10d258095487d6ae8f26634932bc832f10df Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 18 Apr 2013 19:46:08 -0700 Subject: CHUI-849 : WIP : Filter limit on time instead of number of items --- indra/llui/llfolderview.cpp | 15 +++++++++++++-- indra/llui/llfolderviewitem.cpp | 2 +- indra/llui/llfolderviewmodel.cpp | 3 ++- indra/llui/llfolderviewmodel.h | 7 +++++++ 4 files changed, 23 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index c9e88ab72f..f3da71fc15 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -325,9 +325,19 @@ void LLFolderView::filter( LLFolderViewFilter& filter ) { // Entry point of inventory filtering (CHUI-849) LLFastTimer t2(FTM_FILTER); - filter.setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); + //filter.setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); + filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrame"), 1, 1000)); // Note: we filter the model, not the view getViewModelItem()->filter(filter); + // Test the filter state + if (filter.isTimedOut()) + { + llinfos << "Merov : filter of " << mParentPanel->getName() << " not finished, count = " << filter.getFilterCount() << llendl; + } + else if (filter.getFilterCount() != 0) + { + llinfos << "Merov : last filter of " << mParentPanel->getName() << " done! count = " << filter.getFilterCount() << llendl; + } } void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent) @@ -1614,7 +1624,8 @@ void LLFolderView::update() // Clear the modified setting on the filter only if the filter count is non-zero after running the filter process // Note: if the filter count is zero, that means the filter exhausted its count per frame and halted before completing the entire set of items - if (getFolderViewModel()->getFilter().isModified() && (getFolderViewModel()->getFilter().getFilterCount() > 0)) + //if (getFolderViewModel()->getFilter().isModified() && (getFolderViewModel()->getFilter().getFilterCount() > 0)) + if (getFolderViewModel()->getFilter().isModified() && (!getFolderViewModel()->getFilter().isTimedOut())) { getFolderViewModel()->getFilter().clearModified(); } diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 96961e7a4f..6c147ccc12 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -949,7 +949,7 @@ static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); // * Turn widgets visible/invisible according to their model filtering state // * Takes animation state into account for opening/closing of folders (this makes widgets visible/invisible) // * Reposition visible widgets so that they line up correctly with no gap -// * Compute the width and height of the cuurent folder and its children +// * Compute the width and height of the current folder and its children // * Makes sure that this view and its children are the right size S32 LLFolderViewFolder::arrange( S32* width, S32* height ) { diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp index 3593804554..b5622756fe 100644 --- a/indra/llui/llfolderviewmodel.cpp +++ b/indra/llui/llfolderviewmodel.cpp @@ -48,7 +48,8 @@ std::string LLFolderViewModelCommon::getStatusText() void LLFolderViewModelCommon::filter() { - getFilter().setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); + //getFilter().setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); + getFilter().resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrame"), 1, 1000)); mFolderView->getViewModelItem()->filter(getFilter()); } diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index dbcbb0edeb..64c00c782e 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -93,6 +93,13 @@ public: virtual S32 getFilterCount() const = 0; virtual void decrementFilterCount() = 0; + // +-------------------------------------------------------------------+ + // + Time + // +-------------------------------------------------------------------+ + virtual void resetTime(S32 timeout) = 0; + virtual bool isTimedOut() = 0; + virtual void incrementFilterCount() = 0; // Temp! + // +-------------------------------------------------------------------+ // + Default // +-------------------------------------------------------------------+ -- cgit v1.2.3 From 2cc1fb250f78df3a4b8f33b13b30defef7efb78a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 19 Apr 2013 16:51:44 -0700 Subject: CHUI-849 : Use a time limit for filtering instead of number limit, use a different limit for visible and unvisible lists --- indra/llui/llfolderview.cpp | 18 ++++-------------- indra/llui/llfolderviewmodel.cpp | 3 +-- indra/llui/llfolderviewmodel.h | 8 -------- 3 files changed, 5 insertions(+), 24 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index f3da71fc15..bf4d5ae1f9 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -325,19 +325,10 @@ void LLFolderView::filter( LLFolderViewFilter& filter ) { // Entry point of inventory filtering (CHUI-849) LLFastTimer t2(FTM_FILTER); - //filter.setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); - filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrame"), 1, 1000)); + filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100)); + // Note: we filter the model, not the view getViewModelItem()->filter(filter); - // Test the filter state - if (filter.isTimedOut()) - { - llinfos << "Merov : filter of " << mParentPanel->getName() << " not finished, count = " << filter.getFilterCount() << llendl; - } - else if (filter.getFilterCount() != 0) - { - llinfos << "Merov : last filter of " << mParentPanel->getName() << " done! count = " << filter.getFilterCount() << llendl; - } } void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent) @@ -1622,9 +1613,8 @@ void LLFolderView::update() // Filter to determine visibility before arranging filter(getFolderViewModel()->getFilter()); - // Clear the modified setting on the filter only if the filter count is non-zero after running the filter process - // Note: if the filter count is zero, that means the filter exhausted its count per frame and halted before completing the entire set of items - //if (getFolderViewModel()->getFilter().isModified() && (getFolderViewModel()->getFilter().getFilterCount() > 0)) + // Clear the modified setting on the filter only if the filter finished after running the filter process + // Note: if the filter count has timed out, that means the filter halted before completing the entire set of items if (getFolderViewModel()->getFilter().isModified() && (!getFolderViewModel()->getFilter().isTimedOut())) { getFolderViewModel()->getFilter().clearModified(); diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp index b5622756fe..3363dc5316 100644 --- a/indra/llui/llfolderviewmodel.cpp +++ b/indra/llui/llfolderviewmodel.cpp @@ -48,8 +48,7 @@ std::string LLFolderViewModelCommon::getStatusText() void LLFolderViewModelCommon::filter() { - //getFilter().setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); - getFilter().resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrame"), 1, 1000)); + getFilter().resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100)); mFolderView->getViewModelItem()->filter(getFilter()); } diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 64c00c782e..b1bcc8bbb4 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -86,19 +86,11 @@ public: //RN: this is public to allow system to externally force a global refilter virtual void setModified(EFilterModified behavior = FILTER_RESTART) = 0; - // +-------------------------------------------------------------------+ - // + Count - // +-------------------------------------------------------------------+ - virtual void setFilterCount(S32 count) = 0; - virtual S32 getFilterCount() const = 0; - virtual void decrementFilterCount() = 0; - // +-------------------------------------------------------------------+ // + Time // +-------------------------------------------------------------------+ virtual void resetTime(S32 timeout) = 0; virtual bool isTimedOut() = 0; - virtual void incrementFilterCount() = 0; // Temp! // +-------------------------------------------------------------------+ // + Default -- cgit v1.2.3 From 5cf1c9bfe1e4285929f41adda84f8a7208fe1805 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 24 Apr 2013 17:26:09 -0700 Subject: CHUI-845 : Make changeLine() a bit more resistant to unforseen line count values (i.e. 0) and a bit more general --- indra/llui/lltextbase.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index def1277ba7..5e1ed81097 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2606,21 +2606,18 @@ void LLTextBase::setCursorAtLocalPos( S32 local_x, S32 local_y, bool round, bool void LLTextBase::changeLine( S32 delta ) { S32 line = getLineNumFromDocIndex(mCursorPos); - - S32 new_line = line; - if( (delta < 0) && (line > 0 ) ) - { - new_line = line - 1; - } - else if( (delta > 0) && (line < (getLineCount() - 1)) ) - { - new_line = line + 1; - } - - LLRect visible_region = getVisibleDocumentRect(); - - S32 new_cursor_pos = getDocIndexFromLocalCoord(mDesiredXPixel, mLineInfoList[new_line].mRect.mBottom + mVisibleTextRect.mBottom - visible_region.mBottom, TRUE); - setCursorPos(new_cursor_pos, true); + S32 max_line_nb = getLineCount() - 1; + max_line_nb = (max_line_nb < 0 ? 0 : max_line_nb); + + S32 new_line = llclamp(line + delta, 0, max_line_nb); + + if (new_line != line) + { + LLRect visible_region = getVisibleDocumentRect(); + S32 new_cursor_pos = getDocIndexFromLocalCoord(mDesiredXPixel, + mLineInfoList[new_line].mRect.mBottom + mVisibleTextRect.mBottom - visible_region.mBottom, TRUE); + setCursorPos(new_cursor_pos, true); + } } bool LLTextBase::scrolledToStart() -- cgit v1.2.3 From 1c5659b1caffa30d35e1ffc74d18c037f6332c31 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 25 Apr 2013 20:02:36 +0300 Subject: CHUI-941 FIXED [CHUIBUG]Inline input is not available in 3.5.0 --- indra/llui/llchatentry.cpp | 10 ---------- indra/llui/llchatentry.h | 2 -- 2 files changed, 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index 6a1b48a08a..f6c4b69308 100644 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -163,16 +163,6 @@ bool LLChatEntry::useLabel() return !getLength() && !mLabel.empty(); } -void LLChatEntry::onFocusReceived() -{ - -} - -void LLChatEntry::onFocusLost() -{ - -} - BOOL LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) { BOOL handled = FALSE; diff --git a/indra/llui/llchatentry.h b/indra/llui/llchatentry.h index 49c8d21450..a20a505ae1 100644 --- a/indra/llui/llchatentry.h +++ b/indra/llui/llchatentry.h @@ -62,8 +62,6 @@ public: virtual void draw(); virtual void onCommit(); - /*virtual*/ void onFocusReceived(); - /*virtual*/ void onFocusLost(); void enableSingleLineMode(bool single_line_mode); boost::signals2::connection setTextExpandedCallback(const commit_signal_t::slot_type& cb); -- cgit v1.2.3 From 36a51f4927eb1bba511b73613a7f9baeddf467fd Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Tue, 14 May 2013 01:30:23 +0300 Subject: CHUI-958 FIXED Log spam: "drawtext: Ran off Segmentation End" and To field in nearby chat blank when selected --- indra/llui/llchatentry.cpp | 12 ++++++++++++ indra/llui/llchatentry.h | 2 ++ indra/llui/lltexteditor.cpp | 7 +++++-- indra/llui/lltexteditor.h | 1 + 4 files changed, 20 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index f6c4b69308..416c3e65e4 100644 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -163,6 +163,18 @@ bool LLChatEntry::useLabel() return !getLength() && !mLabel.empty(); } +void LLChatEntry::onFocusReceived() +{ + LLUICtrl::onFocusReceived(); + updateAllowingLanguageInput(); +} + +void LLChatEntry::onFocusLost() +{ + LLTextEditor::focusLostHelper(); + LLUICtrl::onFocusLost(); +} + BOOL LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) { BOOL handled = FALSE; diff --git a/indra/llui/llchatentry.h b/indra/llui/llchatentry.h index a20a505ae1..3a5e87e8c8 100644 --- a/indra/llui/llchatentry.h +++ b/indra/llui/llchatentry.h @@ -62,6 +62,8 @@ public: virtual void draw(); virtual void onCommit(); + /*virtual*/ void onFocusReceived(); + /*virtual*/ void onFocusLost(); void enableSingleLineMode(bool single_line_mode); boost::signals2::connection setTextExpandedCallback(const commit_signal_t::slot_type& cb); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 834f213097..09caec7b73 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1964,8 +1964,7 @@ void LLTextEditor::onFocusReceived() updateAllowingLanguageInput(); } -// virtual, from LLView -void LLTextEditor::onFocusLost() +void LLTextEditor::focusLostHelper() { updateAllowingLanguageInput(); @@ -1982,7 +1981,11 @@ void LLTextEditor::onFocusLost() // Make sure cursor is shown again getWindow()->showCursorFromMouseMove(); +} +void LLTextEditor::onFocusLost() +{ + focusLostHelper(); LLTextBase::onFocusLost(); } diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 969e072704..13f63a17ef 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -255,6 +255,7 @@ protected: S32 insert(S32 pos, const LLWString &wstr, bool group_with_next_op, LLTextSegmentPtr segment); S32 remove(S32 pos, S32 length, bool group_with_next_op); + void focusLostHelper(); void updateAllowingLanguageInput(); BOOL hasPreeditString() const; -- cgit v1.2.3 From 75f97d4ffe517d07e4b528de9e5f2d2c800510fb Mon Sep 17 00:00:00 2001 From: mberezhnoy Date: Thu, 16 May 2013 09:16:58 +0300 Subject: CHUI-963 (Toggling chat fui button twice tears off nearby chat to lower left corner also deletes other open conversations) --- indra/llui/llfloater.cpp | 1 + indra/llui/llfloater.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d97569839a..b5e81748a3 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1475,6 +1475,7 @@ void LLFloater::moveResizeHandlesToFront() } } +/*virtual*/ BOOL LLFloater::isFrontmost() { LLFloaterView* floater_view = getParentByType(); diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 26ac4a98ad..6e0df847cf 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -262,7 +262,7 @@ public: static bool isVisible(const LLFloater* floater); static bool isMinimized(const LLFloater* floater); BOOL isFirstLook() { return mFirstLook; } // EXT-2653: This function is necessary to prevent overlapping for secondary showed toasts - BOOL isFrontmost(); + virtual BOOL isFrontmost(); BOOL isDependent() { return !mDependeeHandle.isDead(); } void setCanMinimize(BOOL can_minimize); void setCanClose(BOOL can_close); -- cgit v1.2.3 From f5217acb4e8c2c27d57f4b8af88e21199aaaaaed Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 17 May 2013 19:46:57 +0300 Subject: CHUI-959 FIXED Resident picker allowed to open behind fui toolbars --- indra/llui/llfloater.cpp | 6 +++--- indra/llui/llfloater.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index b5e81748a3..273ceb4038 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1494,7 +1494,7 @@ void LLFloater::addDependentFloater(LLFloater* floaterp, BOOL reposition) floaterp->setRect(gFloaterView->findNeighboringPosition(this, floaterp)); floaterp->setSnapTarget(getHandle()); } - gFloaterView->adjustToFitScreen(floaterp, FALSE); + gFloaterView->adjustToFitScreen(floaterp, FALSE, TRUE); if (floaterp->isFrontmost()) { // make sure to bring self and sibling floaters to front @@ -2725,7 +2725,7 @@ void LLFloaterView::refresh() const S32 FLOATER_MIN_VISIBLE_PIXELS = 16; -void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside) +void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside, BOOL snap_in_toolbars/* = false*/) { if (floater->getParent() != this) { @@ -2778,7 +2778,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } // move window fully onscreen - if (floater->translateIntoRect( gFloaterView->getRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) + if (floater->translateIntoRect( snap_in_toolbars ? getSnapRect() : gFloaterView->getRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) { floater->clearSnapTarget(); } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 6e0df847cf..3482314698 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -529,7 +529,7 @@ public: LLRect findNeighboringPosition( LLFloater* reference_floater, LLFloater* neighbor ); // Given a child of gFloaterView, make sure this view can fit entirely onscreen. - void adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside); + void adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside, BOOL snap_in_toolbars = false); void setMinimizePositionVerticalOffset(S32 offset) { mMinimizePositionVOffset = offset; } void getMinimizePosition( S32 *left, S32 *bottom); -- cgit v1.2.3 From c6d4e449e42bbeea0c8dd7f36cde125f2086584b Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 22 May 2013 16:35:08 +0300 Subject: CHUI-941 FIXED [CHUIBUG]Inline input is not available in 3.5.0 --- indra/llui/lltexteditor.cpp | 53 ++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 18 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 09caec7b73..5e553fcd16 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2131,12 +2131,17 @@ void LLTextEditor::drawPreeditMarker() continue; } - S32 preedit_left = mVisibleTextRect.mLeft; + line_info& line = mLineInfoList[cur_line]; + LLRect text_rect(line.mRect); + text_rect.mRight = mDocumentView->getRect().getWidth(); // clamp right edge to document extents + text_rect.translate(mDocumentView->getRect().mLeft, mDocumentView->getRect().mBottom); // adjust by scroll position + + S32 preedit_left = text_rect.mLeft; if (left > line_start) { preedit_left += mFont->getWidth(text, line_start, left - line_start); } - S32 preedit_right = mVisibleTextRect.mLeft; + S32 preedit_right = text_rect.mLeft; if (right < line_end) { preedit_right += mFont->getWidth(text, line_start, right - line_start); @@ -2149,18 +2154,18 @@ void LLTextEditor::drawPreeditMarker() if (mPreeditStandouts[i]) { gl_rect_2d(preedit_left + preedit_standout_gap, - line_y + preedit_standout_position, - preedit_right - preedit_standout_gap - 1, - line_y + preedit_standout_position - preedit_standout_thickness, - (mCursorColor.get() * preedit_standout_brightness + mWriteableBgColor.get() * (1 - preedit_standout_brightness)).setAlpha(1.0f)); + text_rect.mBottom + mFont->getDescenderHeight() - 1, + preedit_right - preedit_standout_gap - 1, + text_rect.mBottom + mFont->getDescenderHeight() - 1 - preedit_standout_thickness, + (mCursorColor.get() * preedit_standout_brightness + mWriteableBgColor.get() * (1 - preedit_standout_brightness)).setAlpha(1.0f)); } else { gl_rect_2d(preedit_left + preedit_marker_gap, - line_y + preedit_marker_position, - preedit_right - preedit_marker_gap - 1, - line_y + preedit_marker_position - preedit_marker_thickness, - (mCursorColor.get() * preedit_marker_brightness + mWriteableBgColor.get() * (1 - preedit_marker_brightness)).setAlpha(1.0f)); + text_rect.mBottom + mFont->getDescenderHeight() - 1, + preedit_right - preedit_marker_gap - 1, + text_rect.mBottom + mFont->getDescenderHeight() - 1 - preedit_marker_thickness, + (mCursorColor.get() * preedit_marker_brightness + mWriteableBgColor.get() * (1 - preedit_marker_brightness)).setAlpha(1.0f)); } } } @@ -2243,12 +2248,13 @@ void LLTextEditor::draw() LLRect clip_rect(mVisibleTextRect); clip_rect.stretch(1); LLLocalClipRect clip(clip_rect); - drawPreeditMarker(); } LLTextBase::draw(); drawLineNumbers(); + drawPreeditMarker(); + //RN: the decision was made to always show the orange border for keyboard focus but do not put an insertion caret // when in readonly mode mBorder->setKeyboardFocusHighlight( hasFocus() );// && !mReadOnly); @@ -2698,14 +2704,20 @@ BOOL LLTextEditor::hasPreeditString() const void LLTextEditor::resetPreedit() { + if (hasSelection()) + { + if (hasPreeditString()) + { + llwarns << "Preedit and selection!" << llendl; + deselect(); + } + else + { + deleteSelection(TRUE); + } + } if (hasPreeditString()) { - if (hasSelection()) - { - llwarns << "Preedit and selection!" << llendl; - deselect(); - } - setCursorPos(mPreeditPositions.front()); removeStringNoUndo(mCursorPos, mPreeditPositions.back() - mCursorPos); insertStringNoUndo(mCursorPos, mPreeditOverwrittenWString); @@ -2753,7 +2765,12 @@ void LLTextEditor::updatePreedit(const LLWString &preedit_string, { mPreeditOverwrittenWString.clear(); } - insertStringNoUndo(insert_preedit_at, mPreeditWString); + + segment_vec_t segments; + LLStyleConstSP sp(new LLStyle(getStyleParams())); + segments.push_back(new LLNormalTextSegment(sp, 0, mPreeditWString.length(), *this)); + + insertStringNoUndo(insert_preedit_at, mPreeditWString, &segments); mPreeditStandouts = preedit_standouts; -- cgit v1.2.3 From eff548310117faaa9b8489891f60b4f2742da4cb Mon Sep 17 00:00:00 2001 From: PavelK ProductEngine Date: Fri, 24 May 2013 18:19:10 +0300 Subject: CHUI-964 FIXED Oversized "To" input field hides actual IM text --- indra/llui/llchatentry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index 416c3e65e4..c7e732e0c9 100755 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -62,9 +62,9 @@ void LLChatEntry::draw() { if(mIsExpandable) { + reflow(); expandText(); } - LLTextEditor::draw(); } -- cgit v1.2.3 From 705d85fb2f0856fdc19fd5f71f4dea33951db015 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 30 May 2013 17:04:19 +0300 Subject: CHUI-942 FIXED Choose Resident picker problems --- indra/llui/llscrolllistctrl.cpp | 4 ++-- indra/llui/llscrolllistctrl.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 7f04c92b27..40f828ed47 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1179,10 +1179,10 @@ LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos) // Selects first enabled item of the given name. // Returns false if item not found. // Calls getItemByLabel in order to combine functionality -BOOL LLScrollListCtrl::selectItemByLabel(const std::string& label, BOOL case_sensitive) +BOOL LLScrollListCtrl::selectItemByLabel(const std::string& label, BOOL case_sensitive, S32 column/* = 0*/) { deselectAllItems(TRUE); // ensure that no stale items are selected, even if we don't find a match - LLScrollListItem* item = getItemByLabel(label, case_sensitive); + LLScrollListItem* item = getItemByLabel(label, case_sensitive, column); bool found = NULL != item; if(found) diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 8fa06cc499..9b361c39d7 100755 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -241,7 +241,7 @@ public: // one of which can be selected at a time. virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); - BOOL selectItemByLabel( const std::string& item, BOOL case_sensitive = TRUE ); // FALSE if item not found + BOOL selectItemByLabel( const std::string& item, BOOL case_sensitive = TRUE, S32 column = 0 ); // FALSE if item not found BOOL selectItemByPrefix(const std::string& target, BOOL case_sensitive = TRUE); BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE); LLScrollListItem* getItemByLabel( const std::string& item, BOOL case_sensitive = TRUE, S32 column = 0 ); -- cgit v1.2.3 From 90a3285e2619cae3fad057168e78030ec1877a32 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 31 May 2013 20:05:12 +0300 Subject: CHUI-941 [CHUIBUG]Inline input is not available in 3.5.0 --- indra/llui/lltexteditor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 5e553fcd16..d1c4bcb24b 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2767,10 +2767,8 @@ void LLTextEditor::updatePreedit(const LLWString &preedit_string, } segment_vec_t segments; - LLStyleConstSP sp(new LLStyle(getStyleParams())); - segments.push_back(new LLNormalTextSegment(sp, 0, mPreeditWString.length(), *this)); - - insertStringNoUndo(insert_preedit_at, mPreeditWString, &segments); + //pass empty segments to let "insertStringNoUndo" make new LLNormalTextSegment and insert it, if needed. + insertStringNoUndo(insert_preedit_at, mPreeditWString, &segments); mPreeditStandouts = preedit_standouts; -- cgit v1.2.3 From 3bbab5bb46b034b87eef88466d4cf84d841bb087 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 4 Jun 2013 14:45:19 +0300 Subject: CHUI-957 FIXED Missing line was added. --- indra/llui/lltextbase.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index c2ab01de3a..bf216b32d4 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1923,6 +1923,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) registrar.add("Url.Teleport", boost::bind(&LLUrlAction::teleportToLocation, url)); registrar.add("Url.ShowProfile", boost::bind(&LLUrlAction::showProfile, url)); registrar.add("Url.AddFriend", boost::bind(&LLUrlAction::addFriend, url)); + registrar.add("Url.SendIM", boost::bind(&LLUrlAction::sendIM, url)); registrar.add("Url.ShowOnMap", boost::bind(&LLUrlAction::showLocationOnMap, url)); registrar.add("Url.CopyLabel", boost::bind(&LLUrlAction::copyLabelToClipboard, url)); registrar.add("Url.CopyUrl", boost::bind(&LLUrlAction::copyURLToClipboard, url)); -- cgit v1.2.3 From 0ada8944ee7427c2ea175602b6a139f2fa23cf73 Mon Sep 17 00:00:00 2001 From: PavelK ProductEngine Date: Wed, 5 Jun 2013 19:40:06 +0300 Subject: CHUI-964 ADD FIX Oversized "To" input field hides actual IM text --- indra/llui/llchatentry.cpp | 2 +- indra/llui/llchatentry.h | 2 +- indra/llui/lltextbase.cpp | 26 +++++++++++++++++++++++--- indra/llui/lltextbase.h | 2 +- 4 files changed, 26 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index c7e732e0c9..c04b70eb64 100755 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -158,7 +158,7 @@ void LLChatEntry::onValueChange(S32 start, S32 end) resetLabel(); } -bool LLChatEntry::useLabel() +bool LLChatEntry::useLabel() const { return !getLength() && !mLabel.empty(); } diff --git a/indra/llui/llchatentry.h b/indra/llui/llchatentry.h index 3a5e87e8c8..e67f39b21b 100755 --- a/indra/llui/llchatentry.h +++ b/indra/llui/llchatentry.h @@ -56,7 +56,7 @@ protected: LLChatEntry(const Params& p); /*virtual*/ void beforeValueChange(); /*virtual*/ void onValueChange(S32 start, S32 end); - /*virtual*/ bool useLabel(); + /*virtual*/ bool useLabel() const; public: diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index bf216b32d4..a53a38124c 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1854,7 +1854,17 @@ LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index) static LLPointer index_segment = new LLIndexSegment(); - if (index > getLength()) { return mSegments.end(); } + S32 text_len = 0; + if (!useLabel()) + { + text_len = getLength(); + } + else + { + text_len = mLabel.getWString().length(); + } + + if (index > text_len) { return mSegments.end(); } // when there are no segments, we return the end iterator, which must be checked by caller if (mSegments.size() <= 1) { return mSegments.begin(); } @@ -1870,7 +1880,17 @@ LLTextBase::segment_set_t::const_iterator LLTextBase::getSegIterContaining(S32 i { static LLPointer index_segment = new LLIndexSegment(); - if (index > getLength()) { return mSegments.end(); } + S32 text_len = 0; + if (!useLabel()) + { + text_len = getLength(); + } + else + { + text_len = mLabel.getWString().length(); + } + + if (index > text_len) { return mSegments.end(); } // when there are no segments, we return the end iterator, which must be checked by caller if (mSegments.size() <= 1) { return mSegments.begin(); } @@ -2101,7 +2121,7 @@ void LLTextBase::resetLabel() } } -bool LLTextBase::useLabel() +bool LLTextBase::useLabel() const { return !getLength() && !mLabel.empty() && !hasFocus(); } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 20a73387b5..2fb58d468a 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -507,7 +507,7 @@ protected: void initFromParams(const Params& p); virtual void beforeValueChange(); virtual void onValueChange(S32 start, S32 end); - virtual bool useLabel(); + virtual bool useLabel() const; // draw methods void drawSelectionBackground(); // draws the black box behind the selected text -- cgit v1.2.3 From 0cf9597bd55782b4a463f3e07767269e80432db6 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 11 Jun 2013 15:30:31 +0300 Subject: CHUI-926 FIXED FUI button will stay highlight(orange) if there are unread IMs when the conversation floater is minimized. --- indra/llui/llbutton.cpp | 5 +++-- indra/llui/llbutton.h | 4 ++-- indra/llui/lltoolbar.cpp | 4 ++-- indra/llui/lltoolbar.h | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index a8149a9a1d..44f2c1efe9 100755 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -644,7 +644,7 @@ void LLButton::draw() // Cancel sticking of color, if the button is pressed, // or when a flashing of the previously selected button is ended if (mFlashingTimer - && ((selected && !mFlashingTimer->isFlashingInProgress()) || pressed)) + && ((selected && !mFlashingTimer->isFlashingInProgress() && !mForceFlashing) || pressed)) { mFlashing = false; } @@ -971,8 +971,9 @@ void LLButton::setToggleState(BOOL b) } } -void LLButton::setFlashing(bool b) +void LLButton::setFlashing(bool b, bool force_flashing/* = false */) { + mForceFlashing = force_flashing; if (mFlashingTimer) { mFlashing = b; diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 060db59a8a..7b4719866d 100755 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -201,7 +201,7 @@ public: void setToggleState(BOOL b); void setHighlight(bool b); - void setFlashing( bool b ); + void setFlashing( bool b, bool force_flashing = false ); BOOL getFlashing() const { return mFlashing; } LLFlashTimer* getFlashTimer() {return mFlashingTimer;} @@ -378,7 +378,7 @@ protected: LLFrameTimer mFrameTimer; LLFlashTimer * mFlashingTimer; - + bool mForceFlashing; // Stick flashing color even if button is pressed bool mHandleRightMouse; }; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 3d9f5cbbc2..928e82cb8c 100755 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -381,7 +381,7 @@ bool LLToolBar::stopCommandInProgress(const LLCommandId& commandId) return (command_button != NULL); } -bool LLToolBar::flashCommand(const LLCommandId& commandId, bool flash) +bool LLToolBar::flashCommand(const LLCommandId& commandId, bool flash, bool force_flashing/* = false */) { LLButton * command_button = NULL; @@ -391,7 +391,7 @@ bool LLToolBar::flashCommand(const LLCommandId& commandId, bool flash) if (it != mButtonMap.end()) { command_button = it->second; - command_button->setFlashing(flash ? TRUE : FALSE); + command_button->setFlashing((BOOL)(flash),(BOOL)(force_flashing)); } } diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 31424a36d4..743951a41f 100755 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -192,7 +192,7 @@ public: bool hasCommand(const LLCommandId& commandId) const; // is this command bound to a button in this toolbar bool enableCommand(const LLCommandId& commandId, bool enabled); // enable/disable button bound to the specified command, if it exists in this toolbar bool stopCommandInProgress(const LLCommandId& commandId); // stop command if it is currently active - bool flashCommand(const LLCommandId& commandId, bool flash); // flash button associated with given command, if in this toolbar + bool flashCommand(const LLCommandId& commandId, bool flash, bool force_flashing = false); // flash button associated with given command, if in this toolbar void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } // connects drag and drop behavior to external logic void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } -- cgit v1.2.3 From 882ab04ef3e412716f0f034e348007b5f3016f3c Mon Sep 17 00:00:00 2001 From: mberezhnoy Date: Thu, 13 Jun 2013 20:21:24 +0300 Subject: CHUI-809 (Right-click menu on user name in compat chat mode doesn't have "IM") Added callback for friendship checking --- indra/llui/lltextbase.cpp | 24 ++++++++++++++++++++++++ indra/llui/lltextbase.h | 6 ++++++ indra/llui/llurlaction.cpp | 8 ++++++++ indra/llui/llurlaction.h | 1 + indra/llui/llurlentry.cpp | 4 ++++ 5 files changed, 43 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index a53a38124c..e2a39d89e4 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -180,6 +180,7 @@ LLTextBase::Params::Params() LLTextBase::LLTextBase(const LLTextBase::Params &p) : LLUICtrl(p, LLTextViewModelPtr(new LLTextViewModel)), mURLClickSignal(NULL), + mIsFriendSignal(NULL), mMaxTextByteLength( p.max_text_length ), mFont(p.font), mFontShadow(p.font_shadow), @@ -1943,6 +1944,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) registrar.add("Url.Teleport", boost::bind(&LLUrlAction::teleportToLocation, url)); registrar.add("Url.ShowProfile", boost::bind(&LLUrlAction::showProfile, url)); registrar.add("Url.AddFriend", boost::bind(&LLUrlAction::addFriend, url)); + registrar.add("Url.RemoveFriend", boost::bind(&LLUrlAction::removeFriend, url)); registrar.add("Url.SendIM", boost::bind(&LLUrlAction::sendIM, url)); registrar.add("Url.ShowOnMap", boost::bind(&LLUrlAction::showLocationOnMap, url)); registrar.add("Url.CopyLabel", boost::bind(&LLUrlAction::copyLabelToClipboard, url)); @@ -1952,6 +1954,19 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) delete mPopupMenu; mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile(xui_file, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance()); + if (mIsFriendSignal) + { + bool isFriend = (*mIsFriendSignal)(LLUUID(LLUrlAction::getUserID(url))); + LLView* addFriendButton = mPopupMenu->getChild("add_friend"); + LLView* removeFriendButton = mPopupMenu->getChild("remove_friend"); + + if (addFriendButton && removeFriendButton) + { + addFriendButton->setEnabled(!isFriend); + removeFriendButton->setEnabled(isFriend); + } + } + if (mPopupMenu) { mPopupMenu->show(x, y); @@ -2932,6 +2947,15 @@ boost::signals2::connection LLTextBase::setURLClickedCallback(const commit_signa return mURLClickSignal->connect(cb); } +boost::signals2::connection LLTextBase::setIsFriendCallback(const is_friend_signal_t::slot_type& cb) +{ + if (!mIsFriendSignal) + { + mIsFriendSignal = new is_friend_signal_t(); + } + return mIsFriendSignal->connect(cb); +} + // // LLTextSegment // diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 2fb58d468a..a74e97cac8 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -258,6 +258,8 @@ public: friend class LLNormalTextSegment; friend class LLUICtrlFactory; + typedef boost::signals2::signal is_friend_signal_t; + struct LineSpacingParams : public LLInitParam::ChoiceBlock { Alternative multiple; @@ -434,6 +436,7 @@ public: virtual void appendImageSegment(const LLStyle::Params& style_params); virtual void appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo); boost::signals2::connection setURLClickedCallback(const commit_signal_t::slot_type& cb); + boost::signals2::connection setIsFriendCallback(const is_friend_signal_t::slot_type& cb); void setWordWrap(bool wrap); LLScrollContainer* getScrollContainer() const { return mScroller; } @@ -648,6 +651,9 @@ protected: // Fired when a URL link is clicked commit_signal_t* mURLClickSignal; + // Used to check if user with given ID is avatar's friend + is_friend_signal_t* mIsFriendSignal; + LLUIString mLabel; // text label that is visible when no user text provided }; diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index f51aeaec13..cf707d87dc 100755 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -188,3 +188,11 @@ void LLUrlAction::addFriend(std::string url) } } +void LLUrlAction::removeFriend(std::string url) +{ + std::string id_str = getUserID(url); + if (LLUUID::validate(id_str)) + { + executeSLURL("secondlife:///app/agent/" + id_str + "/removefriend"); + } +} diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index e31cd71a20..65283394a0 100755 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -79,6 +79,7 @@ public: static std::string getUserID(std::string url); static void sendIM(std::string url); static void addFriend(std::string url); + static void LLUrlAction::removeFriend(std::string url); /// specify the callbacks to enable this class's functionality typedef boost::function url_callback_t; diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 99ee688888..b1cc502c4b 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -504,6 +504,10 @@ std::string localize_slapp_label(const std::string& url, const std::string& full { return LLTrans::getString("SLappAgentRequestFriend") + " " + full_name; } + if (LLStringUtil::endsWith(url, "/removefriend")) + { + return LLTrans::getString("SLappAgentRemoveFriend") + " " + full_name; + } return full_name; } -- cgit v1.2.3 From 8d82ebc6c8682577060b1d0e960b3be810dacb39 Mon Sep 17 00:00:00 2001 From: "msavchenko@ubuntu" Date: Mon, 17 Jun 2013 15:10:38 -0700 Subject: Fixed build issue --- indra/llui/llurlaction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index 65283394a0..1984ec63e9 100755 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -79,7 +79,7 @@ public: static std::string getUserID(std::string url); static void sendIM(std::string url); static void addFriend(std::string url); - static void LLUrlAction::removeFriend(std::string url); + static void removeFriend(std::string url); /// specify the callbacks to enable this class's functionality typedef boost::function url_callback_t; -- cgit v1.2.3 From 2b8beeeff1485682e2b47f330dc8b3c24e966961 Mon Sep 17 00:00:00 2001 From: mberezhnoy Date: Thu, 20 Jun 2013 12:45:22 +0300 Subject: CHUI-809 (Right-click menu on user name in compat chat mode doesn't have "IM") Fixed "Add friend" option always being greyed out, add ability to block object via context menu in compact chat mode. --- indra/llui/lltextbase.cpp | 3 ++- indra/llui/llurlaction.cpp | 34 ++++++++++++++++++++++++++++++++++ indra/llui/llurlaction.h | 3 +++ 3 files changed, 39 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index e2a39d89e4..0276ade3e1 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1941,6 +1941,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) registrar.add("Url.OpenInternal", boost::bind(&LLUrlAction::openURLInternal, url)); registrar.add("Url.OpenExternal", boost::bind(&LLUrlAction::openURLExternal, url)); registrar.add("Url.Execute", boost::bind(&LLUrlAction::executeSLURL, url)); + registrar.add("Url.Block", boost::bind(&LLUrlAction::blockObject, url)); registrar.add("Url.Teleport", boost::bind(&LLUrlAction::teleportToLocation, url)); registrar.add("Url.ShowProfile", boost::bind(&LLUrlAction::showProfile, url)); registrar.add("Url.AddFriend", boost::bind(&LLUrlAction::addFriend, url)); @@ -1956,7 +1957,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) LLMenuHolderGL::child_registry_t::instance()); if (mIsFriendSignal) { - bool isFriend = (*mIsFriendSignal)(LLUUID(LLUrlAction::getUserID(url))); + bool isFriend = *(*mIsFriendSignal)(LLUUID(LLUrlAction::getUserID(url))); LLView* addFriendButton = mPopupMenu->getChild("add_friend"); LLView* removeFriendButton = mPopupMenu->getChild("remove_friend"); diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index cf707d87dc..d006209284 100755 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -170,6 +170,30 @@ std::string LLUrlAction::getUserID(std::string url) return id_str; } +std::string LLUrlAction::getObjectId(std::string url) +{ + LLURI uri(url); + LLSD path_array = uri.pathArray(); + std::string id_str; + if (path_array.size() >= 3) + { + id_str = path_array.get(2).asString(); + } + return id_str; +} + +std::string LLUrlAction::getObjectName(std::string url) +{ + LLURI uri(url); + LLSD query_map = uri.queryMap(); + std::string name; + if (query_map.has("name")) + { + name = query_map["name"]; + } + return name; +} + void LLUrlAction::sendIM(std::string url) { std::string id_str = getUserID(url); @@ -196,3 +220,13 @@ void LLUrlAction::removeFriend(std::string url) executeSLURL("secondlife:///app/agent/" + id_str + "/removefriend"); } } + +void LLUrlAction::blockObject(std::string url) +{ + std::string object_id = getObjectId(url); + std::string object_name = getObjectName(url); + if (LLUUID::validate(object_id)) + { + executeSLURL("secondlife:///app/agent/" + object_id + "/block/" + object_name); + } +} diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index 1984ec63e9..e731376b95 100755 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -77,9 +77,12 @@ public: /// if the Url specifies an SL command in the form like 'app/{cmd}/{id}/*', show its profile static void showProfile(std::string url); static std::string getUserID(std::string url); + static std::string getObjectName(std::string url); + static std::string getObjectId(std::string url); static void sendIM(std::string url); static void addFriend(std::string url); static void removeFriend(std::string url); + static void blockObject(std::string url); /// specify the callbacks to enable this class's functionality typedef boost::function url_callback_t; -- cgit v1.2.3 From 7d08262954c9638f2ec55414429a0d00ce77d5b3 Mon Sep 17 00:00:00 2001 From: mberezhnoy Date: Sat, 22 Jun 2013 02:49:25 +0300 Subject: build fix --- indra/llui/llurlaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index d006209284..23e574cb74 100755 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -189,7 +189,7 @@ std::string LLUrlAction::getObjectName(std::string url) std::string name; if (query_map.has("name")) { - name = query_map["name"]; + name = query_map["name"].asString(); } return name; } -- cgit v1.2.3 From d2386652f8a44c5adcc7fbcc65741649dd90aa2b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 25 Jul 2013 16:46:51 -0400 Subject: CHOP-962: Make LLControlVariable::setPersist() accept only enum. Initial change made LLControlVariable::mPersist an enum, but retained bool/BOOL public API. setPersist(true) set one value, setPersist(false) set another, forcePersist() set the third. Per code review, expose enum to public, make setPersist() (and LLControlVariable constructor, and LLControlGroup:: declareControl(), and all the LLControlGroup::declareMumble() methods, and all the unit-test dummy declareMumble() method bodies) accept that enum. Remove forcePersist(). Fix calls to LLControlGroup::declareMumble() accordingly. Also rename PERSIST_YES to PERSIST_NONDFT, also per code review. --- indra/llui/llfloaterreg.cpp | 12 ++++++------ indra/llui/llnotifications.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 1cdddf0d5b..b1b75776a7 100755 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -356,8 +356,8 @@ std::string LLFloaterReg::declareRectControl(const std::string& name) { std::string controlname = getRectControlName(name); LLFloater::getControlGroup()->declareRect(controlname, LLRect(), - llformat("Window Size for %s", name.c_str()), - TRUE); + llformat("Window Size for %s", name.c_str()), + LLControlVariable::PERSIST_NONDFT); return controlname; } @@ -367,7 +367,7 @@ std::string LLFloaterReg::declarePosXControl(const std::string& name) LLFloater::getControlGroup()->declareF32(controlname, 10.f, llformat("Window X Position for %s", name.c_str()), - TRUE); + LLControlVariable::PERSIST_NONDFT); return controlname; } @@ -377,7 +377,7 @@ std::string LLFloaterReg::declarePosYControl(const std::string& name) LLFloater::getControlGroup()->declareF32(controlname, 10.f, llformat("Window Y Position for %s", name.c_str()), - TRUE); + LLControlVariable::PERSIST_NONDFT); return controlname; } @@ -404,7 +404,7 @@ std::string LLFloaterReg::declareVisibilityControl(const std::string& name) std::string controlname = getVisibilityControlName(name); LLFloater::getControlGroup()->declareBOOL(controlname, FALSE, llformat("Window Visibility for %s", name.c_str()), - TRUE); + LLControlVariable::PERSIST_NONDFT); return controlname; } @@ -414,7 +414,7 @@ std::string LLFloaterReg::declareDockStateControl(const std::string& name) std::string controlname = getDockStateControlName(name); LLFloater::getControlGroup()->declareBOOL(controlname, TRUE, llformat("Window Docking state for %s", name.c_str()), - TRUE); + LLControlVariable::PERSIST_NONDFT); return controlname; } diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 1789f003b9..a1853ca1f7 100755 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -214,7 +214,7 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica } else { - LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Show notification with this name", TRUE); + LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Show notification with this name", LLControlVariable::PERSIST_NONDFT); mIgnoreSetting = LLUI::sSettingGroups["ignores"]->getControl(name); } } -- cgit v1.2.3 From e7bc0e6e6388481db1ef98407021f83870dc6351 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 14 Aug 2013 01:00:41 +0200 Subject: BUG-3605 / CHUIBUG-197 Don't create excessive amounts of string objects in LLNormalTextSegment::getNumChars. --- indra/llui/lltextbase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 0276ade3e1..3c284b3f03 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -3250,7 +3250,7 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin : LLFontGL::ONLY_WORD_BOUNDARIES; - LLWString offsetString(text.c_str() + segment_offset + mStart); + S32 offsetLength = text.length() - (segment_offset + mStart); if(getLength() < segment_offset + mStart) { @@ -3258,13 +3258,13 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << "\tmax_chars\t" << max_chars << llendl; } - if(offsetString.length() + 1 < max_chars) + if( (offsetLength + 1) < max_chars) { - llinfos << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetString.length():\t" << offsetString.length() << " getLength() : " + llinfos << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetLength:\t" << offsetLength << " getLength() : " << getLength() << "\tsegment_offset:\t" << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << llendl; } - S32 num_chars = mStyle->getFont()->maxDrawableChars(offsetString.c_str(), + S32 num_chars = mStyle->getFont()->maxDrawableChars( text.c_str() + (segment_offset + mStart), (F32)num_pixels, max_chars, word_wrap_style); -- cgit v1.2.3