Add a "BasePopup" class, which helps add default functionality to any popups (like the search popup)

This commit is contained in:
Rasmus Karlsson
2019-12-14 12:57:16 +01:00
parent dd77a0088a
commit 55080bd354
5 changed files with 45 additions and 15 deletions
+21
View File
@@ -0,0 +1,21 @@
#include "widgets/BasePopup.hpp"
namespace chatterino {
BasePopup::BasePopup(FlagsEnum<Flags> _flags, QWidget *parent)
: BaseWindow(std::move(_flags), parent)
{
}
void BasePopup::keyPressEvent(QKeyEvent *e)
{
if (e->key() == Qt::Key_Escape)
{
this->close();
return;
}
BaseWindow::keyPressEvent(e);
}
} // namespace chatterino