From 1140ae3489a9e260a0abb808b4152f2d57384d67 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Thu, 29 Dec 2022 19:51:33 +0100 Subject: Add a texture inspector and show it when hovering over an inventory textory (or folder containing - among others - exactly one texture) and when hovering over notecard embedded textures --- indra/llui/llfolderview.cpp | 16 ++++++++++++++++ indra/llui/llfolderview.h | 5 +++++ indra/llui/llfolderviewitem.cpp | 12 +++++++++++- indra/llui/lltooltip.cpp | 36 +++++++++++++++++++++++++----------- indra/llui/lltooltip.h | 12 ++++++++++-- 5 files changed, 67 insertions(+), 14 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index ea2ca68e47..a6d4a2ae52 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1506,6 +1506,22 @@ BOOL LLFolderView::handleHover( S32 x, S32 y, MASK mask ) return LLView::handleHover( x, y, mask ); } +LLFolderViewItem* LLFolderView::getHoveredItem() const +{ + return dynamic_cast(mHoveredItem.get()); +} + +void LLFolderView::setHoveredItem(LLFolderViewItem* itemp) +{ + if (mHoveredItem.get() != itemp) + { + if (itemp) + mHoveredItem = itemp->getHandle(); + else + mHoveredItem.markDead(); + } +} + BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 6bb5e6c02e..bd38d93b33 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -144,6 +144,10 @@ public: // applies filters to control visibility of items virtual void filter( LLFolderViewFilter& filter); + void clearHoveredItem() { setHoveredItem(nullptr); } + LLFolderViewItem* getHoveredItem() const; + void setHoveredItem(LLFolderViewItem* itemp); + // Get the last selected item virtual LLFolderViewItem* getCurSelectedItem( void ); selected_items_t& getSelectedItems( void ); @@ -273,6 +277,7 @@ protected: protected: LLHandle mPopupMenuHandle; + LLHandle mHoveredItem; selected_items_t mSelectedItems; bool mKeyboardSelection, mAllowMultiSelect, diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index eba93beed9..d10130619a 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -624,11 +624,14 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) getWindow()->setCursor(UI_CURSOR_NOLOCKED); } + root->clearHoveredItem(); return TRUE; } else { - getRoot()->setShowSelectionContext(FALSE); + LLFolderView* pRoot = getRoot(); + pRoot->setHoveredItem(this); + pRoot->setShowSelectionContext(FALSE); getWindow()->setCursor(UI_CURSOR_ARROW); // let parent handle this then... return FALSE; @@ -683,6 +686,13 @@ BOOL LLFolderViewItem::handleMouseUp( S32 x, S32 y, MASK mask ) void LLFolderViewItem::onMouseLeave(S32 x, S32 y, MASK mask) { mIsMouseOverTitle = false; + + // NOTE: LLViewerWindow::updateUI() calls "enter" before "leave"; if the mouse moved to another item, we can't just outright clear it + LLFolderView* pRoot = getRoot(); + if (this == pRoot->getHoveredItem()) + { + pRoot->clearHoveredItem(); + } } BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 2f56a8b1d0..a6552d4ff1 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -163,6 +163,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) : LLPanel(p), mHasClickCallback(p.click_callback.isProvided()), mPadding(p.padding), + mMaxWidth(p.max_width), mTextBox(NULL), mInfoButton(NULL), mPlayMediaButton(NULL), @@ -272,7 +273,7 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p) // do this *after* we've had our size set in LLPanel::initFromParams(); const S32 REALLY_LARGE_HEIGHT = 10000; - mTextBox->reshape(p.max_width, REALLY_LARGE_HEIGHT); + mTextBox->reshape(mMaxWidth, REALLY_LARGE_HEIGHT); if (p.styled_message.isProvided()) { @@ -288,16 +289,19 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p) mTextBox->setText(p.message()); } - S32 text_width = llmin(p.max_width(), mTextBox->getTextPixelWidth() + 1); + updateTextBox(); + snapToChildren(); +} + +void LLToolTip::updateTextBox() +{ + S32 text_width = llmin(mMaxWidth, mTextBox->getTextPixelWidth() + 1); S32 text_height = mTextBox->getTextPixelHeight(); mTextBox->reshape(text_width, text_height); - if (mInfoButton) - { - LLRect text_rect = mTextBox->getRect(); - LLRect icon_rect = mInfoButton->getRect(); - mTextBox->translate(0, icon_rect.getCenterY() - text_rect.getCenterY()); - } - +} + +void LLToolTip::snapToChildren() +{ // reshape tooltip panel to fit text box LLRect tooltip_rect = calcBoundingRect(); tooltip_rect.mTop += mPadding; @@ -305,7 +309,14 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p) tooltip_rect.mBottom = 0; tooltip_rect.mLeft = 0; - mTextBox->reshape(mTextBox->getRect().getWidth(), llmax(mTextBox->getRect().getHeight(), tooltip_rect.getHeight() - 2 * mPadding)); + if (mInfoButton) + { + mTextBox->reshape(mTextBox->getRect().getWidth(), llmax(mTextBox->getRect().getHeight(), tooltip_rect.getHeight() - 2 * mPadding)); + + LLRect text_rect = mTextBox->getRect(); + LLRect icon_rect = mInfoButton->getRect(); + mInfoButton->translate(0, text_rect.getCenterY() - icon_rect.getCenterY()); + } setShape(tooltip_rect); } @@ -428,7 +439,10 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params) } tooltip_params.rect = LLRect (0, 1, 1, 0); - mToolTip = LLUICtrlFactory::create (tooltip_params); + if (tooltip_params.create_callback.isProvided()) + mToolTip = tooltip_params.create_callback()(tooltip_params); + else + mToolTip = LLUICtrlFactory::create (tooltip_params); gToolTipView->addChild(mToolTip); diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 0b1fbe5367..86943625ff 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -68,6 +68,7 @@ public: struct Params : public LLInitParam::Block { typedef boost::function click_callback_t; + typedef boost::function create_callback_t; Optional message; Multiple styled_message; @@ -84,6 +85,8 @@ public: Optional time_based_media, web_based_media, media_playing; + Optional create_callback; + Optional create_params; Optional click_callback, click_playmedia_callback, click_homepage_callback; @@ -103,11 +106,15 @@ public: bool hasClickCallback(); LLToolTip(const Params& p); - void initFromParams(const LLToolTip::Params& params); + virtual void initFromParams(const LLToolTip::Params& params); void getToolTipMessage(std::string & message); -private: +protected: + void updateTextBox(); + void snapToChildren(); + +protected: class LLTextBox* mTextBox; class LLButton* mInfoButton; class LLButton* mPlayMediaButton; @@ -117,6 +124,7 @@ private: LLFrameTimer mVisibleTimer; bool mHasClickCallback; S32 mPadding; // pixels + S32 mMaxWidth; }; // used for the inspector tooltips which need different background images etc. -- cgit v1.2.3 From 6ada89ce0b9372d6a7f49ac45bad6713ad5d3355 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 1 Feb 2023 00:35:22 +0200 Subject: SL-19117 Extend texture preview to show thumbnails when present --- indra/llui/llview.cpp | 20 ++++++++++++-------- indra/llui/llview.h | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 9ba71913d0..10e4755cd3 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -877,6 +877,17 @@ LLView* LLView::childFromPoint(S32 x, S32 y, bool recur) return 0; } +F32 LLView::getTooltipTimeout() +{ + static LLCachedControl tooltip_fast_delay(*LLUI::getInstance()->mSettingGroups["config"], "ToolTipFastDelay", 0.1f); + static LLCachedControl tooltip_delay(*LLUI::getInstance()->mSettingGroups["config"], "ToolTipDelay", 0.7f); + // allow "scrubbing" over ui by showing next tooltip immediately + // if previous one was still visible + return (F32)(LLToolTipMgr::instance().toolTipVisible() + ? tooltip_fast_delay + : tooltip_delay); +} + BOOL LLView::handleToolTip(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; @@ -886,14 +897,7 @@ BOOL LLView::handleToolTip(S32 x, S32 y, MASK mask) std::string tooltip = getToolTip(); if (!tooltip.empty()) { - static LLCachedControl tooltip_fast_delay(*LLUI::getInstance()->mSettingGroups["config"], "ToolTipFastDelay", 0.1f); - static LLCachedControl tooltip_delay(*LLUI::getInstance()->mSettingGroups["config"], "ToolTipDelay", 0.7f); static LLCachedControl allow_ui_tooltips(*LLUI::getInstance()->mSettingGroups["config"], "BasicUITooltips", true); - // allow "scrubbing" over ui by showing next tooltip immediately - // if previous one was still visible - F32 timeout = LLToolTipMgr::instance().toolTipVisible() - ? tooltip_fast_delay - : tooltip_delay; // Even if we don't show tooltips, consume the event, nothing below should show tooltip if (allow_ui_tooltips) @@ -901,7 +905,7 @@ BOOL LLView::handleToolTip(S32 x, S32 y, MASK mask) LLToolTipMgr::instance().show(LLToolTip::Params() .message(tooltip) .sticky_rect(calcScreenRect()) - .delay_time(timeout)); + .delay_time(getTooltipTimeout())); } handled = TRUE; } diff --git a/indra/llui/llview.h b/indra/llui/llview.h index bec45df78a..444a4c3cb5 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -243,6 +243,7 @@ public: ECursorType getHoverCursor() { return mHoverCursor; } + static F32 getTooltipTimeout(); virtual const std::string getToolTip() const { return mToolTipMsg.getString(); } void sendChildToFront(LLView* child); -- cgit v1.2.3 From db80fdb55b646164a71c58e9f4751b368afa3b9f Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 1 Feb 2023 23:56:42 +0200 Subject: SL-19104 update label and permissions display --- indra/llui/llfolderviewitem.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index d10130619a..5d08d62b4b 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -162,7 +162,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE); sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE); sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", DEFAULT_WHITE); - sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemColor", DEFAULT_WHITE); + sSuffixColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE); sColorSetInitialized = true; } @@ -395,7 +395,7 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height ) // it is purely visual, so it is fine to do at our laisure refreshSuffix(); } - mLabelWidth = getLabelXPos() + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix) + mLabelPaddingRight; + mLabelWidth = getLabelXPos() + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(LLFontGL::NORMAL)->getWidth(mLabelSuffix) + mLabelPaddingRight; mLabelWidthDirty = false; } @@ -961,7 +961,8 @@ void LLFolderViewItem::draw() // if (!mLabelSuffix.empty()) { - font->renderUTF8( mLabelSuffix, 0, right_x, y, isFadeItem() ? color : (LLColor4)sSuffixColor, + const LLFontGL* suffix_font = getLabelFontForStyle(LLFontGL::NORMAL); + suffix_font->renderUTF8( mLabelSuffix, 0, right_x, y, isFadeItem() ? color : (LLColor4)sSuffixColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &right_x, FALSE ); } -- cgit v1.2.3 From 2d6edb088e185fe1116c29fd028e9019ffe53607 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 3 Feb 2023 22:22:11 +0200 Subject: SL-19149 Highlight string match is misplaced when searching worn items --- indra/llui/llfolderviewitem.cpp | 65 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 5d08d62b4b..115cfcf3a0 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -935,16 +935,43 @@ void LLFolderViewItem::draw() F32 text_left = (F32)getLabelXPos(); std::string combined_string = mLabel + mLabelSuffix; + const LLFontGL* suffix_font = getLabelFontForStyle(LLFontGL::NORMAL); + S32 filter_offset = mViewModelItem->getFilterStringOffset(); if (filter_string_length > 0) { - S32 left = ll_round(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2; + S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD); + S32 top = getRect().getHeight() - TOP_PAD; + if(mLabelSuffix.empty() || (font == suffix_font)) + { + S32 left = ll_round(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2; S32 right = left + font->getWidth(combined_string, mViewModelItem->getFilterStringOffset(), filter_string_length) + 2; - S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD); - S32 top = getRect().getHeight() - TOP_PAD; LLUIImage* box_image = default_params.selection_image; LLRect box_rect(left, top, right, bottom); box_image->draw(box_rect, sFilterBGColor); + } + else + { + S32 label_filter_length = llmin((S32)mLabel.size() - filter_offset, (S32)filter_string_length); + if(label_filter_length > 0) + { + S32 left = ll_round(text_left) + font->getWidthF32(mLabel, 0, llmin(filter_offset, (S32)mLabel.size())) - 2; + S32 right = left + font->getWidthF32(mLabel, filter_offset, label_filter_length) + 2; + LLUIImage* box_image = default_params.selection_image; + LLRect box_rect(left, top, right, bottom); + box_image->draw(box_rect, sFilterBGColor); + } + S32 suffix_filter_length = label_filter_length > 0 ? filter_string_length - label_filter_length : filter_string_length; + if(suffix_filter_length > 0) + { + S32 suffix_offset = llmax(0, filter_offset - (S32)mLabel.size()); + S32 left = ll_round(text_left) + font->getWidthF32(mLabel, 0, mLabel.size()) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset) - 2; + S32 right = left + suffix_font->getWidthF32(mLabelSuffix, suffix_offset, suffix_filter_length) + 2; + LLUIImage* box_image = default_params.selection_image; + LLRect box_rect(left, top, right, bottom); + box_image->draw(box_rect, sFilterBGColor); + } + } } LLColor4 color = (mIsSelected && filled) ? mFontHighlightColor : mFontColor; @@ -961,7 +988,6 @@ void LLFolderViewItem::draw() // if (!mLabelSuffix.empty()) { - const LLFontGL* suffix_font = getLabelFontForStyle(LLFontGL::NORMAL); suffix_font->renderUTF8( mLabelSuffix, 0, right_x, y, isFadeItem() ? color : (LLColor4)sSuffixColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &right_x, FALSE ); @@ -972,12 +998,35 @@ void LLFolderViewItem::draw() // if (filter_string_length > 0) { - S32 filter_offset = mViewModelItem->getFilterStringOffset(); - F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, filter_offset + filter_string_length) - font->getWidthF32(combined_string, filter_offset, filter_string_length); - F32 yy = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD; - font->renderUTF8( combined_string, filter_offset, match_string_left, yy, + if(mLabelSuffix.empty() || (font == suffix_font)) + { + F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, filter_offset + filter_string_length) - font->getWidthF32(combined_string, filter_offset, filter_string_length); + F32 yy = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD; + font->renderUTF8( combined_string, filter_offset, match_string_left, yy, sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, filter_string_length, S32_MAX, &right_x, FALSE ); + } + else + { + S32 label_filter_length = llmin((S32)mLabel.size() - filter_offset, (S32)filter_string_length); + if(label_filter_length > 0) + { + F32 match_string_left = text_left + font->getWidthF32(mLabel, 0, filter_offset + label_filter_length) - font->getWidthF32(mLabel, filter_offset, label_filter_length); + F32 yy = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD; + font->renderUTF8( mLabel, filter_offset, match_string_left, yy, + sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, label_filter_length, S32_MAX, &right_x, FALSE ); + } + + S32 suffix_filter_length = label_filter_length > 0 ? filter_string_length - label_filter_length : filter_string_length; + if(suffix_filter_length > 0) + { + S32 suffix_offset = llmax(0, filter_offset - (S32)mLabel.size()); + F32 match_string_left = text_left + font->getWidthF32(mLabel, 0, mLabel.size()) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset + suffix_filter_length) - suffix_font->getWidthF32(mLabelSuffix, suffix_offset, suffix_filter_length); + F32 yy = (F32)getRect().getHeight() - suffix_font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD; + suffix_font->renderUTF8( mLabelSuffix, suffix_offset, match_string_left, yy, sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, suffix_filter_length, S32_MAX, &right_x, FALSE ); + } + } + } //Gilbert Linden 9-20-2012: Although this should be legal, removing it because it causes the mLabelSuffix rendering to -- cgit v1.2.3 From 627c7de801bcf1f2a706c2c077a3fecf54a3bfe8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 7 Feb 2023 12:36:20 +0200 Subject: SL-19134 Some texture related adjustments --- indra/llui/lliconctrl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index 9c3b517bca..b5aad17ca6 100644 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -39,7 +39,9 @@ class LLUICtrlFactory; // Classes // -// +// Class for diplaying named UI textures +// Do not use for displaying textures from network, +// UI textures are stored permanently! class LLIconCtrl : public LLUICtrl { -- cgit v1.2.3 From 734b1b5d421254c45b3eb0fe0a5bbc8159e489fc Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 17 Feb 2023 15:47:03 +0200 Subject: SL-19105 WIP Single-folder inventory view --- indra/llui/llfolderview.h | 2 ++ indra/llui/llfolderviewitem.cpp | 24 +++++++++++++++++++++--- indra/llui/llfolderviewitem.h | 2 ++ indra/llui/llfolderviewmodel.h | 2 ++ 4 files changed, 27 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 237239c5d1..fbd8522b19 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -246,6 +246,8 @@ public: void dumpSelectionInformation(); virtual S32 notify(const LLSD& info) ; + + void setShowEmptyMessage(bool show_msg) { mShowEmptyMessage = show_msg; } bool useLabelSuffix() { return mUseLabelSuffix; } virtual void updateMenu(); diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 115cfcf3a0..c7e47e26e0 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -113,6 +113,7 @@ LLFolderViewItem::Params::Params() icon_width("icon_width", 0), text_pad("text_pad", 0), text_pad_right("text_pad_right", 0), + single_folder_mode("single_folder_mode", false), arrow_size("arrow_size", 0), max_folder_item_overlap("max_folder_item_overlap", 0) { } @@ -151,6 +152,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mTextPad(p.text_pad), mTextPadRight(p.text_pad_right), mArrowSize(p.arrow_size), + mSingleFolderMode(p.single_folder_mode), mMaxFolderItemOverlap(p.max_folder_item_overlap) { if (!sColorSetInitialized) @@ -899,7 +901,10 @@ void LLFolderViewItem::draw() getViewModelItem()->update(); - drawOpenFolderArrow(default_params, sFgColor); + if(!mSingleFolderMode) + { + drawOpenFolderArrow(default_params, sFgColor); + } drawHighlight(show_context, filled, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); @@ -1830,7 +1835,14 @@ void LLFolderViewFolder::toggleOpen() // Force a folder open or closed void LLFolderViewFolder::setOpen(BOOL openitem) { - setOpenArrangeRecursively(openitem); + if(mSingleFolderMode) + { + getViewModelItem()->navigateToFolder(); + } + else + { + setOpenArrangeRecursively(openitem); + } } void LLFolderViewFolder::setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse) @@ -2033,7 +2045,8 @@ BOOL LLFolderViewFolder::handleMouseDown( S32 x, S32 y, MASK mask ) } if( !handled ) { - if(mIndentation < x && x < mIndentation + (isCollapsed() ? 0 : mArrowSize) + mTextPad) + if((mIndentation < x && x < mIndentation + (isCollapsed() ? 0 : mArrowSize) + mTextPad) + && !mSingleFolderMode) { toggleOpen(); handled = TRUE; @@ -2051,6 +2064,11 @@ BOOL LLFolderViewFolder::handleMouseDown( S32 x, S32 y, MASK mask ) BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask ) { BOOL handled = FALSE; + if(mSingleFolderMode) + { + getViewModelItem()->navigateToFolder(); + return TRUE; + } if( isOpen() ) { handled = childrenHandleDoubleClick( x, y, mask ) != NULL; diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index ee20d048fd..fe751be6b9 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -72,6 +72,7 @@ public: text_pad_right, arrow_size, max_folder_item_overlap; + Optional single_folder_mode; Params(); }; @@ -121,6 +122,7 @@ protected: mIsMouseOverTitle, mAllowWear, mAllowDrop, + mSingleFolderMode, mSelectPending, mIsItemCut; diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index c5e027d314..7a18ed4a45 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -159,6 +159,8 @@ public: virtual void openItem( void ) = 0; virtual void closeItem( void ) = 0; virtual void selectItem(void) = 0; + + virtual void navigateToFolder() = 0; virtual BOOL isItemWearable() const { return FALSE; } -- cgit v1.2.3 From 4f5d7f12563f1829856023d6967507fe783bbe5e Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 20 Feb 2023 18:42:46 +0200 Subject: SL-19105 WIP Allow setting on_visible in XML for menu separator --- indra/llui/llmenugl.cpp | 17 +++++++++++++---- indra/llui/llmenugl.h | 9 ++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 5cb840fd61..35f2930800 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -576,13 +576,13 @@ void LLMenuItemGL::onVisibilityChange(BOOL new_visibility) // // This class represents a separator. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LLMenuItemSeparatorGL::Params::Params() -{ -} - LLMenuItemSeparatorGL::LLMenuItemSeparatorGL(const LLMenuItemSeparatorGL::Params& p) : LLMenuItemGL( p ) { + if (p.on_visible.isProvided()) + { + mVisibleSignal.connect(initEnableCallback(p.on_visible)); + } } //virtual @@ -599,6 +599,15 @@ void LLMenuItemSeparatorGL::draw( void ) gl_line_2d( PAD, y, getRect().getWidth() - PAD, y ); } +void LLMenuItemSeparatorGL::buildDrawLabel( void ) +{ + if (mVisibleSignal.num_slots() > 0) + { + bool visible = mVisibleSignal(this, LLSD()); + setVisible(visible); + } +} + BOOL LLMenuItemSeparatorGL::handleMouseDown(S32 x, S32 y, MASK mask) { LLMenuGL* parent_menu = getMenu(); diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index f84c4d41eb..47a46510b3 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -234,7 +234,9 @@ class LLMenuItemSeparatorGL : public LLMenuItemGL public: struct Params : public LLInitParam::Block { - Params(); + Optional on_visible; + Params() : on_visible("on_visible") + {} }; LLMenuItemSeparatorGL(const LLMenuItemSeparatorGL::Params& p = LLMenuItemSeparatorGL::Params()); @@ -243,7 +245,12 @@ public: /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + virtual void buildDrawLabel(); + /*virtual*/ U32 getNominalHeight( void ) const; + +private: + enable_signal_t mVisibleSignal; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3 From 49da5288bd0425241823186bfd56a159fe2f9a60 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 24 Feb 2023 03:05:30 +0200 Subject: SL-19234 add Inventory settings floater --- indra/llui/llfolderviewitem.cpp | 10 +++++++++- indra/llui/llfolderviewmodel.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index c7e47e26e0..4a9ac56d9f 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -2066,15 +2066,23 @@ BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask ) BOOL handled = FALSE; if(mSingleFolderMode) { - getViewModelItem()->navigateToFolder(); + static LLUICachedControl double_click_new_window("SingleModeDoubleClickOpenWindow", false); + getViewModelItem()->navigateToFolder(double_click_new_window); return TRUE; } + if( isOpen() ) { handled = childrenHandleDoubleClick( x, y, mask ) != NULL; } if( !handled ) { + static LLUICachedControl double_click_new_window("MultiModeDoubleClickOpenWindow", false); + if (double_click_new_window) + { + getViewModelItem()->navigateToFolder(true); + return TRUE; + } if(mIndentation < x && x < mIndentation + (isCollapsed() ? 0 : mArrowSize) + mTextPad) { // don't select when user double-clicks plus sign diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 7a18ed4a45..b1db9489fd 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -160,7 +160,7 @@ public: virtual void closeItem( void ) = 0; virtual void selectItem(void) = 0; - virtual void navigateToFolder() = 0; + virtual void navigateToFolder(bool new_window = false) = 0; virtual BOOL isItemWearable() const { return FALSE; } -- cgit v1.2.3 From f377e27f0b8ddabf755c6efe71d6bc0e53e751c1 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 27 Feb 2023 20:27:11 +0200 Subject: SL-19274 Add new double-click option to Inventory settings --- indra/llui/llfolderviewitem.cpp | 9 +++++++-- indra/llui/llfolderviewmodel.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 4a9ac56d9f..6ddbf26639 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -2077,11 +2077,16 @@ BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask ) } if( !handled ) { - static LLUICachedControl double_click_new_window("MultiModeDoubleClickOpenWindow", false); - if (double_click_new_window) + static LLUICachedControl double_click_action("MultiModeDoubleClickFolder", false); + if (double_click_action == 1) { getViewModelItem()->navigateToFolder(true); return TRUE; + } + if (double_click_action == 2) + { + getViewModelItem()->navigateToFolder(false, true); + return TRUE; } if(mIndentation < x && x < mIndentation + (isCollapsed() ? 0 : mArrowSize) + mTextPad) { diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index b1db9489fd..b5a765fab3 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -160,7 +160,7 @@ public: virtual void closeItem( void ) = 0; virtual void selectItem(void) = 0; - virtual void navigateToFolder(bool new_window = false) = 0; + virtual void navigateToFolder(bool new_window = false, bool change_mode = false) = 0; virtual BOOL isItemWearable() const { return FALSE; } -- cgit v1.2.3 From b14221966717afc1c4102f8091ec469ee20febcb Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 1 Mar 2023 21:30:42 +0200 Subject: SL-19288 Change item label suffix color to grey --- indra/llui/llfolderviewitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 6ddbf26639..6d2c346f76 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -164,7 +164,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE); sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE); sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", DEFAULT_WHITE); - sSuffixColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); + sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemLinkColor", DEFAULT_WHITE); sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE); sColorSetInitialized = true; } -- cgit v1.2.3 From c74658b19b1ac28d5bf240e940a7ad97ff034e3c Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 2 Mar 2023 20:54:33 +0200 Subject: SL-19310 Update navigation buttons in single-folder view --- indra/llui/llfolderview.cpp | 5 +++++ indra/llui/llfolderviewitem.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 5170816671..46a7057240 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1273,6 +1273,11 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) if(mSelectedItems.size()) { LLFolderViewItem* last_selected = getCurSelectedItem(); + if(last_selected && last_selected->isSingleFolderMode()) + { + handled = FALSE; + break; + } LLFolderViewItem* parent_folder = last_selected->getParentFolder(); if (!last_selected->isOpen() && parent_folder && parent_folder->getParentFolder()) { diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index fe751be6b9..aa9ed0a1e8 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -279,6 +279,8 @@ public: // Does not need filter update virtual void refreshSuffix(); + bool isSingleFolderMode() { return mSingleFolderMode; } + // LLView functionality virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); -- cgit v1.2.3 From 783a802abc63efd3b55d5b38c76c03d87d47bf75 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 8 Mar 2023 02:41:11 +0200 Subject: SL-19359 Show Received Items panel in all new Inventory floaters --- indra/llui/lluictrl.cpp | 9 +++++++++ indra/llui/lluictrl.h | 1 + 2 files changed, 10 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 2196ba201b..21afcae7c3 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -531,6 +531,15 @@ void LLUICtrl::setControlVariable(LLControlVariable* control) } } +void LLUICtrl::removeControlVariable() +{ + if (mControlVariable) + { + mControlConnection.disconnect(); + mControlVariable = NULL; + } +} + //virtual void LLUICtrl::setControlName(const std::string& control_name, LLView *context) { diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 67dd24341c..be1c7dd0b6 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -175,6 +175,7 @@ public: bool setControlValue(const LLSD& value); void setControlVariable(LLControlVariable* control); virtual void setControlName(const std::string& control, LLView *context = NULL); + void removeControlVariable(); LLControlVariable* getControlVariable() { return mControlVariable; } -- cgit v1.2.3 From 3c54d6a0371377f65c8eaa7eafffee0decdf4cbf Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 13 Mar 2023 12:40:52 +0200 Subject: SL-19386 Double click to open Single folder view should affect only Inventory --- indra/llui/llfolderviewitem.cpp | 25 +++++++++++++++---------- indra/llui/llfolderviewitem.h | 4 +++- 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 6d2c346f76..227f1d79e4 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -114,6 +114,7 @@ LLFolderViewItem::Params::Params() text_pad("text_pad", 0), text_pad_right("text_pad_right", 0), single_folder_mode("single_folder_mode", false), + double_click_override("double_click_override", false), arrow_size("arrow_size", 0), max_folder_item_overlap("max_folder_item_overlap", 0) { } @@ -153,7 +154,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mTextPadRight(p.text_pad_right), mArrowSize(p.arrow_size), mSingleFolderMode(p.single_folder_mode), - mMaxFolderItemOverlap(p.max_folder_item_overlap) + mMaxFolderItemOverlap(p.max_folder_item_overlap), + mDoubleClickOverride(p.double_click_override) { if (!sColorSetInitialized) { @@ -2077,16 +2079,19 @@ BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask ) } if( !handled ) { - static LLUICachedControl double_click_action("MultiModeDoubleClickFolder", false); - if (double_click_action == 1) + if(mDoubleClickOverride) { - getViewModelItem()->navigateToFolder(true); - return TRUE; - } - if (double_click_action == 2) - { - getViewModelItem()->navigateToFolder(false, true); - return TRUE; + static LLUICachedControl double_click_action("MultiModeDoubleClickFolder", false); + if (double_click_action == 1) + { + getViewModelItem()->navigateToFolder(true); + return TRUE; + } + if (double_click_action == 2) + { + getViewModelItem()->navigateToFolder(false, true); + return TRUE; + } } if(mIndentation < x && x < mIndentation + (isCollapsed() ? 0 : mArrowSize) + mTextPad) { diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index aa9ed0a1e8..b6437ab61d 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -72,7 +72,8 @@ public: text_pad_right, arrow_size, max_folder_item_overlap; - Optional single_folder_mode; + Optional single_folder_mode, + double_click_override; Params(); }; @@ -123,6 +124,7 @@ protected: mAllowWear, mAllowDrop, mSingleFolderMode, + mDoubleClickOverride, mSelectPending, mIsItemCut; -- cgit v1.2.3 From 58092382269eb8dc48fb30734ee3738f7385f8da Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 4 Apr 2023 16:38:53 +0300 Subject: SL-19273 Show empty folder message for empty folders regardless of filter state --- indra/llui/llfolderview.cpp | 2 +- indra/llui/llfolderviewmodel.cpp | 4 ++-- indra/llui/llfolderviewmodel.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 46a7057240..734a7599aa 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -665,7 +665,7 @@ void LLFolderView::draw() } else if (mShowEmptyMessage) { - mStatusTextBox->setValue(getFolderViewModel()->getStatusText()); + mStatusTextBox->setValue(getFolderViewModel()->getStatusText(mItems.empty() && mFolders.empty())); mStatusTextBox->setVisible( TRUE ); // firstly reshape message textbox with current size. This is necessary to diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp index 93122503d1..f217b743a0 100644 --- a/indra/llui/llfolderviewmodel.cpp +++ b/indra/llui/llfolderviewmodel.cpp @@ -34,7 +34,7 @@ bool LLFolderViewModelCommon::needsSort(LLFolderViewModelItem* item) return item->getSortVersion() < mTargetSortVersion; } -std::string LLFolderViewModelCommon::getStatusText() +std::string LLFolderViewModelCommon::getStatusText(bool is_empty_folder) { if (!contentsReady() || mFolderView->getViewModelItem()->getLastFilterGeneration() < getFilter().getCurrentGeneration()) { @@ -42,7 +42,7 @@ std::string LLFolderViewModelCommon::getStatusText() } else { - return getFilter().getEmptyLookupMessage(); + return getFilter().getEmptyLookupMessage(is_empty_folder); } } diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index b5a765fab3..551a60e097 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -69,7 +69,7 @@ public: virtual bool checkFolder(const LLFolderViewModelItem* folder) const = 0; virtual void setEmptyLookupMessage(const std::string& message) = 0; - virtual std::string getEmptyLookupMessage() const = 0; + virtual std::string getEmptyLookupMessage(bool is_empty_folder = false) const = 0; virtual bool showAllResults() const = 0; @@ -125,7 +125,7 @@ public: virtual void setFolderView(LLFolderView* folder_view) = 0; virtual LLFolderViewFilter& getFilter() = 0; virtual const LLFolderViewFilter& getFilter() const = 0; - virtual std::string getStatusText() = 0; + virtual std::string getStatusText(bool is_empty_folder = false) = 0; virtual bool startDrag(std::vector& items) = 0; }; @@ -394,7 +394,7 @@ public: // sort everything mTargetSortVersion++; } - virtual std::string getStatusText(); + virtual std::string getStatusText(bool is_empty_folder = false); virtual void filter(); void setFolderView(LLFolderView* folder_view) { mFolderView = folder_view;} -- cgit v1.2.3 From bdd4cb5963df9550eb8e9c0bca0eff0010b44b1e Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 12 Apr 2023 19:11:59 +0300 Subject: SL-19544 WIP show drag handler control --- indra/llui/lllayoutstack.cpp | 8 +++++--- indra/llui/lllayoutstack.h | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 77938edf27..8a011b4890 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -214,7 +214,8 @@ LLLayoutStack::Params::Params() 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) + drag_handle_shift("drag_handle_shift", 2), + drag_handle_color("drag_handle_color", LLUIColorTable::instance().getColor("ResizebarBody")) { addSynonym(border_size, "drag_handle_gap"); } @@ -234,7 +235,8 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mDragHandleFirstIndent(p.drag_handle_first_indent), mDragHandleSecondIndent(p.drag_handle_second_indent), mDragHandleThickness(p.drag_handle_thickness), - mDragHandleShift(p.drag_handle_shift) + mDragHandleShift(p.drag_handle_shift), + mDragHandleColor(p.drag_handle_color()) { } @@ -561,7 +563,7 @@ void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp) resize_bar_bg_panel_p.follows.flags = FOLLOWS_ALL; resize_bar_bg_panel_p.tab_stop = false; resize_bar_bg_panel_p.background_visible = true; - resize_bar_bg_panel_p.bg_alpha_color = LLUIColorTable::instance().getColor("ResizebarBody"); + resize_bar_bg_panel_p.bg_alpha_color = mDragHandleColor; resize_bar_bg_panel_p.has_border = true; resize_bar_bg_panel_p.border.border_thickness = 1; resize_bar_bg_panel_p.border.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderLight"); diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index f772dbc6b4..9a53a7f787 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -59,6 +59,8 @@ public: Optional drag_handle_thickness; Optional drag_handle_shift; + Optional drag_handle_color; + Params(); }; @@ -127,6 +129,7 @@ private: S32 mDragHandleSecondIndent; S32 mDragHandleThickness; S32 mDragHandleShift; + LLUIColor mDragHandleColor; }; // end class LLLayoutStack -- cgit v1.2.3 From 37530c9d736d90ec29b97e3567346a02e2826f97 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 12 Apr 2023 21:11:36 +0300 Subject: SL-19544 WIP hide inventory pane in Combination view, if there is no visible items --- indra/llui/llfolderview.cpp | 5 +++-- indra/llui/llfolderview.h | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 734a7599aa..14985c6bad 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -189,7 +189,8 @@ LLFolderView::LLFolderView(const Params& p) mStatusTextBox(NULL), mShowItemLinkOverlays(p.show_item_link_overlays), mViewModel(p.view_model), - mGroupedItemModel(p.grouped_item_model) + mGroupedItemModel(p.grouped_item_model), + mForceArrange(false) { LLPanel* panel = p.parent_panel; mParentPanel = panel->getHandle(); @@ -1736,7 +1737,7 @@ void LLFolderView::update() mNeedsAutoSelect = FALSE; } - BOOL is_visible = isInVisibleChain(); + BOOL is_visible = isInVisibleChain() || mForceArrange; //Puts folders/items in proper positions // arrange() takes the model filter flag into account and call sort() if necessary (CHUI-849) diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index fbd8522b19..f19df1d0dc 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -241,6 +241,8 @@ public: void setCallbackRegistrar(LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* registrar) { mCallbackRegistrar = registrar; } void setEnableRegistrar(LLUICtrl::EnableCallbackRegistry::ScopedRegistrar* registrar) { mEnableRegistrar = registrar; } + void setForceArrange(bool force) { mForceArrange = force; } + LLPanel* getParentPanel() { return mParentPanel.get(); } // DEBUG only void dumpSelectionInformation(); @@ -337,6 +339,8 @@ protected: LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* mCallbackRegistrar; LLUICtrl::EnableCallbackRegistry::ScopedRegistrar* mEnableRegistrar; + + bool mForceArrange; public: static F32 sAutoOpenTime; -- cgit v1.2.3 From eaf95d084a585c8a0a9ac086679487fa40e1db71 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 6 May 2023 03:17:45 +0300 Subject: SL-19689 In combination view 'raname' field doesn't update position properly --- indra/llui/llfolderview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index f19df1d0dc..22b8c475ec 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -255,13 +255,13 @@ public: virtual void updateMenu(); void finishRenamingItem( void ); + void updateRenamerPosition(); // Note: We may eventually have to move that method up the hierarchy to LLFolderViewItem. LLHandle getHandle() const { return getDerivedHandle(); } private: void updateMenuOptions(LLMenuGL* menu); - void updateRenamerPosition(); protected: LLScrollContainer* mScrollContainer; // NULL if this is not a child of a scroll container. -- cgit v1.2.3 From 077841420cb1264b3a096f473f5005d83de94519 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 12 May 2023 16:35:27 +0300 Subject: SL-19649 reduce logging out time for larger inventories --- indra/llui/llview.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 10e4755cd3..a2f18daa12 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -576,8 +576,10 @@ void LLView::deleteAllChildren() while (!mChildList.empty()) { - LLView* viewp = mChildList.front(); - delete viewp; // will remove the child from mChildList + LLView* viewp = mChildList.front(); + viewp->mParentView = NULL; + delete viewp; + mChildList.pop_front(); } } -- cgit v1.2.3 From 17e18aa9bfa095e8b41c1c0e45c5757101a3f710 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 12 May 2023 16:55:12 +0300 Subject: SL-19649 add missing update --- indra/llui/llview.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index a2f18daa12..7720c4ad14 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -581,6 +581,7 @@ void LLView::deleteAllChildren() delete viewp; mChildList.pop_front(); } + updateBoundingRect(); } void LLView::setAllChildrenEnabled(BOOL b) -- cgit v1.2.3 From 6e2e9d5904b3cc89deb755f3552d915104065aa0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 12 May 2023 18:26:02 +0300 Subject: SL-19649 Adjust other classes for new deleteAllChildren mechanics --- indra/llui/lllayoutstack.cpp | 19 ++++++++++++++++--- indra/llui/lllayoutstack.h | 1 + indra/llui/llmenugl.cpp | 7 +++++++ indra/llui/llmenugl.h | 1 + 4 files changed, 25 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 8a011b4890..08ce31ffc5 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -284,6 +284,17 @@ void LLLayoutStack::draw() } } +void LLLayoutStack::deleteAllChildren() +{ + mPanels.clear(); + LLView::deleteAllChildren(); + + // Not really needed since nothing is left to + // display, but for the sake of consistency + updateFractionalSizes(); + mNeedsLayout = true; +} + void LLLayoutStack::removeChild(LLView* view) { LLLayoutPanel* embedded_panelp = findEmbeddedPanel(dynamic_cast(view)); @@ -291,12 +302,14 @@ void LLLayoutStack::removeChild(LLView* view) if (embedded_panelp) { mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp)); - delete embedded_panelp; + LLView::removeChild(view); updateFractionalSizes(); mNeedsLayout = true; } - - LLView::removeChild(view); + else + { + LLView::removeChild(view); + } } BOOL LLLayoutStack::postBuild() diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 9a53a7f787..02685281ef 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -69,6 +69,7 @@ public: virtual ~LLLayoutStack(); /*virtual*/ void draw(); + /*virtual*/ void deleteAllChildren(); /*virtual*/ void removeChild(LLView*); /*virtual*/ BOOL postBuild(); /*virtual*/ bool addChild(LLView* child, S32 tab_group = 0); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 35f2930800..1666ff8c98 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1891,6 +1891,13 @@ bool LLMenuGL::addContextChild(LLView* view, S32 tab_group) return false; } + +void LLMenuGL::deleteAllChildren() +{ + mItems.clear(); + LLUICtrl::deleteAllChildren(); +} + void LLMenuGL::removeChild( LLView* ctrl) { // previously a dynamic_cast with if statement to check validity diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 47a46510b3..87e3f18ebc 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -449,6 +449,7 @@ public: /*virtual*/ void drawBackground(LLMenuItemGL* itemp, F32 alpha); /*virtual*/ void setVisible(BOOL visible); /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0); + /*virtual*/ void deleteAllChildren(); /*virtual*/ void removeChild( LLView* ctrl); /*virtual*/ BOOL postBuild(); -- cgit v1.2.3 From 4d3a8f4a6cd2bef58bc95854af0325ca0190351f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 12 May 2023 22:15:56 +0300 Subject: SL-19649 Don't update bounding rect excesively --- indra/llui/llview.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 7720c4ad14..da7868d804 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -311,7 +311,13 @@ bool LLView::addChild(LLView* child, S32 tab_group) } child->mParentView = this; - updateBoundingRect(); + if (getVisible() && child->getVisible()) + { + // if child isn't visible it won't affect bounding rect + // if current view is not visible it will be recalculated + // on visibility change + updateBoundingRect(); + } mLastTabGroup = tab_group; return true; } -- cgit v1.2.3 From 474012abd603f7e7963344fcd9d14cdc7db7bb9a Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 16 May 2023 18:03:57 +0300 Subject: SL-19686 reduce delay when switching between folders --- indra/llui/llfolderviewitem.cpp | 5 +++++ indra/llui/llfolderviewitem.h | 1 + 2 files changed, 6 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 227f1d79e4..bc7a2cc3f0 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -1769,6 +1769,11 @@ BOOL LLFolderViewFolder::isRemovable() return TRUE; } +void LLFolderViewFolder::destroyRoot() +{ + delete this; +} + // this is an internal method used for adding items to folders. void LLFolderViewFolder::addItem(LLFolderViewItem* item) { diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index b6437ab61d..232780ccae 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -394,6 +394,7 @@ public: // destroys this folder, and all children virtual void destroyView(); + void destroyRoot(); // whether known children are fully loaded (arrange sets to true) virtual bool isFolderComplete() { return mIsFolderComplete; } -- cgit v1.2.3 From 706d8f17273f4718a2adf5a43c1de5a1dc08abad Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 18 May 2023 22:22:07 +0300 Subject: SL-19732 Fix folder's thumbnail from sticking over folder's content --- indra/llui/llfolderview.cpp | 2 +- indra/llui/llfolderview.h | 2 +- indra/llui/llfolderviewitem.cpp | 2 +- indra/llui/llfolderviewitem.h | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 9fa8a84fa4..bf6f2436b1 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -2064,7 +2064,7 @@ LLFolderViewItem* LLFolderView::getNextUnselectedItem() return new_selection; } -S32 LLFolderView::getItemHeight() +S32 LLFolderView::getItemHeight() const { if(!hasVisibleChildren()) { diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 22b8c475ec..73028f31b1 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -136,7 +136,7 @@ public: // Find width and height of this object and its children. Also // makes sure that this view and its children are the right size. virtual S32 arrange( S32* width, S32* height ); - virtual S32 getItemHeight(); + virtual S32 getItemHeight() const; void arrangeAll() { mArrangeGeneration++; } S32 getArrangeGeneration() { return mArrangeGeneration; } diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index bc7a2cc3f0..4fbfa7ed79 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -416,7 +416,7 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height ) return *height; } -S32 LLFolderViewItem::getItemHeight() +S32 LLFolderViewItem::getItemHeight() const { return mItemHeight; } diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index c8d44de474..5c2a1ecff0 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -178,7 +178,7 @@ public: // Finds width and height of this object and it's children. Also // makes sure that this view and it's children are the right size. virtual S32 arrange( S32* width, S32* height ); - virtual S32 getItemHeight(); + virtual S32 getItemHeight() const; virtual S32 getLabelXPos(); S32 getIconPad(); S32 getTextPad(); @@ -217,9 +217,9 @@ public: void setIsCurSelection(BOOL select) { mIsCurSelection = select; } - BOOL getIsCurSelection() { return mIsCurSelection; } + BOOL getIsCurSelection() const { return mIsCurSelection; } - BOOL hasVisibleChildren() { return mHasVisibleChildren; } + BOOL hasVisibleChildren() const { return mHasVisibleChildren; } // true if object can't have children virtual bool isFolderComplete() { return true; } @@ -268,7 +268,7 @@ public: virtual LLFolderView* getRoot(); virtual const LLFolderView* getRoot() const; BOOL isDescendantOf( const LLFolderViewFolder* potential_ancestor ); - S32 getIndentation() { return mIndentation; } + S32 getIndentation() const { return mIndentation; } virtual BOOL passedFilter(S32 filter_generation = -1); virtual BOOL isPotentiallyVisible(S32 filter_generation = -1); -- cgit v1.2.3 From f83ed218327213ae809535f4739d9f9eff6374a3 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 22 May 2023 20:47:17 +0300 Subject: SL-19752 don't try to scroll after opening the new folder in single-folder view to avoid crash --- indra/llui/llfolderview.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index bf6f2436b1..7831aa92fb 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -833,9 +833,12 @@ void LLFolderView::autoOpenItem( LLFolderViewFolder* item ) mAutoOpenItems.push(item); item->setOpen(TRUE); + if(!item->isSingleFolderMode()) + { LLRect content_rect = (mScrollContainer ? mScrollContainer->getContentWindowRect() : LLRect()); LLRect constraint_rect(0,content_rect.getHeight(), content_rect.getWidth(), 0); scrollToShowItem(item, constraint_rect); + } } void LLFolderView::closeAutoOpenedFolders() -- cgit v1.2.3 From 505c15cf47c04e45f4a68790b5c63237a7bfcc9b Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 23 May 2023 16:13:10 +0300 Subject: SL-19759 FIXED Adding New Folders in Single Folder view can cause all folders to open and shift out of view --- indra/llui/llfolderviewitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 4fbfa7ed79..7090156b4e 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -1344,7 +1344,7 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem child_selected = TRUE; } } - if(openitem && child_selected) + if(openitem && child_selected && !mSingleFolderMode) { setOpenArrangeRecursively(TRUE); } -- cgit v1.2.3 From 572e8269bcd5320daa66f4074e927c79869bf7de Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 24 May 2023 22:51:02 +0300 Subject: SL-19604 Creating new folders in combination views does not highlight created item --- indra/llui/llfolderview.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 7831aa92fb..798c00d0ca 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -694,11 +694,18 @@ void LLFolderView::draw() } } - if (mRenameItem && mRenamer && mRenamer->getVisible() && !getVisibleRect().overlaps(mRenamer->getRect())) + if (mRenameItem + && mRenamer + && mRenamer->getVisible()) { - // renamer is not connected to the item we are renaming in any form so manage it manually - // TODO: consider stopping on any scroll action instead of when out of visible area - finishRenamingItem(); + LLRect renamer_rect; + localRectToOtherView(mRenamer->getRect(), &renamer_rect, mScrollContainer); + if (!mScrollContainer->getRect().overlaps(renamer_rect)) + { + // renamer is not connected to the item we are renaming in any form so manage it manually + // TODO: consider stopping on any scroll action instead of when out of visible area + finishRenamingItem(); + } } // skip over LLFolderViewFolder::draw since we don't want the folder icon, label, -- cgit v1.2.3 From 5c55adae47cab93a12793528373f639ea9e8efcf Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 30 May 2023 13:10:36 +0300 Subject: SL-19773 add context menu for root folder in single folder mode --- indra/llui/llfolderview.cpp | 12 +++++++++--- indra/llui/llfolderview.h | 6 +++++- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 798c00d0ca..f0106e345c 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -190,7 +190,8 @@ LLFolderView::LLFolderView(const Params& p) mShowItemLinkOverlays(p.show_item_link_overlays), mViewModel(p.view_model), mGroupedItemModel(p.grouped_item_model), - mForceArrange(false) + mForceArrange(false), + mSingleFolderMode(false) { LLPanel* panel = p.parent_panel; mParentPanel = panel->getHandle(); @@ -1475,8 +1476,8 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) } } bool hide_folder_menu = mSuppressFolderMenu && isFolderSelected(); - if (menu && (handled - && ( count > 0 && (hasVisibleChildren()) )) && // show menu only if selected items are visible + if (menu && (mSingleFolderMode || (handled + && ( count > 0 && (hasVisibleChildren()) ))) && // show menu only if selected items are visible !hide_folder_menu) { if (mCallbackRegistrar) @@ -1918,6 +1919,11 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu) flags = multi_select_flag; } + if(mSingleFolderMode && (mSelectedItems.size() == 0)) + { + buildContextMenu(*menu, flags); + } + // This adds a check for restrictions based on the entire // selection set - for example, any one wearable may not push you // over the limit, but all wearables together still might. diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 73028f31b1..ed84b29fd9 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -127,6 +127,9 @@ public: bool getAllowMultiSelect() { return mAllowMultiSelect; } bool getAllowDrag() { return mAllowDrag; } + void setSingleFolderMode(bool is_single_mode) { mSingleFolderMode = is_single_mode; } + bool isSingleFolderMode() { return mSingleFolderMode; } + // Close all folders in the view void closeAllFolders(); void openTopLevelFolders(); @@ -300,7 +303,8 @@ protected: mShowItemLinkOverlays, mShowSelectionContext, mShowSingleSelection, - mSuppressFolderMenu; + mSuppressFolderMenu, + mSingleFolderMode; // Renaming variables and methods LLFolderViewItem* mRenameItem; // The item currently being renamed -- cgit v1.2.3 From 23311903106293f29e22d21314bdab03bbd499f7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 31 May 2023 19:28:48 +0300 Subject: Revert "SL-19795 Unified scroll" --- indra/llui/llfolderview.cpp | 15 ++++----------- indra/llui/llfolderview.h | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index f0106e345c..70c2a79d25 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -695,18 +695,11 @@ void LLFolderView::draw() } } - if (mRenameItem - && mRenamer - && mRenamer->getVisible()) + if (mRenameItem && mRenamer && mRenamer->getVisible() && !getVisibleRect().overlaps(mRenamer->getRect())) { - LLRect renamer_rect; - localRectToOtherView(mRenamer->getRect(), &renamer_rect, mScrollContainer); - if (!mScrollContainer->getRect().overlaps(renamer_rect)) - { - // renamer is not connected to the item we are renaming in any form so manage it manually - // TODO: consider stopping on any scroll action instead of when out of visible area - finishRenamingItem(); - } + // renamer is not connected to the item we are renaming in any form so manage it manually + // TODO: consider stopping on any scroll action instead of when out of visible area + finishRenamingItem(); } // skip over LLFolderViewFolder::draw since we don't want the folder icon, label, diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index ed84b29fd9..6de366044c 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -258,13 +258,13 @@ public: virtual void updateMenu(); void finishRenamingItem( void ); - void updateRenamerPosition(); // Note: We may eventually have to move that method up the hierarchy to LLFolderViewItem. LLHandle getHandle() const { return getDerivedHandle(); } private: void updateMenuOptions(LLMenuGL* menu); + void updateRenamerPosition(); protected: LLScrollContainer* mScrollContainer; // NULL if this is not a child of a scroll container. -- cgit v1.2.3 From 07fc011e209ab24069d06df961a000dc7d6de3cf Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 2 Jun 2023 21:24:15 +0300 Subject: SL-19796 Creating folders in list mode does not scroll to new folder --- indra/llui/llfolderview.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 70c2a79d25..19855c9c76 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -695,12 +695,20 @@ void LLFolderView::draw() } } - if (mRenameItem && mRenamer && mRenamer->getVisible() && !getVisibleRect().overlaps(mRenamer->getRect())) - { - // renamer is not connected to the item we are renaming in any form so manage it manually - // TODO: consider stopping on any scroll action instead of when out of visible area - finishRenamingItem(); - } + if (mRenameItem + && mRenamer + && mRenamer->getVisible() + ) + { + LLRect renamer_rect; + localRectToOtherView(mRenamer->getRect(), &renamer_rect, mScrollContainer); + if (!mScrollContainer->getRect().overlaps(renamer_rect)) + { + // renamer is not connected to the item we are renaming in any form so manage it manually + // TODO: consider stopping on any scroll action instead of when out of visible area + finishRenamingItem(); + } + } // skip over LLFolderViewFolder::draw since we don't want the folder icon, label, // and arrow for the root folder -- cgit v1.2.3 From fb248ad2bc106bad827e624b4bb6b99a3f97d266 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 3 Jun 2023 02:05:17 +0300 Subject: SL-19815 Gallery support for left, right, up and down --- indra/llui/llscrollbar.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index fde6de4921..62be0c28e8 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -591,7 +591,12 @@ void LLScrollbar::setValue(const LLSD& value) BOOL LLScrollbar::handleKeyHere(KEY key, MASK mask) { - BOOL handled = FALSE; + if (getDocPosMax() == 0 && !getVisible()) + { + return FALSE; + } + + BOOL handled = FALSE; switch( key ) { -- cgit v1.2.3 From eb95bf5da2996b54b65552bfa84f49bfc157520f Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 9 Jun 2023 13:12:45 +0200 Subject: SL-18977 Borders of inventory view in inventory floater seem to be cut a bit --- indra/llui/llscrollcontainer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 3db38bbfac..c4cb739f0a 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -126,6 +126,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) LLRect horizontal_scroll_rect = mInnerRect; horizontal_scroll_rect.mTop = horizontal_scroll_rect.mBottom + scrollbar_size; + horizontal_scroll_rect.mLeft += 3; sbparams.name("scrollable horizontal"); sbparams.rect(horizontal_scroll_rect); sbparams.orientation(LLScrollbar::HORIZONTAL); -- cgit v1.2.3 From 417dbeb68ef842a8eee22ebab35c89ddee653619 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 10 Jun 2023 01:33:43 +0300 Subject: SL-19823 Edit not always active #5 --- indra/llui/llfolderview.cpp | 46 +++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 19855c9c76..8660048058 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -695,19 +695,14 @@ void LLFolderView::draw() } } - if (mRenameItem + if (mRenameItem && mRenamer && mRenamer->getVisible() - ) - { - LLRect renamer_rect; - localRectToOtherView(mRenamer->getRect(), &renamer_rect, mScrollContainer); - if (!mScrollContainer->getRect().overlaps(renamer_rect)) - { - // renamer is not connected to the item we are renaming in any form so manage it manually - // TODO: consider stopping on any scroll action instead of when out of visible area - finishRenamingItem(); - } + && !getVisibleRect().overlaps(mRenamer->getRect())) + { + // renamer is not connected to the item we are renaming in any form so manage it manually + // TODO: consider stopping on any scroll action instead of when out of visible area + finishRenamingItem(); } // skip over LLFolderViewFolder::draw since we don't want the folder icon, label, @@ -1851,13 +1846,28 @@ void LLFolderView::update() } } - if (mSignalSelectCallback) - { - //RN: we use keyboard focus as a proxy for user-explicit actions - BOOL take_keyboard_focus = (mSignalSelectCallback == SIGNAL_KEYBOARD_FOCUS); - mSelectSignal(mSelectedItems, take_keyboard_focus); - } - mSignalSelectCallback = FALSE; + if (mSelectedItems.size()) + { + LLFolderViewItem* item = mSelectedItems.back(); + // If the goal is to show renamer, don't callback untill + // item is visible or is no longer being scrolled to. + // Otherwise renamer will be instantly closed + // Todo: consider moving renamer out of selection callback + if (!mNeedsAutoRename || !mNeedsScroll || item->getVisible()) + { + if (mSignalSelectCallback) + { + //RN: we use keyboard focus as a proxy for user-explicit actions + BOOL take_keyboard_focus = (mSignalSelectCallback == SIGNAL_KEYBOARD_FOCUS); + mSelectSignal(mSelectedItems, take_keyboard_focus); + } + mSignalSelectCallback = FALSE; + } + } + else + { + mSignalSelectCallback = FALSE; + } } void LLFolderView::dumpSelectionInformation() -- cgit v1.2.3 From 929f9d8d5f2e7895016648557fa60c9d4a84baf6 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 12 Jun 2023 16:10:28 +0300 Subject: SL-19825 clear selection when right-clicking outside of selected items --- indra/llui/llfolderview.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 8660048058..7e5a9efb37 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1471,6 +1471,16 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) mCallbackRegistrar->popScope(); } } + + bool item_clicked = false; + for (selected_items_t::iterator item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) + { + item_clicked |= (*item_it)->getRect().pointInRect(x, y); + } + if(!item_clicked && mSingleFolderMode) + { + clearSelection(); + } bool hide_folder_menu = mSuppressFolderMenu && isFolderSelected(); if (menu && (mSingleFolderMode || (handled && ( count > 0 && (hasVisibleChildren()) ))) && // show menu only if selected items are visible -- cgit v1.2.3 From 9eabffe430cd0c7b64f2cb796997dfd74a0cab82 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 12 Jun 2023 19:44:29 +0300 Subject: SL-19825 do not mix bool and BOOL types --- indra/llui/llfolderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 7e5a9efb37..fa5ff76a2e 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1472,7 +1472,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) } } - bool item_clicked = false; + BOOL item_clicked = FALSE; for (selected_items_t::iterator item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) { item_clicked |= (*item_it)->getRect().pointInRect(x, y); -- cgit v1.2.3 From 7f6ad82a2a76ed1f96bf1ca61cacc51151fe74bf Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 12 Jun 2023 23:19:02 +0300 Subject: SL-19823 Additional logging --- indra/llui/llfolderview.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index fa5ff76a2e..630d93cde0 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -702,6 +702,7 @@ void LLFolderView::draw() { // renamer is not connected to the item we are renaming in any form so manage it manually // TODO: consider stopping on any scroll action instead of when out of visible area + LL_DEBUGS("Inventory") << "Renamer out of bounds, hiding" << LL_ENDL; finishRenamingItem(); } @@ -1046,6 +1047,8 @@ void LLFolderView::paste() // public rename functionality - can only start the process void LLFolderView::startRenamingSelectedItem( void ) { + LL_DEBUGS("Inventory") << "Starting inventory renamer" << LL_ENDL; + // make sure selection is visible scrollToShowSelection(); -- cgit v1.2.3 From 7ac094e92105122b22b4693dafae7f0cee72d9a0 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 13 Jun 2023 08:45:13 +0200 Subject: SL-18977 Borders of inventory view in inventory floater seem to be cut a bit --- indra/llui/llscrollcontainer.cpp | 8 ++++---- indra/llui/lltabcontainer.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index c4cb739f0a..5872b79bb0 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -124,9 +124,9 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) mScrollbar[VERTICAL] = LLUICtrlFactory::create (sbparams); LLView::addChild( mScrollbar[VERTICAL] ); - LLRect horizontal_scroll_rect = mInnerRect; - horizontal_scroll_rect.mTop = horizontal_scroll_rect.mBottom + scrollbar_size; - horizontal_scroll_rect.mLeft += 3; + LLRect horizontal_scroll_rect; + horizontal_scroll_rect.mRight = mInnerRect.getWidth(); + horizontal_scroll_rect.mTop = scrollbar_size; sbparams.name("scrollable horizontal"); sbparams.rect(horizontal_scroll_rect); sbparams.orientation(LLScrollbar::HORIZONTAL); @@ -135,7 +135,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) sbparams.page_size(mInnerRect.getWidth()); sbparams.step_size(VERTICAL_MULTIPLE); sbparams.visible(false); - sbparams.follows.flags(FOLLOWS_LEFT | FOLLOWS_RIGHT); + sbparams.follows.flags(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM); sbparams.change_callback(p.scroll_callback); mScrollbar[HORIZONTAL] = LLUICtrlFactory::create (sbparams); LLView::addChild( mScrollbar[HORIZONTAL] ); diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 8c841540a5..d5d337848c 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -986,7 +986,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) // Tab panel S32 tab_panel_top; S32 tab_panel_bottom; - if (!getTabsHidden()) + if (!getTabsHidden()) { if( getTabPosition() == LLTabContainer::TOP ) { @@ -1002,7 +1002,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) } else { - //Scip tab button space if they are invisible(EXT - 576) + // Skip tab button space if tabs are invisible (EXT-576) tab_panel_top = getRect().getHeight(); tab_panel_bottom = LLPANEL_BORDER_WIDTH; } @@ -1017,9 +1017,9 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) } else { - tab_panel_rect = LLRect(LLPANEL_BORDER_WIDTH, + tab_panel_rect = LLRect(LLPANEL_BORDER_WIDTH * 2, tab_panel_top, - getRect().getWidth()-LLPANEL_BORDER_WIDTH, + getRect().getWidth(), tab_panel_bottom ); } child->setFollowsAll(); -- cgit v1.2.3 From 44e746c2068aa983c15336277fc8f988fcb94303 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 15 Jun 2023 23:10:56 +0300 Subject: Revert "SL-18977 Borders of inventory view in inventory floater seem to be cut a bit" This reverts commit 7ac094e92105122b22b4693dafae7f0cee72d9a0. Commit breaks gallery panel, it is not ready. --- indra/llui/llscrollcontainer.cpp | 8 ++++---- indra/llui/lltabcontainer.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 5872b79bb0..c4cb739f0a 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -124,9 +124,9 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) mScrollbar[VERTICAL] = LLUICtrlFactory::create (sbparams); LLView::addChild( mScrollbar[VERTICAL] ); - LLRect horizontal_scroll_rect; - horizontal_scroll_rect.mRight = mInnerRect.getWidth(); - horizontal_scroll_rect.mTop = scrollbar_size; + LLRect horizontal_scroll_rect = mInnerRect; + horizontal_scroll_rect.mTop = horizontal_scroll_rect.mBottom + scrollbar_size; + horizontal_scroll_rect.mLeft += 3; sbparams.name("scrollable horizontal"); sbparams.rect(horizontal_scroll_rect); sbparams.orientation(LLScrollbar::HORIZONTAL); @@ -135,7 +135,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) sbparams.page_size(mInnerRect.getWidth()); sbparams.step_size(VERTICAL_MULTIPLE); sbparams.visible(false); - sbparams.follows.flags(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM); + sbparams.follows.flags(FOLLOWS_LEFT | FOLLOWS_RIGHT); sbparams.change_callback(p.scroll_callback); mScrollbar[HORIZONTAL] = LLUICtrlFactory::create (sbparams); LLView::addChild( mScrollbar[HORIZONTAL] ); diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index d5d337848c..8c841540a5 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -986,7 +986,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) // Tab panel S32 tab_panel_top; S32 tab_panel_bottom; - if (!getTabsHidden()) + if (!getTabsHidden()) { if( getTabPosition() == LLTabContainer::TOP ) { @@ -1002,7 +1002,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) } else { - // Skip tab button space if tabs are invisible (EXT-576) + //Scip tab button space if they are invisible(EXT - 576) tab_panel_top = getRect().getHeight(); tab_panel_bottom = LLPANEL_BORDER_WIDTH; } @@ -1017,9 +1017,9 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) } else { - tab_panel_rect = LLRect(LLPANEL_BORDER_WIDTH * 2, + tab_panel_rect = LLRect(LLPANEL_BORDER_WIDTH, tab_panel_top, - getRect().getWidth(), + getRect().getWidth()-LLPANEL_BORDER_WIDTH, tab_panel_bottom ); } child->setFollowsAll(); -- cgit v1.2.3 From 2a035c080dec2aa16b9628aac7b120e4f15135c2 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 16 Jun 2023 08:42:23 +0200 Subject: SL-18977 Borders of inventory view in inventory floater seem to be cut a bit --- indra/llui/llbutton.cpp | 3 ++- indra/llui/llscrollcontainer.cpp | 12 ++++++------ indra/llui/lltabcontainer.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 8028f397f3..a38b3323be 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -203,7 +203,8 @@ LLButton::LLButton(const LLButton::Params& p) } // Hack to make sure there is space for at least one character - if (getRect().getWidth() - (mRightHPad + mLeftHPad) < mGLFont->getWidth(std::string(" "))) + if (getRect().mRight >= 0 && getRect().getWidth() > 0 && + getRect().getWidth() - (mRightHPad + mLeftHPad) < mGLFont->getWidth(std::string(" "))) { // Use old defaults mLeftHPad = llbutton_orig_h_pad; diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index c4cb739f0a..ad32f7186c 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -105,8 +105,8 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) mBorder = LLUICtrlFactory::create (params); LLView::addChild( mBorder ); - mInnerRect.set( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - mInnerRect.stretch( -getBorderWidth() ); + mInnerRect = getLocalRect(); + mInnerRect.stretch( -getBorderWidth() ); LLRect vertical_scroll_rect = mInnerRect; vertical_scroll_rect.mLeft = vertical_scroll_rect.mRight - scrollbar_size; @@ -124,9 +124,9 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) mScrollbar[VERTICAL] = LLUICtrlFactory::create (sbparams); LLView::addChild( mScrollbar[VERTICAL] ); - LLRect horizontal_scroll_rect = mInnerRect; - horizontal_scroll_rect.mTop = horizontal_scroll_rect.mBottom + scrollbar_size; - horizontal_scroll_rect.mLeft += 3; + LLRect horizontal_scroll_rect; + horizontal_scroll_rect.mTop = scrollbar_size; + horizontal_scroll_rect.mRight = mInnerRect.getWidth(); sbparams.name("scrollable horizontal"); sbparams.rect(horizontal_scroll_rect); sbparams.orientation(LLScrollbar::HORIZONTAL); @@ -135,7 +135,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) sbparams.page_size(mInnerRect.getWidth()); sbparams.step_size(VERTICAL_MULTIPLE); sbparams.visible(false); - sbparams.follows.flags(FOLLOWS_LEFT | FOLLOWS_RIGHT); + sbparams.follows.flags(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM); sbparams.change_callback(p.scroll_callback); mScrollbar[HORIZONTAL] = LLUICtrlFactory::create (sbparams); LLView::addChild( mScrollbar[HORIZONTAL] ); diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 8c841540a5..f15e9771c0 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1002,7 +1002,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) } else { - //Scip tab button space if they are invisible(EXT - 576) + // Skip tab button space if tabs are invisible (EXT-576) tab_panel_top = getRect().getHeight(); tab_panel_bottom = LLPANEL_BORDER_WIDTH; } @@ -1017,9 +1017,9 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) } else { - tab_panel_rect = LLRect(LLPANEL_BORDER_WIDTH, + tab_panel_rect = LLRect(LLPANEL_BORDER_WIDTH * 3, tab_panel_top, - getRect().getWidth()-LLPANEL_BORDER_WIDTH, + getRect().getWidth() - LLPANEL_BORDER_WIDTH * 2, tab_panel_bottom ); } child->setFollowsAll(); @@ -1106,7 +1106,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) p.follows.flags = p.follows.flags() | FOLLOWS_TOP; } else - { + { p.name("htab_"+std::string(child->getName())); p.visible(false); p.image_unselected(tab_img); -- cgit v1.2.3 From 65fe37a93029e17f45e488619a5e589a2983757f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 24 Jun 2023 01:49:27 +0300 Subject: SL-19604 Fix gallery view having huge ident at the bottom --- indra/llui/lllayoutstack.cpp | 9 +++++++++ indra/llui/lllayoutstack.h | 1 + 2 files changed, 10 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 08ce31ffc5..b1968e6a42 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -523,6 +523,15 @@ void LLLayoutStack::updateLayout() mNeedsLayout = continue_animating; } // end LLLayoutStack::updateLayout +void LLLayoutStack::setPanelSpacing(S32 val) +{ + if (mPanelSpacing != val) + { + mPanelSpacing = val; + mNeedsLayout = true; + } +} + LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const { if (!panelp) return NULL; diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 02685281ef..000b919ae7 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -91,6 +91,7 @@ public: void updateLayout(); S32 getPanelSpacing() const { return mPanelSpacing; } + void setPanelSpacing(S32 val); static void updateClass(); -- cgit v1.2.3 From bbcedf9c847f1f768e6c34e74a6a4373b0e7ae24 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 1 Jul 2023 00:20:01 +0300 Subject: SL-19914 Inventory gallery Tab support #2 --- indra/llui/llscrollbar.cpp | 4 ++-- indra/llui/llscrollbar.h | 4 ++-- indra/llui/llscrollcontainer.h | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 62be0c28e8..735e2d529e 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -188,12 +188,12 @@ void LLScrollbar::setPageSize( S32 page_size ) } } -BOOL LLScrollbar::isAtBeginning() +bool LLScrollbar::isAtBeginning() const { return mDocPos == 0; } -BOOL LLScrollbar::isAtEnd() +bool LLScrollbar::isAtEnd() const { return mDocPos == getDocPosMax(); } diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h index 5f2f490d81..9be9d22db8 100644 --- a/indra/llui/llscrollbar.h +++ b/indra/llui/llscrollbar.h @@ -105,8 +105,8 @@ public: bool setDocPos( S32 pos, BOOL update_thumb = TRUE ); S32 getDocPos() const { return mDocPos; } - BOOL isAtBeginning(); - BOOL isAtEnd(); + bool isAtBeginning() const; + bool isAtEnd() const; // Setting both at once. void setDocParams( S32 size, S32 pos ); diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index c14099dbd5..dacea2a987 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -98,8 +98,10 @@ public: void pageDown(S32 overlap = 0); void goToTop(); void goToBottom(); - bool isAtTop() { return mScrollbar[VERTICAL]->isAtBeginning(); } - bool isAtBottom() { return mScrollbar[VERTICAL]->isAtEnd(); } + bool isAtTop() const { return mScrollbar[VERTICAL]->isAtBeginning(); } + bool isAtBottom() const { return mScrollbar[VERTICAL]->isAtEnd(); } + S32 getDocPosVertical() const { return mScrollbar[VERTICAL]->getDocPos(); } + S32 getDocPosHorizontal() const { return mScrollbar[HORIZONTAL]->getDocPos(); } S32 getBorderWidth() const; // LLView functionality -- cgit v1.2.3 From c4c5778b263a1f9036ba6c6c18f96d1311988fcb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 2 Aug 2023 18:00:02 +0300 Subject: SL-20098 handleDoubleClick crashes in new inventory panels --- indra/llui/llfolderviewitem.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 0093f4c17c..38a1a9a1ab 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -32,6 +32,7 @@ #include "llfolderview.h" #include "llfolderviewmodel.h" #include "llpanel.h" +#include "llcallbacklist.h" #include "llcriticaldamp.h" #include "llclipboard.h" #include "llfocusmgr.h" // gFocusMgr @@ -1844,7 +1845,12 @@ void LLFolderViewFolder::setOpen(BOOL openitem) { if(mSingleFolderMode) { - getViewModelItem()->navigateToFolder(); + // navigateToFolder can destroy this view + // delay it in case setOpen was called from click or key processing + doOnIdleOneTime([this]() + { + getViewModelItem()->navigateToFolder(); + }); } else { @@ -2074,7 +2080,19 @@ BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask ) if(mSingleFolderMode) { static LLUICachedControl double_click_new_window("SingleModeDoubleClickOpenWindow", false); - getViewModelItem()->navigateToFolder(double_click_new_window); + if (double_click_new_window) + { + getViewModelItem()->navigateToFolder(true); + } + else + { + // navigating is going to destroy views and change children + // delay it untill handleDoubleClick processing is complete + doOnIdleOneTime([this]() + { + getViewModelItem()->navigateToFolder(false); + }); + } return TRUE; } -- cgit v1.2.3 From 46425b2e49377acc186e41c67a793f7f6b7f583b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 7 Sep 2023 01:35:37 +0300 Subject: SL-19826 Keep scroll from acting up if selection changed Unfulfilled scroll (due to fetching) persisted after selection changed --- indra/llui/llfolderview.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 630d93cde0..650ae9ae75 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -611,6 +611,7 @@ void LLFolderView::clearSelection() } mSelectedItems.clear(); + mNeedsScroll = false; } std::set LLFolderView::getSelectionList() const -- cgit v1.2.3 From 28e6ce451c3d01333a805f11286dacc9f3157c54 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 14 Sep 2023 23:34:57 +0300 Subject: SL-20269 Tab's focus jumps over item when clicking on edge items --- indra/llui/lltabcontainer.cpp | 8 +++++++- indra/llui/lltabcontainer.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index f15e9771c0..76b9e448a1 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -605,6 +605,7 @@ BOOL LLTabContainer::handleMouseDown( S32 x, S32 y, MASK mask ) LLButton* tab_button = getTab(index)->mButton; gFocusMgr.setMouseCapture(this); tab_button->setFocus(TRUE); + mMouseDownTimer.start(); } } if (handled) { @@ -653,7 +654,11 @@ BOOL LLTabContainer::handleHover( S32 x, S32 y, MASK mask ) handled = LLPanel::handleHover(x, y, mask); } - commitHoveredButton(x, y); + F32 drag_delay = 0.25f; // filter out clicks from dragging + if (mMouseDownTimer.getElapsedTimeF32() > drag_delay) + { + commitHoveredButton(x, y); + } return handled; } @@ -699,6 +704,7 @@ BOOL LLTabContainer::handleMouseUp( S32 x, S32 y, MASK mask ) } commitHoveredButton(x, y); + mMouseDownTimer.stop(); LLPanel* cur_panel = getCurrentPanel(); if (hasMouseCapture()) { diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 8f8cedb1b9..aa4a08c4ff 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -320,6 +320,7 @@ private: LLUIColor mTabsFlashingColor; S32 mTabIconCtrlPad; bool mUseTabEllipses; + LLFrameTimer mMouseDownTimer; }; #endif // LL_TABCONTAINER_H -- cgit v1.2.3