Enable room switcher only in the chat view (#251)

This commit is contained in:
Konstantinos Sideris 2018-02-26 13:17:04 +02:00
parent ea268d9761
commit c75a136973
2 changed files with 11 additions and 1 deletions

View file

@ -83,6 +83,8 @@ private slots:
private:
bool hasActiveUser();
void restoreWindowSize();
//! Check if there is an open dialog.
bool hasActiveDialogs() const;
static MainWindow *instance_;

View file

@ -118,6 +118,7 @@ MainWindow::MainWindow(QWidget *parent)
QShortcut *quickSwitchShortcut = new QShortcut(QKeySequence("Ctrl+K"), this);
connect(quickSwitchShortcut, &QShortcut::activated, this, [this]() {
if (chat_page_->isVisible() && !hasActiveDialogs())
chat_page_->showQuickSwitcher();
});
@ -289,3 +290,10 @@ MainWindow::showOverlayProgressBar()
progressModal_->show();
}
}
bool
MainWindow::hasActiveDialogs() const
{
return (!leaveRoomModal_.isNull() && leaveRoomModal_->isVisible()) ||
(!progressModal_.isNull() && progressModal_->isVisible());
}