diff options
author | Joseph Donofry <joedonofry@gmail.com> | 2021-01-26 17:23:28 -0500 |
---|---|---|
committer | Joseph Donofry <joedonofry@gmail.com> | 2021-01-26 17:23:28 -0500 |
commit | bfeb766a91e259dce7924fb0bbcfcac85b91092b (patch) | |
tree | f9423ca7fa9dbb324ba9372a29c292777a87c6cd /src/MainWindow.cpp | |
parent | Fix formatting (diff) | |
download | nheko-bfeb766a91e259dce7924fb0bbcfcac85b91092b.tar.xz |
Implement Privacy Screen
* Add handles for window focus gained / focus lossed and connect to timer * Clean up some of the PrivacyScreen.qml code * Connect settings to PrivacyScreen visibility
Diffstat (limited to 'src/MainWindow.cpp')
-rw-r--r-- | src/MainWindow.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 77269008..8fd5c7e2 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -130,6 +130,9 @@ MainWindow::MainWindow(QWidget *parent) SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); connect(chat_page_, SIGNAL(contentLoaded()), this, SLOT(removeOverlayProgressBar())); + + connect(this, &MainWindow::focusChanged, chat_page_, &ChatPage::chatFocusChanged); + connect( chat_page_, &ChatPage::showUserSettingsPage, this, &MainWindow::showUserSettingsPage); @@ -204,6 +207,19 @@ MainWindow::resizeEvent(QResizeEvent *event) QMainWindow::resizeEvent(event); } +bool +MainWindow::event(QEvent *event) +{ + auto type = event->type(); + if (type == QEvent::WindowActivate) { + emit focusChanged(true); + } else if (type == QEvent::WindowDeactivate) { + emit focusChanged(false); + } + + return QMainWindow::event(event); +} + void MainWindow::adjustSideBars() { |