Browse Source

Add SubWidget::toBottom

pull/321/merge
falkTX 3 years ago
parent
commit
f588443996
2 changed files with 14 additions and 0 deletions
  1. +6
    -0
      dgl/SubWidget.hpp
  2. +8
    -0
      dgl/src/SubWidget.cpp

+ 6
- 0
dgl/SubWidget.hpp View File

@@ -137,6 +137,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".


+ 8
- 0
dgl/src/SubWidget.cpp View File

@@ -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);


Loading…
Cancel
Save