2019-12-14 12:57:16 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common/FlagsEnum.hpp"
|
|
|
|
#include "widgets/BaseWindow.hpp"
|
|
|
|
|
2021-08-15 15:59:52 +02:00
|
|
|
class QDialogButtonBox;
|
|
|
|
|
2019-12-14 12:57:16 +01:00
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class BasePopup : public BaseWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit BasePopup(FlagsEnum<BaseWindow::Flags> flags_ = None,
|
|
|
|
QWidget *parent = nullptr);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void keyPressEvent(QKeyEvent *e) override;
|
2021-08-15 15:59:52 +02:00
|
|
|
|
|
|
|
// handleEscape is a helper function for clicking the "Reject" role button of a button box when the Escape button is pressed
|
|
|
|
bool handleEscape(QKeyEvent *e, QDialogButtonBox *buttonBox);
|
|
|
|
|
|
|
|
// handleEnter is a helper function for clicking the "Accept" role button of a button box when Return or Enter is pressed
|
|
|
|
bool handleEnter(QKeyEvent *e, QDialogButtonBox *buttonBox);
|
2019-12-14 12:57:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|