fmoved windows message handlers into their own functions

This commit is contained in:
fourtf
2018-07-03 13:04:27 +02:00
parent eb809d1572
commit 9f6d09db7c
2 changed files with 251 additions and 209 deletions
+10 -2
View File
@@ -7,6 +7,8 @@
#include <pajlada/signals/signalholder.hpp>
class QHBoxLayout;
struct tagMSG;
typedef struct tagMSG MSG;
namespace chatterino {
@@ -30,6 +32,7 @@ public:
};
explicit BaseWindow(QWidget *parent = nullptr, Flags flags_ = None);
virtual ~BaseWindow() = default;
QWidget *getLayoutContainer();
bool hasCustomWindowFrame();
@@ -46,10 +49,8 @@ public:
Flags getFlags();
protected:
#ifdef USEWINSDK
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
virtual void scaleChangedEvent(float) override;
#endif
virtual void paintEvent(QPaintEvent *) override;
@@ -73,6 +74,13 @@ private:
void init();
void moveIntoDesktopRect(QWidget *parent);
void calcButtonsSizes();
void drawCustomWindowFrame(QPainter &painter);
bool handleDPICHANGED(MSG *msg);
bool handleSHOWWINDOW(MSG *msg);
bool handleNCCALCSIZE(MSG *msg, long *result);
bool handleSIZE(MSG *msg);
bool handleNCHITTEST(MSG *msg, long *result);
bool enableCustomFrame_;
bool frameless_;