feat: prefer visible/selected channels when joining (#5850)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user