feat: prefer visible/selected channels when joining (#5850)

This commit is contained in:
nerix
2025-01-24 12:43:30 +01:00
committed by GitHub
parent f4ff62f908
commit 35b15c4088
4 changed files with 48 additions and 13 deletions
+20
View File
@@ -595,6 +595,26 @@ void WindowManager::toggleAllOverlayInertia()
}
}
std::set<QString> WindowManager::getVisibleChannelNames() const
{
std::set<QString> visible;
for (auto *window : this->windows_)
{
auto *page = window->getNotebook().getSelectedPage();
if (!page)
{
continue;
}
for (auto *split : page->getSplits())
{
visible.emplace(split->getChannel()->getName());
}
}
return visible;
}
void WindowManager::encodeTab(SplitContainer *tab, bool isSelected,
QJsonObject &obj)
{
+3
View File
@@ -9,6 +9,7 @@
#include <QTimer>
#include <memory>
#include <set>
namespace chatterino {
@@ -131,6 +132,8 @@ public:
/// Toggles the inertia in all open overlay windows
void toggleAllOverlayInertia();
std::set<QString> getVisibleChannelNames() const;
/// Signals
pajlada::Signals::NoArgSignal gifRepaintRequested;