1 #include "StreamView.hpp" 2 3 #include "common/Channel.hpp" 4 #include "util/Helpers.hpp" 5 #include "util/LayoutCreator.hpp" 6 #include "widgets/helper/ChannelView.hpp" 7 #include "widgets/splits/Split.hpp" 8 9 #ifdef USEWEBENGINE 10 # include <QtWebEngineWidgets> 11 #endif 12 13 namespace chatterino { 14 StreamView(ChannelPtr channel,const QUrl & url)15StreamView::StreamView(ChannelPtr channel, const QUrl &url) 16 { 17 LayoutCreator<StreamView> layoutCreator(this); 18 19 #ifdef USEWEBENGINE 20 auto web = 21 layoutCreator.emplace<QWebEngineView>(this).assign(&this->stream); 22 web->setUrl(url); 23 web->settings()->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, 24 true); 25 #endif 26 27 auto chat = layoutCreator.emplace<ChannelView>(); 28 chat->setFixedWidth(300); 29 chat->setChannel(std::move(channel)); 30 31 this->layout()->setSpacing(0); 32 this->layout()->setMargin(0); 33 } 34 35 } // namespace chatterino 36