Add BaseWidget::ShowChildren
This commit is contained in:
parent
9d88fcd649
commit
adf1233ef2
|
|
@ -75,6 +75,7 @@ namespace Ndk
|
|||
|
||||
bool HasFocus() const;
|
||||
|
||||
inline void Hide();
|
||||
inline bool IsVisible() const;
|
||||
|
||||
void Resize(const Nz::Vector2f& size);
|
||||
|
|
@ -128,6 +129,8 @@ namespace Ndk
|
|||
|
||||
inline void SetPreferredSize(const Nz::Vector2f& preferredSize);
|
||||
|
||||
virtual void ShowChildren(bool show);
|
||||
|
||||
private:
|
||||
inline BaseWidget();
|
||||
|
||||
|
|
|
|||
|
|
@ -172,6 +172,11 @@ namespace Ndk
|
|||
return m_children.size();
|
||||
}
|
||||
|
||||
inline void BaseWidget::Hide()
|
||||
{
|
||||
return Show(false);
|
||||
}
|
||||
|
||||
inline bool BaseWidget::IsVisible() const
|
||||
{
|
||||
return m_visible;
|
||||
|
|
|
|||
|
|
@ -188,8 +188,7 @@ namespace Ndk
|
|||
}
|
||||
}
|
||||
|
||||
for (const auto& widgetPtr : m_children)
|
||||
widgetPtr->Show(show);
|
||||
ShowChildren(show);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -313,6 +312,12 @@ namespace Ndk
|
|||
{
|
||||
}
|
||||
|
||||
void BaseWidget::ShowChildren(bool show)
|
||||
{
|
||||
for (const auto& widgetPtr : m_children)
|
||||
widgetPtr->Show(show);
|
||||
}
|
||||
|
||||
void BaseWidget::DestroyChild(BaseWidget* widget)
|
||||
{
|
||||
auto it = std::find_if(m_children.begin(), m_children.end(), [widget] (const std::unique_ptr<BaseWidget>& widgetPtr) -> bool
|
||||
|
|
|
|||
Loading…
Reference in New Issue