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

remotes/origin/HEAD
Konstantinos Sideris 7 years ago
parent ea268d9761
commit c75a136973
  1. 2
      include/MainWindow.h
  2. 10
      src/MainWindow.cc

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

@ -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());
}

Loading…
Cancel
Save