feat: add Quick Switcher item to open channel in a new popup window (#3828)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Leon Richardt
2022-06-25 13:00:32 +02:00
committed by GitHub
parent 6e0852fb49
commit 6a58ce1273
8 changed files with 173 additions and 3 deletions
@@ -6,6 +6,7 @@
#include "util/LayoutCreator.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/Window.hpp"
#include "widgets/dialogs/switcher/NewPopupItem.hpp"
#include "widgets/dialogs/switcher/NewTabItem.hpp"
#include "widgets/dialogs/switcher/SwitchSplitItem.hpp"
#include "widgets/helper/NotebookTab.hpp"
@@ -113,11 +114,14 @@ void QuickSwitcherPopup::updateSuggestions(const QString &text)
nextPage:;
}
// Add item for opening a channel in a new tab
// Add item for opening a channel in a new tab or new popup
if (!text.isEmpty())
{
auto item = std::make_unique<NewTabItem>(text);
this->switcherModel_.addItem(std::move(item));
auto newTabItem = std::make_unique<NewTabItem>(text);
this->switcherModel_.addItem(std::move(newTabItem));
auto newPopupItem = std::make_unique<NewPopupItem>(text);
this->switcherModel_.addItem(std::move(newPopupItem));
}
const auto &startIdx = this->switcherModel_.index(0);