mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 09:05:57 -05:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc4a3560d8 | ||
|
|
3ab2ea9e66 |
@@ -181,12 +181,6 @@ static bool windowIsValid(HWND window)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD id;
|
|
||||||
GetWindowThreadProcessId(window, &id);
|
|
||||||
if (id == GetCurrentProcessId()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only accept for top level windows and not controls within them
|
// Only accept for top level windows and not controls within them
|
||||||
if (window != GetAncestor(window, GA_ROOT)) {
|
if (window != GetAncestor(window, GA_ROOT)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ static void setTabVisible(QTabWidget *tabWidget, bool visible)
|
|||||||
obs_module_text("AdvSceneSwitcher.twitchConnectionTab.title"));
|
obs_module_text("AdvSceneSwitcher.twitchConnectionTab.title"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool twitchTabIsSelected(QTabWidget *tabWidget)
|
||||||
|
{
|
||||||
|
return tabWidget->tabText(tabWidget->currentIndex()) ==
|
||||||
|
obs_module_text("AdvSceneSwitcher.twitchConnectionTab.title");
|
||||||
|
}
|
||||||
|
|
||||||
TwitchConnectionsTable *TwitchConnectionsTable::Create()
|
TwitchConnectionsTable *TwitchConnectionsTable::Create()
|
||||||
{
|
{
|
||||||
tabWidget = new TwitchConnectionsTable();
|
tabWidget = new TwitchConnectionsTable();
|
||||||
@@ -211,11 +217,11 @@ static void setupTab(QTabWidget *tab)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
auto timer = new QTimer(tabWidget);
|
QWidget::connect(tab, &QTabWidget::currentChanged, [tab]() {
|
||||||
timer->setInterval(1000);
|
if (twitchTabIsSelected(tab)) {
|
||||||
QWidget::connect(timer, &QTimer::timeout,
|
updateConnectionStatus(tabWidget->Table());
|
||||||
[]() { updateConnectionStatus(tabWidget->Table()); });
|
}
|
||||||
timer->start();
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
Reference in New Issue
Block a user