mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
added missing file
This commit is contained in:
parent
b8f6a1ca87
commit
3d9d7d54d5
1 changed files with 34 additions and 0 deletions
34
src/util/LayoutHelper.cpp
Normal file
34
src/util/LayoutHelper.cpp
Normal 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
|
Loading…
Reference in a new issue