2019-09-08 22:27:57 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "widgets/BaseWidget.hpp"
|
|
|
|
|
2022-12-31 15:41:01 +01:00
|
|
|
#include <pajlada/signals/signalholder.hpp>
|
Sort and force grouping of includes (#4172)
This change enforces strict include grouping using IncludeCategories
In addition to adding this to the .clang-format file and applying it in the tests/src and src directories, I also did the following small changes:
In ChatterSet.hpp, I changed lrucache to a <>include
In Irc2.hpp, I change common/SignalVector.hpp to a "project-include"
In AttachedWindow.cpp, NativeMessaging.cpp, WindowsHelper.hpp, BaseWindow.cpp, and StreamerMode.cpp, I disabled clang-format for the windows-includes
In WindowDescriptors.hpp, I added the missing vector include. It was previously not needed because the include was handled by another file that was previously included first.
clang-format minimum version has been bumped, so Ubuntu version used in the check-formatting job has been bumped to 22.04 (which is the latest LTS)
2022-11-27 19:32:53 +01:00
|
|
|
#include <QGridLayout>
|
|
|
|
#include <QPushButton>
|
|
|
|
|
2019-09-08 22:27:57 +02:00
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class Split;
|
|
|
|
|
2021-12-19 15:57:56 +01:00
|
|
|
class SplitOverlay : public BaseWidget
|
2019-09-08 22:27:57 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit SplitOverlay(Split *parent = nullptr);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// bool event(QEvent *event) override;
|
|
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
|
|
void mouseMoveEvent(QMouseEvent *event) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// fourtf: !!! preserve the order of left, up, right and down
|
|
|
|
enum HoveredElement {
|
|
|
|
None,
|
|
|
|
SplitMove,
|
|
|
|
SplitLeft,
|
|
|
|
SplitUp,
|
|
|
|
SplitRight,
|
|
|
|
SplitDown
|
|
|
|
};
|
|
|
|
|
|
|
|
class ButtonEventFilter : public QObject
|
|
|
|
{
|
|
|
|
SplitOverlay *parent;
|
|
|
|
HoveredElement hoveredElement;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ButtonEventFilter(SplitOverlay *parent, HoveredElement hoveredElement);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool eventFilter(QObject *watched, QEvent *event) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
HoveredElement hoveredElement_ = None;
|
|
|
|
Split *split_;
|
|
|
|
QGridLayout *layout_;
|
|
|
|
QPushButton *left_;
|
|
|
|
QPushButton *up_;
|
|
|
|
QPushButton *right_;
|
|
|
|
QPushButton *down_;
|
|
|
|
|
2021-12-19 15:57:56 +01:00
|
|
|
pajlada::Signals::SignalHolder signalHolder_;
|
|
|
|
|
2019-09-08 22:27:57 +02:00
|
|
|
friend class ButtonEventFilter;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|