2018-06-26 14:09:39 +02:00
|
|
|
#include "StreamView.hpp"
|
2018-01-19 14:48:17 +01:00
|
|
|
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "Channel.hpp"
|
|
|
|
#include "util/Helpers.hpp"
|
|
|
|
#include "util/LayoutCreator.hpp"
|
|
|
|
#include "widgets/Split.hpp"
|
2018-01-19 14:48:17 +01:00
|
|
|
|
|
|
|
#ifdef USEWEBENGINE
|
|
|
|
#include <QtWebEngineWidgets>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
namespace widgets {
|
2018-04-03 02:55:32 +02:00
|
|
|
|
2018-04-07 12:53:10 +02:00
|
|
|
StreamView::StreamView(ChannelPtr channel, const QUrl &url)
|
2018-01-19 14:48:17 +01:00
|
|
|
{
|
|
|
|
util::LayoutCreator<StreamView> layoutCreator(this);
|
|
|
|
|
|
|
|
#ifdef USEWEBENGINE
|
|
|
|
auto web = layoutCreator.emplace<QWebEngineView>(this).assign(&this->stream);
|
|
|
|
web->setUrl(url);
|
|
|
|
web->settings()->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, true);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
auto chat = layoutCreator.emplace<ChannelView>();
|
|
|
|
chat->setFixedWidth(300);
|
|
|
|
chat->setChannel(channel);
|
|
|
|
|
|
|
|
this->layout()->setSpacing(0);
|
|
|
|
this->layout()->setMargin(0);
|
|
|
|
}
|
2018-04-03 02:55:32 +02:00
|
|
|
|
2018-01-19 14:48:17 +01:00
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|