aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-12-31 17:31:33 +0100
committervaxerski <[email protected]>2022-12-31 17:31:33 +0100
commitddcae74e09ade4215da537791e10ee229e4e3f7d (patch)
tree578c2a9033cfcf8136fa1ae52245a9fc7f0dd01f
parent228e630f40de2e84e5c02384352dc9a0f70257d9 (diff)
downloadHyprland-ddcae74e09ade4215da537791e10ee229e4e3f7d.tar.gz
Hyprland-ddcae74e09ade4215da537791e10ee229e4e3f7d.zip
normalize gradients and denormalize in groupbar
-rw-r--r--src/config/ConfigDataValues.hpp9
-rw-r--r--src/render/decorations/CHyprGroupBarDecoration.cpp1
2 files changed, 5 insertions, 5 deletions
diff --git a/src/config/ConfigDataValues.hpp b/src/config/ConfigDataValues.hpp
index 6ac3ece0..27965556 100644
--- a/src/config/ConfigDataValues.hpp
+++ b/src/config/ConfigDataValues.hpp
@@ -2,8 +2,7 @@
#include "../defines.hpp"
#include <vector>
-enum eConfigValueDataTypes
-{
+enum eConfigValueDataTypes {
CVD_TYPE_INVALID = -1,
CVD_TYPE_GRADIENT = 0
};
@@ -18,7 +17,7 @@ interface ICustomConfigValueData {
class CGradientValueData : public ICustomConfigValueData {
public:
CGradientValueData(CColor col) {
- m_vColors.push_back(col);
+ m_vColors.push_back(col * (1.f / 255.f));
};
virtual ~CGradientValueData(){};
@@ -28,7 +27,7 @@ class CGradientValueData : public ICustomConfigValueData {
void reset(CColor col) {
m_vColors.clear();
- m_vColors.emplace_back(col);
+ m_vColors.emplace_back(col * (1.f / 255.f));
m_fAngle = 0;
}
@@ -39,7 +38,7 @@ class CGradientValueData : public ICustomConfigValueData {
float m_fAngle = 0;
bool operator==(const CGradientValueData& other) {
- if (other.m_vColors.size() != m_vColors.size() || m_fAngle != other.m_fAngle)
+ if (other.m_vColors.size() != m_vColors.size() || m_fAngle != other.m_fAngle)
return false;
for (size_t i = 0; i < m_vColors.size(); ++i)
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp
index 7b7c1576..cfe5255f 100644
--- a/src/render/decorations/CHyprGroupBarDecoration.cpp
+++ b/src/render/decorations/CHyprGroupBarDecoration.cpp
@@ -92,6 +92,7 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D&
CColor color = m_dwGroupMembers[i] == g_pCompositor->m_pLastWindow ? ((CGradientValueData*)PGROUPCOLACTIVE->get())->m_vColors[0] :
((CGradientValueData*)PGROUPCOLINACTIVE->get())->m_vColors[0];
color.a *= a;
+ color = color * 255.f; // gradient has 0 - 1
g_pHyprOpenGL->renderRect(&rect, color);
xoff += PAD + BARW;