1
0
Эх сурвалжийг харах

UI: Add Twitch Activity Feed

Closes obsproject/obs-studio#1721
Alex Anderson 6 жил өмнө
parent
commit
7e23d1b63e

+ 23 - 0
UI/auth-twitch.cpp

@@ -326,18 +326,41 @@ void TwitchAuth::LoadSecondaryUIPanes()
 
 	/* ----------------------------------- */
 
+	url = "https://www.twitch.tv/popout/";
+	url += name;
+	url += "/dashboard/live/activity-feed";
+
+	feed.reset(new TwitchWidget());
+	feed->setObjectName("twitchFeed");
+	feed->resize(300, 650);
+	feed->setMinimumSize(200, 300);
+	feed->setWindowTitle(QTStr("TwitchAuth.Feed"));
+	feed->setAllowedAreas(Qt::AllDockWidgetAreas);
+
+	browser = cef->create_widget(nullptr, url, panel_cookies);
+	feed->SetWidget(browser);
+	browser->setStartupScript(script);
+
+	main->addDockWidget(Qt::RightDockWidgetArea, feed.data());
+	feedMenu.reset(main->AddDockWidget(feed.data()));
+
+	/* ----------------------------------- */
+
 	info->setFloating(true);
 	stat->setFloating(true);
+	feed->setFloating(true);
 
 	QSize statSize = stat->frameSize();
 
 	info->move(pos.x() + 50, pos.y() + 50);
 	stat->move(pos.x() + size.width()  / 2 - statSize.width()  / 2,
 	           pos.y() + size.height() / 2 - statSize.height() / 2);
+	feed->move(pos.x() + 100, pos.y() + 100);
 
 	if (firstLoad) {
 		info->setVisible(true);
 		stat->setVisible(false);
+		feed->setVisible(false);
 	} else {
 		const char *dockStateStr = config_get_string(main->Config(),
 				service(), "DockState");

+ 2 - 0
UI/auth-twitch.hpp

@@ -17,9 +17,11 @@ class TwitchAuth : public OAuthStreamKey {
 	QSharedPointer<TwitchWidget> chat;
 	QSharedPointer<TwitchWidget> info;
 	QSharedPointer<TwitchWidget> stat;
+	QSharedPointer<TwitchWidget> feed;
 	QSharedPointer<QAction> chatMenu;
 	QSharedPointer<QAction> infoMenu;
 	QSharedPointer<QAction> statMenu;
+	QSharedPointer<QAction> feedMenu;
 	bool uiLoaded = false;
 
 	std::string name;

+ 1 - 0
UI/data/locale/en-US.ini

@@ -110,6 +110,7 @@ Auth.ChannelFailure.Text="Failed to load channel information for %1\n\n%2: %3"
 Auth.Chat="Chat"
 Auth.StreamInfo="Stream Information"
 TwitchAuth.Stats="Twitch Stats"
+TwitchAuth.Feed="Twitch Activity Feed"
 
 # copy filters
 Copy.Filters="Copy Filters"