2019-07-23 22:18:36 +02:00
|
|
|
#pragma once
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2019-07-23 22:18:36 +02:00
|
|
|
#include "widgets/helper/Button.hpp"
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2019-10-07 15:46:08 +02:00
|
|
|
namespace chatterino {
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2019-07-23 22:18:36 +02:00
|
|
|
enum class TitleBarButtonStyle {
|
|
|
|
None = 0,
|
|
|
|
Minimize = 1,
|
|
|
|
Maximize = 2,
|
|
|
|
Unmaximize = 4,
|
|
|
|
Close = 8,
|
|
|
|
User = 16,
|
2023-05-27 12:38:25 +02:00
|
|
|
Settings = 32,
|
|
|
|
StreamerMode = 64,
|
2019-07-23 22:18:36 +02:00
|
|
|
};
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2019-07-23 22:18:36 +02:00
|
|
|
class TitleBarButton : public Button
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TitleBarButton();
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2019-07-23 22:18:36 +02:00
|
|
|
TitleBarButtonStyle getButtonStyle() const;
|
|
|
|
void setButtonStyle(TitleBarButtonStyle style_);
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2023-12-03 14:41:33 +01:00
|
|
|
/// Simulate a `mouseEnter` event.
|
|
|
|
void ncEnter();
|
|
|
|
|
|
|
|
/// Simulate a `mouseLeave` event.
|
|
|
|
void ncLeave();
|
|
|
|
|
|
|
|
/// Simulate a `mouseMove` event.
|
|
|
|
/// @param at a local position relative to this widget
|
|
|
|
void ncMove(QPoint at);
|
|
|
|
|
|
|
|
/// Simulate a `mousePress` event with the left mouse button.
|
|
|
|
/// @param at a local position relative to this widget
|
|
|
|
void ncMousePress(QPoint at);
|
|
|
|
|
|
|
|
/// Simulate a `mouseRelease` event with the left mouse button.
|
|
|
|
/// @param at a local position relative to this widget
|
|
|
|
void ncMouseRelease(QPoint at);
|
|
|
|
|
2019-07-23 22:18:36 +02:00
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *) override;
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2019-07-23 22:18:36 +02:00
|
|
|
private:
|
2023-09-09 13:11:19 +02:00
|
|
|
TitleBarButtonStyle style_{};
|
2019-07-23 22:18:36 +02:00
|
|
|
};
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2019-10-07 15:46:08 +02:00
|
|
|
} // namespace chatterino
|