diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-02-26 13:17:04 +0200 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-02-26 13:17:04 +0200 |
commit | c75a136973a2eaae53223e7374a196c04b7aa6f6 (patch) | |
tree | 7230bf803be679815294c31c4909a5440967bc7b /src/MainWindow.cc | |
parent | Fix & cleanup nix files (#240) (diff) | |
download | nheko-c75a136973a2eaae53223e7374a196c04b7aa6f6.tar.xz |
Enable room switcher only in the chat view (#251)
Diffstat (limited to '')
-rw-r--r-- | src/MainWindow.cc | 10 |
1 files changed, 9 insertions, 1 deletions
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()); +} |