Added ability to clear items in vertical layout.

This commit is contained in:
23rd 2022-11-29 14:10:47 +03:00
parent 4a0c3ead7a
commit c197c1831d
2 changed files with 8 additions and 0 deletions

View file

@ -198,4 +198,10 @@ void VerticalLayout::removeChild(RpWidget *child) {
resize(width(), margins.top() + top + margins.bottom());
}
void VerticalLayout::clear() {
while (!_rows.empty()) {
removeChild(_rows.front().widget.data());
}
}
} // namespace Ui

View file

@ -54,6 +54,8 @@ public:
void setVerticalShift(int index, int shift);
void reorderRows(int oldIndex, int newIndex);
void clear();
protected:
int resizeGetHeight(int newWidth) override;
void visibleTopBottomUpdated(