From 961da1777f00ae31434ffdf8da5a42d1854d3e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 16 Nov 2023 01:47:29 -0300 Subject: [PATCH] Added CSS selector for previous sibling (|), not used for the moment. Added UITabWidget property configuration: tab-close-button-visible. Plus some minor changes. --- bin/assets/ui/breeze.css | 9 ++++ include/eepp/ui/css/propertydefinition.hpp | 1 + .../eepp/ui/css/stylesheetselectorrule.hpp | 3 +- .../eepp/ui/css/stylesheetspecification.hpp | 4 +- include/eepp/ui/uistyle.hpp | 1 + include/eepp/ui/uitab.hpp | 2 + include/eepp/ui/uitabwidget.hpp | 5 ++ include/eepp/ui/uiwidgetcreator.hpp | 16 +++--- src/eepp/ui/css/stylesheetselector.cpp | 26 ++++++++++ src/eepp/ui/css/stylesheetspecification.cpp | 3 +- src/eepp/ui/doc/languages/css.cpp | 50 ++++++++++++++++++- src/eepp/ui/uinodedrawable.cpp | 2 +- src/eepp/ui/uistyle.cpp | 12 +++-- src/eepp/ui/uitab.cpp | 10 ++-- src/eepp/ui/uitabwidget.cpp | 32 +++++++++++- src/eepp/ui/uiwidgetcreator.cpp | 28 +++++------ 16 files changed, 167 insertions(+), 37 deletions(-) diff --git a/bin/assets/ui/breeze.css b/bin/assets/ui/breeze.css index 4eecec5ee..024751261 100644 --- a/bin/assets/ui/breeze.css +++ b/bin/assets/ui/breeze.css @@ -538,10 +538,18 @@ Tab { background-position-y: bottom; height: 24dp; transition: background-color 0.15s; + foreground-image: linear-gradient( to top, var(--tab-line), var(--tab-back)); + foreground-size: 1dp 80%; + foreground-position: right bottom; +} + +Tab.prev { + foreground-image: none; } Tab:hover { background-color: var(--tab-hover); + foreground-image: none; } Tab::text { @@ -562,6 +570,7 @@ Tab:selected { border-top-width: 1dp; border-top-left-radius: 2dp; border-top-right-radius: 2dp; + foreground-image: none; } Tab:selected:hover { diff --git a/include/eepp/ui/css/propertydefinition.hpp b/include/eepp/ui/css/propertydefinition.hpp index f1db84896..8e9b18b6e 100644 --- a/include/eepp/ui/css/propertydefinition.hpp +++ b/include/eepp/ui/css/propertydefinition.hpp @@ -92,6 +92,7 @@ enum class PropertyId : Uint32 { TabsEdgesDiffSkin = String::hash( "tabs-edges-diff-skin" ), TabSeparation = String::hash( "tab-separation" ), TabHeight = String::hash( "tab-height" ), + TabCloseButtonVisible = String::hash( "tab-close-button-visible" ), Selected = String::hash( "selected" ), Checked = String::hash( "checked" ), PopUpToRoot = String::hash( "popup-to-root" ), diff --git a/include/eepp/ui/css/stylesheetselectorrule.hpp b/include/eepp/ui/css/stylesheetselectorrule.hpp index 3e956491e..1dcbab8e1 100644 --- a/include/eepp/ui/css/stylesheetselectorrule.hpp +++ b/include/eepp/ui/css/stylesheetselectorrule.hpp @@ -46,7 +46,8 @@ class EE_API StyleSheetSelectorRule { DESCENDANT = ' ', CHILD = '>', DIRECT_SIBLING = '+', - SIBLING = '~' + SIBLING = '~', + PREVIOUS_SIBLING = '|', }; StyleSheetSelectorRule( const std::string& selectorFragment, PatternMatch mPatternMatch ); diff --git a/include/eepp/ui/css/stylesheetspecification.hpp b/include/eepp/ui/css/stylesheetspecification.hpp index 4f263e33f..58a058b3c 100644 --- a/include/eepp/ui/css/stylesheetspecification.hpp +++ b/include/eepp/ui/css/stylesheetspecification.hpp @@ -69,8 +69,8 @@ class EE_API StyleSheetSpecification { protected: PropertySpecification* mPropertySpecification; DrawableImageParser mDrawableImageParser; - std::map mShorthandParsers; - std::map mNodeSelectors; + UnorderedMap mShorthandParsers; + UnorderedMap mNodeSelectors; void registerDefaultShorthandParsers(); diff --git a/include/eepp/ui/uistyle.hpp b/include/eepp/ui/uistyle.hpp index 8c6a30853..4bc893b4b 100644 --- a/include/eepp/ui/uistyle.hpp +++ b/include/eepp/ui/uistyle.hpp @@ -89,6 +89,7 @@ class EE_API UIStyle : public UIState { std::set mRelatedWidgets; std::set mSubscribedWidgets; UnorderedSet mStructurallyVolatileChilds; + size_t mStateDepthCounter{ 0 }; bool mChangingState; bool mForceReapplyProperties; bool mDisableAnimations; diff --git a/include/eepp/ui/uitab.hpp b/include/eepp/ui/uitab.hpp index 08083341d..9c9083a62 100644 --- a/include/eepp/ui/uitab.hpp +++ b/include/eepp/ui/uitab.hpp @@ -44,6 +44,8 @@ class EE_API UITab : public UISelectButton { void removeTab( bool destroyOwnedNode = true, bool immediateClose = false ); + UIWidget* getCloseButton() const; + protected: friend class UITabWidget; diff --git a/include/eepp/ui/uitabwidget.hpp b/include/eepp/ui/uitabwidget.hpp index 932b16889..e6acc5113 100644 --- a/include/eepp/ui/uitabwidget.hpp +++ b/include/eepp/ui/uitabwidget.hpp @@ -38,6 +38,7 @@ class EE_API UITabWidget : public UIWidget { bool TabsClosable = false; bool TabsEdgesDiffSkins = false; //! Indicates if the edge tabs ( the left and right //! border tab ) are different from the central tabs. + bool TabCloseButtonVisible = true; }; typedef std::function TabTryCloseCallback; @@ -108,6 +109,10 @@ class EE_API UITabWidget : public UIWidget { void setTabsClosable( bool tabsClosable ); + bool getTabCloseButtonVisible() const; + + void setTabCloseButtonVisible( bool visible); + bool getSpecialBorderTabs() const; void setTabsEdgesDiffSkins( bool diffSkins ); diff --git a/include/eepp/ui/uiwidgetcreator.hpp b/include/eepp/ui/uiwidgetcreator.hpp index 944a11476..f4ad9d416 100644 --- a/include/eepp/ui/uiwidgetcreator.hpp +++ b/include/eepp/ui/uiwidgetcreator.hpp @@ -8,26 +8,26 @@ namespace EE { namespace UI { class EE_API UIWidgetCreator { public: - typedef std::function CustomWidgetCb; + typedef std::function CustomWidgetCb; typedef std::function RegisterWidgetCb; typedef std::unordered_map WidgetCallbackMap; typedef std::unordered_map RegisteredWidgetCallbackMap; - static UIWidget* createFromName( std::string widgetName ); + static UIWidget* createFromName( const std::string& widgetName ); - static void addCustomWidgetCallback( std::string widgetName, const CustomWidgetCb& cb ); + static void addCustomWidgetCallback( const std::string& widgetName, const CustomWidgetCb& cb ); - static void removeCustomWidgetCallback( std::string widgetName ); + static void removeCustomWidgetCallback( const std::string& widgetName ); - static bool existsCustomWidgetCallback( std::string widgetName ); + static bool existsCustomWidgetCallback( const std::string& widgetName ); - static void registerWidget( std::string widgetName, const RegisterWidgetCb& cb ); + static void registerWidget( const std::string& widgetName, const RegisterWidgetCb& cb ); - static void unregisterWidget( std::string widgetName ); + static void unregisterWidget( const std::string& widgetName ); - static bool isWidgetRegistered( std::string widgetName ); + static bool isWidgetRegistered( const std::string& widgetName ); static const RegisteredWidgetCallbackMap& getRegisteredWidgets(); diff --git a/src/eepp/ui/css/stylesheetselector.cpp b/src/eepp/ui/css/stylesheetselector.cpp index 1fb374438..035592232 100644 --- a/src/eepp/ui/css/stylesheetselector.cpp +++ b/src/eepp/ui/css/stylesheetselector.cpp @@ -29,6 +29,7 @@ void removeExtraSpaces( std::string& string ) { String::replaceAll( string, " ", " " ); String::replaceAll( string, " ", " " ); String::replaceAll( string, " > ", ">" ); + String::replaceAll( string, " | ", "|" ); String::replaceAll( string, " + ", "+" ); String::replaceAll( string, " ~ ", "~" ); } @@ -69,6 +70,10 @@ void StyleSheetSelector::parseSelector( std::string selector ) { addSelectorRule( buffer, curPatternMatch, StyleSheetSelectorRule::DIRECT_SIBLING ); break; + case StyleSheetSelectorRule::PREVIOUS_SIBLING: + addSelectorRule( buffer, curPatternMatch, + StyleSheetSelectorRule::PREVIOUS_SIBLING ); + break; case StyleSheetSelectorRule::SIBLING: addSelectorRule( buffer, curPatternMatch, StyleSheetSelectorRule::SIBLING ); break; @@ -162,6 +167,14 @@ bool StyleSheetSelector::select( UIWidget* element, const bool& applyPseudo ) co break; // continue evaluating } + case StyleSheetSelectorRule::PREVIOUS_SIBLING: { + curElement = curElement->getStyleSheetNextSiblingElement(); + + if ( NULL == curElement || !selectorRule.matches( curElement, applyPseudo ) ) + return false; + + break; // continue evaluating + } case StyleSheetSelectorRule::SIBLING: { bool foundSibling = false; UIWidget* prevSibling = curElement->getStyleSheetPreviousSiblingElement(); @@ -264,6 +277,19 @@ std::vector StyleSheetSelector::getRelatedElements( UIWidget* element break; // continue evaluating } + case StyleSheetSelectorRule::PREVIOUS_SIBLING: { + curElement = curElement->getStyleSheetNextSiblingElement(); + + if ( NULL == curElement || !selectorRule.matches( curElement, applyPseudo ) ) + return EMPTY_ELEMENTS; + + if ( 0 != i && ( selectorRule.hasPseudoClasses() || + selectorRule.hasStructuralPseudoClasses() ) ) { + elements.push_back( curElement ); + } + + break; // continue evaluating + } case StyleSheetSelectorRule::SIBLING: { bool foundSibling = false; UIWidget* prevSibling = curElement->getStyleSheetPreviousSiblingElement(); diff --git a/src/eepp/ui/css/stylesheetspecification.cpp b/src/eepp/ui/css/stylesheetspecification.cpp index f6369a640..d4879ff72 100644 --- a/src/eepp/ui/css/stylesheetspecification.cpp +++ b/src/eepp/ui/css/stylesheetspecification.cpp @@ -227,6 +227,7 @@ void StyleSheetSpecification::registerDefaultProperties() { registerProperty( "min-tab-width", "" ).setType( PropertyType::NumberLength ); registerProperty( "max-tab-width", "" ).setType( PropertyType::NumberLength ); registerProperty( "tab-closable", "" ).setType( PropertyType::Bool ); + registerProperty( "tab-close-button-visible", "" ).setType( PropertyType::Bool ); registerProperty( "tabs-edges-diff-skin", "" ).setType( PropertyType::Bool ); registerProperty( "tab-separation", "" ).setType( PropertyType::NumberLength ); registerProperty( "tab-height", "" ).setType( PropertyType::NumberLength ); @@ -459,7 +460,7 @@ void StyleSheetSpecification::registerDefaultProperties() { void StyleSheetSpecification::registerNodeSelector( const std::string& name, StyleSheetNodeSelector nodeSelector ) { - mNodeSelectors[String::toLower( name )] = nodeSelector; + mNodeSelectors[String::toLower( name )] = std::move( nodeSelector ); } static bool isNth( int a, int b, int count ) { diff --git a/src/eepp/ui/doc/languages/css.cpp b/src/eepp/ui/doc/languages/css.cpp index a43ea478d..4e8614135 100644 --- a/src/eepp/ui/doc/languages/css.cpp +++ b/src/eepp/ui/doc/languages/css.cpp @@ -33,7 +33,7 @@ void addCSS() { { { "(:)(disabled)" }, { "normal", "operator", "literal" } }, { { "(:)(checked)" }, { "normal", "operator", "literal" } }, { { "(:)(root)" }, { "normal", "operator", "link" } }, - { { "(%a+)(%()" }, { "normal", "function", "normal" } }, + { { "([%a%-_]+)(%()" }, { "normal", "function", "normal" } }, { { "[%a][%w-]*%s*%f[:]" }, "keyword" }, { { "[{}:>~!]" }, "operator" }, { { "[%a_][%w_]*" }, "symbol" }, @@ -264,6 +264,54 @@ void addCSS() { { "magenta", "literal" }, { "textinputpassword", "keyword" }, { "important", "literal" }, + { "Widget", "keyword" }, + { "LinearLayout", "keyword" }, + { "RelativeLayout", "keyword" }, + { "TextView", "keyword" }, + { "PushButton", "keyword" }, + { "CheckBox", "keyword" }, + { "RadioButton", "keyword" }, + { "ComboBox", "keyword" }, + { "DropDownList", "keyword" }, + { "Image", "keyword" }, + { "ListBox", "keyword" }, + { "MenuBar", "keyword" }, + { "ProgressBar", "keyword" }, + { "ScrollBar", "keyword" }, + { "Slider", "keyword" }, + { "SpinBox", "keyword" }, + { "Sprite", "keyword" }, + { "Tab", "keyword" }, + { "WidgetTable", "keyword" }, + { "WidgetTableRow", "keyword" }, + { "TabWidget", "keyword" }, + { "TextEdit", "keyword" }, + { "TextInput", "keyword" }, + { "TextInputPassword", "keyword" }, + { "Loader", "keyword" }, + { "SelectButton", "keyword" }, + { "Window", "keyword" }, + { "ScrollView", "keyword" }, + { "TextureRegion", "keyword" }, + { "TouchDraggable", "keyword" }, + { "GridLayout", "keyword" }, + { "StackLayout", "keyword" }, + { "ViewPager", "keyword" }, + { "CodeEditor", "keyword" }, + { "Splitter", "keyword" }, + { "TreeView", "keyword" }, + { "TableView", "keyword" }, + { "ListView", "keyword" }, + { "StackWidget", "keyword" }, + { "Console", "keyword" }, + { "MenuCheckBox", "keyword" }, + { "MenuRadioButton", "keyword" }, + { "MenuSeparator", "keyword" }, + { "Anchor", "keyword" }, + { "TextureViewer", "keyword" }, + { "Tooltip", "keyword" }, + { "Menu", "keyword" }, + { "PopUpMenu", "keyword" }, }, "", diff --git a/src/eepp/ui/uinodedrawable.cpp b/src/eepp/ui/uinodedrawable.cpp index fc43358a2..d99ca49f9 100644 --- a/src/eepp/ui/uinodedrawable.cpp +++ b/src/eepp/ui/uinodedrawable.cpp @@ -656,7 +656,7 @@ void UINodeDrawable::LayerDrawable::update() { setDrawable( mDrawableRef ); } - mDrawableSize = calcDrawableSize( mSizeEq ); + mDrawableSize = calcDrawableSize( mSizeEq ).roundDown(); mOffset = calcPosition( mPositionX + " " + mPositionY ); mNeedsUpdate = false; diff --git a/src/eepp/ui/uistyle.cpp b/src/eepp/ui/uistyle.cpp index 199ff3a1a..1a83977fb 100644 --- a/src/eepp/ui/uistyle.cpp +++ b/src/eepp/ui/uistyle.cpp @@ -294,12 +294,18 @@ void UIStyle::onStateChange() { mWidget->endAttributesTransaction(); } - for ( auto& related : mRelatedWidgets ) { - if ( NULL != related->getUIStyle() ) { - related->getUIStyle()->onStateChange(); + mStateDepthCounter++; + + if ( mStateDepthCounter <= 1 ) { + for ( auto& related : mRelatedWidgets ) { + if ( NULL != related->getUIStyle() ) { + related->getUIStyle()->onStateChange(); + } } } + mStateDepthCounter--; + mChangingState = false; mFirstState = false; } diff --git a/src/eepp/ui/uitab.cpp b/src/eepp/ui/uitab.cpp index b05dcf436..4937e2431 100644 --- a/src/eepp/ui/uitab.cpp +++ b/src/eepp/ui/uitab.cpp @@ -24,6 +24,7 @@ UITab::UITab() : mCloseButton->addEventListener( Event::OnPaddingChange, cb ); mCloseButton->addEventListener( Event::OnMarginChange, cb ); mCloseButton->addEventListener( Event::OnSizeChange, cb ); + mCloseButton->addEventListener( Event::OnVisibleChange, cb ); applyDefaultTheme(); unsetFlags( UI_DRAG_VERTICAL ); } @@ -167,6 +168,10 @@ void UITab::removeTab( bool destroyOwnedNode, bool immediateClose ) { getTabWidget()->removeTab( this, destroyOwnedNode, immediateClose ); } +UIWidget* UITab::getCloseButton() const { + return mCloseButton; +} + void UITab::setTheme( UITheme* Theme ) { UIWidget::setTheme( Theme ); @@ -231,11 +236,6 @@ UIPushButton* UITab::setText( const String& text ) { void UITab::onAutoSize() { UITabWidget* tTabW = getTabWidget(); - if ( NULL != tTabW ) { - mCloseButton->setVisible( tTabW->getTabsClosable() ); - mCloseButton->setEnabled( tTabW->getTabsClosable() ); - } - if ( ( mFlags & UI_AUTO_SIZE ) == 0 ) return; diff --git a/src/eepp/ui/uitabwidget.cpp b/src/eepp/ui/uitabwidget.cpp index d82e41f4d..4b1120670 100644 --- a/src/eepp/ui/uitabwidget.cpp +++ b/src/eepp/ui/uitabwidget.cpp @@ -171,6 +171,8 @@ std::string UITabWidget::getPropertyString( const PropertyDefinition* propertyDe return getAllowDragAndDropTabs() ? "true" : "false"; case PropertyId::TabAllowSwitchTabsInEmptySpaces: return getAllowSwitchTabsInEmptySpaces() ? "true" : "false"; + case PropertyId::TabCloseButtonVisible: + return getTabCloseButtonVisible() ? "true" : "false"; case PropertyId::DroppableHoveringColor: return !mDroppableHoveringColorWasSet ? UIWidget::getPropertyString( propertyDef, propertyIndex ) @@ -193,7 +195,8 @@ std::vector UITabWidget::getPropertiesImplemented() const { PropertyId::TabBarAllowRearrange, PropertyId::TabBarAllowDragAndDrop, PropertyId::TabAllowSwitchTabsInEmptySpaces, - PropertyId::DroppableHoveringColor }; + PropertyId::DroppableHoveringColor, + PropertyId::TabCloseButtonVisible }; props.insert( props.end(), local.begin(), local.end() ); return props; } @@ -271,6 +274,9 @@ bool UITabWidget::applyProperty( const StyleSheetProperty& attribute ) { case PropertyId::TabAllowSwitchTabsInEmptySpaces: setAllowSwitchTabsInEmptySpaces( attribute.asBool() ); break; + case PropertyId::TabCloseButtonVisible: + setTabCloseButtonVisible( attribute.asBool() ); + break; case PropertyId::DroppableHoveringColor: setDroppableHoveringColor( attribute.asColor() ); break; @@ -340,6 +346,18 @@ void UITabWidget::setTabsClosable( bool tabsClosable ) { } } +bool UITabWidget::getTabCloseButtonVisible() const { + return mStyleConfig.TabCloseButtonVisible; +} + +void UITabWidget::setTabCloseButtonVisible( bool visible ) { + if ( mStyleConfig.TabCloseButtonVisible != visible ) { + mStyleConfig.TabCloseButtonVisible = visible; + updateTabs(); + invalidateDraw(); + } +} + bool UITabWidget::getSpecialBorderTabs() const { return mStyleConfig.TabsEdgesDiffSkins; } @@ -424,10 +442,16 @@ void UITabWidget::posTabs() { void UITabWidget::zorderTabs() { for ( Uint32 i = 0; i < mTabs.size(); i++ ) { mTabs[i]->toBack(); + mTabs[i]->removeClass( "next" ); + mTabs[i]->removeClass( "prev" ); } if ( NULL != mTabSelected ) { mTabSelected->toFront(); + if ( mTabSelectedIndex > 0 ) + mTabs[mTabSelectedIndex - 1]->addClass( "prev" ); + if ( mTabSelectedIndex + 1 < mTabs.size() ) + mTabs[mTabSelectedIndex + 1]->addClass( "next" ); } } @@ -458,6 +482,11 @@ UITab* UITabWidget::createTab( const String& text, UINode* nodeOwned, Drawable* tab->setVisible( true ); tab->setEnabled( true ); tab->setOwnedWidget( nodeOwned ); + if ( tab->getCloseButton() ) { + tab->getCloseButton() + ->setVisible( mStyleConfig.TabsClosable && mStyleConfig.TabCloseButtonVisible ) + ->setEnabled( mStyleConfig.TabsClosable && mStyleConfig.TabCloseButtonVisible ); + } nodeOwned->setParent( mNodeContainer ); nodeOwned->setVisible( false ); nodeOwned->setEnabled( true ); @@ -877,6 +906,7 @@ void UITabWidget::swapTabs( UITab* left, UITab* right ) { mTabs[leftIndex] = right; mTabs[rightIndex] = left; posTabs(); + zorderTabs(); } } diff --git a/src/eepp/ui/uiwidgetcreator.cpp b/src/eepp/ui/uiwidgetcreator.cpp index 614f216ce..a871a7f79 100644 --- a/src/eepp/ui/uiwidgetcreator.cpp +++ b/src/eepp/ui/uiwidgetcreator.cpp @@ -120,45 +120,45 @@ void UIWidgetCreator::createBaseWidgetList() { } } -UIWidget* UIWidgetCreator::createFromName( std::string widgetName ) { +UIWidget* UIWidgetCreator::createFromName( const std::string& widgetName ) { createBaseWidgetList(); - String::toLowerInPlace( widgetName ); + std::string lwidgetName( String::toLower( widgetName ) ); - if ( registeredWidget.find( widgetName ) != registeredWidget.end() ) { - return registeredWidget[widgetName](); + if ( registeredWidget.find( lwidgetName ) != registeredWidget.end() ) { + return registeredWidget[lwidgetName](); } - if ( widgetCallback.find( widgetName ) != widgetCallback.end() ) { - return widgetCallback[widgetName]( widgetName ); + if ( widgetCallback.find( lwidgetName ) != widgetCallback.end() ) { + return widgetCallback[lwidgetName]( lwidgetName ); } return NULL; } -void UIWidgetCreator::addCustomWidgetCallback( std::string widgetName, +void UIWidgetCreator::addCustomWidgetCallback( const std::string& widgetName, const UIWidgetCreator::CustomWidgetCb& cb ) { widgetCallback[String::toLower( widgetName )] = cb; } -void UIWidgetCreator::removeCustomWidgetCallback( std::string widgetName ) { +void UIWidgetCreator::removeCustomWidgetCallback( const std::string& widgetName ) { widgetCallback.erase( String::toLower( widgetName ) ); } -bool UIWidgetCreator::existsCustomWidgetCallback( std::string widgetName ) { +bool UIWidgetCreator::existsCustomWidgetCallback( const std::string& widgetName ) { return widgetCallback.find( String::toLower( widgetName ) ) != widgetCallback.end(); } -void UIWidgetCreator::registerWidget( std::string widgetName, +void UIWidgetCreator::registerWidget( const std::string& widgetName, const UIWidgetCreator::RegisterWidgetCb& cb ) { registeredWidget[String::toLower( widgetName )] = cb; } -void UIWidgetCreator::unregisterWidget( std::string widgetName ) { +void UIWidgetCreator::unregisterWidget( const std::string& widgetName ) { registeredWidget.erase( String::toLower( widgetName ) ); } -bool UIWidgetCreator::isWidgetRegistered( std::string widgetName ) { +bool UIWidgetCreator::isWidgetRegistered( const std::string& widgetName ) { return registeredWidget.find( String::toLower( widgetName ) ) != registeredWidget.end(); } @@ -168,10 +168,10 @@ const UIWidgetCreator::RegisteredWidgetCallbackMap& UIWidgetCreator::getRegister std::vector UIWidgetCreator::getWidgetNames() { std::vector names; + names.reserve( registeredWidget.size() ); createBaseWidgetList(); - for ( auto& widgetIt : registeredWidget ) { + for ( const auto& widgetIt : registeredWidget ) names.push_back( widgetIt.first ); - } return names; }