use different window frame for user popup based on the setting

This commit is contained in:
fourtf
2020-08-13 17:17:53 +02:00
parent b2ae2e598f
commit 6f4f66b9d0
4 changed files with 13 additions and 9 deletions
+10 -2
View File
@@ -87,13 +87,21 @@ namespace {
};
} // namespace
UserInfoPopup::UserInfoPopup()
: BaseWindow(BaseWindow::EnableCustomFrame)
UserInfoPopup::UserInfoPopup(bool closeAutomatically)
: BaseWindow(
closeAutomatically
? FlagsEnum<BaseWindow::Flags>{BaseWindow::EnableCustomFrame,
BaseWindow::Frameless,
BaseWindow::FramelessDraggable}
: BaseWindow::EnableCustomFrame)
, hack_(new bool)
{
this->setWindowTitle("Usercard");
this->setStayInScreenRect(true);
if (closeAutomatically)
this->setActionOnFocusLoss(BaseWindow::Delete);
// Close the popup when Escape is pressed
createWindowShortcut(this, "Escape", [this] { this->deleteLater(); });