mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 13:08:48 +03:00
Enable room switcher only in the chat view (#251)
This commit is contained in:
parent
ea268d9761
commit
c75a136973
2 changed files with 11 additions and 1 deletions
|
@ -83,6 +83,8 @@ private slots:
|
||||||
private:
|
private:
|
||||||
bool hasActiveUser();
|
bool hasActiveUser();
|
||||||
void restoreWindowSize();
|
void restoreWindowSize();
|
||||||
|
//! Check if there is an open dialog.
|
||||||
|
bool hasActiveDialogs() const;
|
||||||
|
|
||||||
static MainWindow *instance_;
|
static MainWindow *instance_;
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,8 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
|
|
||||||
QShortcut *quickSwitchShortcut = new QShortcut(QKeySequence("Ctrl+K"), this);
|
QShortcut *quickSwitchShortcut = new QShortcut(QKeySequence("Ctrl+K"), this);
|
||||||
connect(quickSwitchShortcut, &QShortcut::activated, this, [this]() {
|
connect(quickSwitchShortcut, &QShortcut::activated, this, [this]() {
|
||||||
chat_page_->showQuickSwitcher();
|
if (chat_page_->isVisible() && !hasActiveDialogs())
|
||||||
|
chat_page_->showQuickSwitcher();
|
||||||
});
|
});
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
@ -289,3 +290,10 @@ MainWindow::showOverlayProgressBar()
|
||||||
progressModal_->show();
|
progressModal_->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
MainWindow::hasActiveDialogs() const
|
||||||
|
{
|
||||||
|
return (!leaveRoomModal_.isNull() && leaveRoomModal_->isVisible()) ||
|
||||||
|
(!progressModal_.isNull() && progressModal_->isVisible());
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue