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 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'indra/llui/llmenugl.cpp') 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(); -- 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/llmenugl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/llui/llmenugl.cpp') 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 -- cgit v1.2.3