blob: 08c04336834ac259b522607523e3616c8537df61 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#pragma once
#include <vector>
#include "../defines.hpp"
#include "../render/Texture.hpp"
#include "../helpers/AnimatedVariable.hpp"
#include "../config/shared/complex/ComplexDataTypes.hpp"
namespace ErrorOverlay {
namespace Colors {
constexpr const float ANGLE_30 = 0.52359877;
static const Config::CGradientValueData ERROR = Config::CGradientValueData{std::vector<CHyprColor>{0xffff6666, 0xff800000}, ANGLE_30};
static const Config::CGradientValueData WARNING = Config::CGradientValueData{std::vector<CHyprColor>{0xffffdb4d, 0xff665200}, ANGLE_30};
};
class COverlay {
public:
COverlay();
~COverlay() = default;
void queueCreate(std::string message, const CHyprColor& color);
void queueCreate(std::string message, const Config::CGradientValueData& gradient);
void queueError(std::string err);
void draw();
void destroy();
bool active();
float height(); // logical
private:
void createQueued();
std::string m_queued = "";
Config::CGradientValueData m_queuedBorderGradient;
Config::CGradientValueData m_borderGradient;
bool m_queuedDestroy = false;
bool m_isCreated = false;
SP<Render::ITexture> m_textTexture;
Vector2D m_textSize = {};
float m_outerPad = 0.F;
float m_radius = 0.F;
float m_textOffsetX = 0.F;
float m_textOffsetY = 0.F;
PHLANIMVAR<float> m_fadeOpacity;
CBox m_damageBox = {0, 0, 0, 0};
float m_lastHeight = 0.F;
bool m_monitorChanged = false;
};
UP<COverlay>& overlay();
}
|