From 0a0cfb8e48c3c6930f8dd18bcbdb769d2ec6f875 Mon Sep 17 00:00:00 2001 From: Leon Richardt Date: Sun, 29 Nov 2020 10:48:23 +0100 Subject: [PATCH] fix: make LoginWidget child of AccountsPage (#2234) --- CHANGELOG.md | 2 +- src/widgets/dialogs/LoginDialog.cpp | 3 ++- src/widgets/dialogs/LoginDialog.hpp | 2 +- src/widgets/settingspages/AccountsPage.cpp | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40989ceed..abfe3e296 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,7 @@ - Minor: Improve UX of the "Login expired!" message (#2029) - Minor: PageUp and PageDown now scroll in the selected split (#2070, #2081) - Minor: Allow highlights to be excluded from `/mentions`. Excluded highlights will not trigger tab highlights either. (#1793, #2036) -- Minor: Flag all popup dialogs as actual dialogs so they get the relevant window manager hints (#1843, #2182, #2185, #2232) +- Minor: Flag all popup dialogs as actual dialogs so they get the relevant window manager hints (#1843, #2182, #2185, #2232, #2234) - Minor: Don't show update button for nightly builds on macOS and Linux, this was already the case for Windows (#2163, #2164) - Bugfix: Fix crash occurring when pressing Escape in the Color Picker Dialog (#1843) - Bugfix: Fix bug preventing users from setting the highlight color of the second entry in the "User" highlights tab (#1898) diff --git a/src/widgets/dialogs/LoginDialog.cpp b/src/widgets/dialogs/LoginDialog.cpp index 9d583942f..011d4d47e 100644 --- a/src/widgets/dialogs/LoginDialog.cpp +++ b/src/widgets/dialogs/LoginDialog.cpp @@ -245,7 +245,8 @@ void AdvancedLoginWidget::refreshButtons() } } -LoginWidget::LoginWidget() +LoginWidget::LoginWidget(QWidget *parent) + : QDialog(parent) { #ifdef USEWINSDK ::SetWindowPos(HWND(this->winId()), HWND_TOPMOST, 0, 0, 0, 0, diff --git a/src/widgets/dialogs/LoginDialog.hpp b/src/widgets/dialogs/LoginDialog.hpp index 4fa4b2803..154e063c9 100644 --- a/src/widgets/dialogs/LoginDialog.hpp +++ b/src/widgets/dialogs/LoginDialog.hpp @@ -64,7 +64,7 @@ public: class LoginWidget : public QDialog { public: - LoginWidget(); + LoginWidget(QWidget *parent); private: struct { diff --git a/src/widgets/settingspages/AccountsPage.cpp b/src/widgets/settingspages/AccountsPage.cpp index 61a7a6c62..1c53becbf 100644 --- a/src/widgets/settingspages/AccountsPage.cpp +++ b/src/widgets/settingspages/AccountsPage.cpp @@ -32,8 +32,8 @@ AccountsPage::AccountsPage() view->getTableView()->horizontalHeader()->setVisible(false); view->getTableView()->horizontalHeader()->setStretchLastSection(true); - view->addButtonPressed.connect([] { - static auto loginWidget = new LoginWidget(); + view->addButtonPressed.connect([this] { + static auto loginWidget = new LoginWidget(this); loginWidget->show(); loginWidget->raise();