added missing file

This commit is contained in:
fourtf 2020-10-22 23:46:36 +02:00
parent b8f6a1ca87
commit 3d9d7d54d5

34
src/util/LayoutHelper.cpp Normal file
View file

@ -0,0 +1,34 @@
#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