DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit f588443996c3a115748d0d712ed73ca4a4fd6e8a
parent 6cf523adada34df242dc1bf4b33bfb025284c631
Author: falkTX <falktx@falktx.com>
Date:   Tue, 23 Aug 2022 03:46:37 +0100

Add SubWidget::toBottom

Diffstat:
Mdgl/SubWidget.hpp | 6++++++
Mdgl/src/SubWidget.cpp | 8++++++++
2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/dgl/SubWidget.hpp b/dgl/SubWidget.hpp @@ -138,6 +138,12 @@ public: void repaint() noexcept override; /** + Pushes this widget to the "bottom" of the parent widget. + Makes the widget behave as if it was the first to be registered on the parent widget, thus being "on bottom". + */ + virtual void toBottom(); + + /** Bring this widget to the "front" of the parent widget. Makes the widget behave as if it was the last to be registered on the parent widget, thus being "in front". */ diff --git a/dgl/src/SubWidget.cpp b/dgl/src/SubWidget.cpp @@ -145,6 +145,14 @@ void SubWidget::repaint() noexcept } } +void SubWidget::toBottom() +{ + std::list<SubWidget*>& subwidgets(pData->parentWidget->pData->subWidgets); + + subwidgets.remove(this); + subwidgets.insert(subwidgets.begin(), this); +} + void SubWidget::toFront() { std::list<SubWidget*>& subwidgets(pData->parentWidget->pData->subWidgets);