From c75a136973a2eaae53223e7374a196c04b7aa6f6 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Mon, 26 Feb 2018 13:17:04 +0200 Subject: Enable room switcher only in the chat view (#251) --- src/MainWindow.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/MainWindow.cc') diff --git a/src/MainWindow.cc b/src/MainWindow.cc index 56aef005..ea30b694 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc @@ -118,7 +118,8 @@ MainWindow::MainWindow(QWidget *parent) QShortcut *quickSwitchShortcut = new QShortcut(QKeySequence("Ctrl+K"), this); connect(quickSwitchShortcut, &QShortcut::activated, this, [this]() { - chat_page_->showQuickSwitcher(); + if (chat_page_->isVisible() && !hasActiveDialogs()) + chat_page_->showQuickSwitcher(); }); QSettings settings; @@ -289,3 +290,10 @@ MainWindow::showOverlayProgressBar() progressModal_->show(); } } + +bool +MainWindow::hasActiveDialogs() const +{ + return (!leaveRoomModal_.isNull() && leaveRoomModal_->isVisible()) || + (!progressModal_.isNull() && progressModal_->isVisible()); +} -- cgit 1.4.1