mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
35 lines
628 B
C++
35 lines
628 B
C++
|
#include "util/LayoutHelper.hpp"
|
||
|
|
||
|
#include <QScrollArea>
|
||
|
#include <QWidget>
|
||
|
|
||
|
namespace chatterino {
|
||
|
|
||
|
QWidget *wrapLayout(QLayout *layout)
|
||
|
{
|
||
|
auto widget = new QWidget;
|
||
|
widget->setLayout(layout);
|
||
|
return widget;
|
||
|
}
|
||
|
|
||
|
QScrollArea *makeScrollArea(LayoutItem item)
|
||
|
{
|
||
|
auto area = new QScrollArea();
|
||
|
|
||
|
switch (item.which())
|
||
|
{
|
||
|
case 0:
|
||
|
area->setWidget(boost::get<QWidget *>(item));
|
||
|
break;
|
||
|
case 1:
|
||
|
area->setWidget(wrapLayout(boost::get<QLayout *>(item)));
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
area->setWidgetResizable(true);
|
||
|
|
||
|
return area;
|
||
|
}
|
||
|
|
||
|
} // namespace chatterino
|