mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 13:25:57 +01:00
allow reload and fix locked on groupbar gradient
modified: src/config/ConfigManager.cpp modified: src/render/decorations/CHyprGroupBarDecoration.cpp modified: src/render/decorations/CHyprGroupBarDecoration.hpp modified: src/render/decorations/IHyprWindowDecoration.cpp modified: src/render/decorations/IHyprWindowDecoration.hpp Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
This commit is contained in:
parent
8a4381cb36
commit
6fdac9c209
5 changed files with 28 additions and 10 deletions
|
@ -1648,6 +1648,8 @@ void CConfigManager::loadConfigLoadVars() {
|
||||||
|
|
||||||
w->updateDynamicRules();
|
w->updateDynamicRules();
|
||||||
w->updateSpecialRenderData();
|
w->updateSpecialRenderData();
|
||||||
|
for (auto& wd : w->m_dWindowDecorations)
|
||||||
|
wd->forceReload(w.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update window border colors
|
// Update window border colors
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
// shared things to conserve VRAM
|
// shared things to conserve VRAM
|
||||||
static CTexture m_tGradientActive;
|
static CTexture m_tGradientActive;
|
||||||
static CTexture m_tGradientInactive;
|
static CTexture m_tGradientInactive;
|
||||||
|
static CTexture m_tGradientLockedActive;
|
||||||
|
static CTexture m_tGradientLockedInactive;
|
||||||
|
|
||||||
CHyprGroupBarDecoration::CHyprGroupBarDecoration(CWindow* pWindow) : IHyprWindowDecoration(pWindow) {
|
CHyprGroupBarDecoration::CHyprGroupBarDecoration(CWindow* pWindow) : IHyprWindowDecoration(pWindow) {
|
||||||
m_pWindow = pWindow;
|
m_pWindow = pWindow;
|
||||||
|
@ -136,10 +138,12 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D&
|
||||||
rect.y -= rect.height;
|
rect.y -= rect.height;
|
||||||
rect.width = BARW * pMonitor->scale;
|
rect.width = BARW * pMonitor->scale;
|
||||||
|
|
||||||
|
if (*PGRADIENTS == 1) {
|
||||||
refreshGradients();
|
refreshGradients();
|
||||||
|
g_pHyprOpenGL->renderTexture((m_dwGroupMembers[i] == g_pCompositor->m_pLastWindow ? (GROUPLOCKED ? m_tGradientLockedActive : m_tGradientActive) :
|
||||||
if (*PGRADIENTS == 1)
|
(GROUPLOCKED ? m_tGradientLockedInactive : m_tGradientInactive)),
|
||||||
g_pHyprOpenGL->renderTexture((m_dwGroupMembers[i] == g_pCompositor->m_pLastWindow ? m_tGradientActive : m_tGradientInactive), &rect, 1.0);
|
&rect, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
rect.y -= (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) * 0.2 * pMonitor->scale;
|
rect.y -= (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) * 0.2 * pMonitor->scale;
|
||||||
rect.height = (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) * pMonitor->scale;
|
rect.height = (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) * pMonitor->scale;
|
||||||
|
@ -293,12 +297,10 @@ void CHyprGroupBarDecoration::refreshGradients() {
|
||||||
static auto* const PGROUPCOLACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("group:groupbar:col.locked_active")->data;
|
static auto* const PGROUPCOLACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("group:groupbar:col.locked_active")->data;
|
||||||
static auto* const PGROUPCOLINACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("group:groupbar:col.locked_inactive")->data;
|
static auto* const PGROUPCOLINACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("group:groupbar:col.locked_inactive")->data;
|
||||||
|
|
||||||
const bool GROUPLOCKED = m_pWindow->getGroupHead()->m_sGroupData.locked;
|
renderGradientTo(m_tGradientActive, ((CGradientValueData*)PGROUPCOLACTIVE->get())->m_vColors[0]);
|
||||||
const auto* const PCOLACTIVE = GROUPLOCKED ? PGROUPCOLACTIVELOCKED : PGROUPCOLACTIVE;
|
renderGradientTo(m_tGradientInactive, ((CGradientValueData*)PGROUPCOLINACTIVE->get())->m_vColors[0]);
|
||||||
const auto* const PCOLINACTIVE = GROUPLOCKED ? PGROUPCOLINACTIVELOCKED : PGROUPCOLINACTIVE;
|
renderGradientTo(m_tGradientLockedActive, ((CGradientValueData*)PGROUPCOLACTIVELOCKED->get())->m_vColors[0]);
|
||||||
|
renderGradientTo(m_tGradientLockedInactive, ((CGradientValueData*)PGROUPCOLINACTIVELOCKED->get())->m_vColors[0]);
|
||||||
renderGradientTo(m_tGradientActive, ((CGradientValueData*)PCOLACTIVE->get())->m_vColors[0]);
|
|
||||||
renderGradientTo(m_tGradientInactive, ((CGradientValueData*)PCOLINACTIVE->get())->m_vColors[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CHyprGroupBarDecoration::getBarHeight() {
|
int CHyprGroupBarDecoration::getBarHeight() {
|
||||||
|
@ -309,6 +311,12 @@ int CHyprGroupBarDecoration::getBarHeight() {
|
||||||
return BARHEIGHT + (*PRENDERTITLES ? *PTITLEFONTSIZE : 0);
|
return BARHEIGHT + (*PRENDERTITLES ? *PTITLEFONTSIZE : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CHyprGroupBarDecoration::forceReload(CWindow* pWindow) {
|
||||||
|
m_tGradientActive.destroyTexture();
|
||||||
|
m_tGradientInactive.destroyTexture();
|
||||||
|
updateWindow(pWindow);
|
||||||
|
}
|
||||||
|
|
||||||
bool CHyprGroupBarDecoration::allowsInput() {
|
bool CHyprGroupBarDecoration::allowsInput() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,8 @@ class CHyprGroupBarDecoration : public IHyprWindowDecoration {
|
||||||
|
|
||||||
virtual SWindowDecorationExtents getWindowDecorationReservedArea();
|
virtual SWindowDecorationExtents getWindowDecorationReservedArea();
|
||||||
|
|
||||||
|
virtual void forceReload(CWindow*);
|
||||||
|
|
||||||
virtual bool allowsInput();
|
virtual bool allowsInput();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -25,6 +25,10 @@ CRegion IHyprWindowDecoration::getWindowDecorationRegion() {
|
||||||
m_pWindow->m_vRealSize.vec().y + 2 * BORDERSIZE));
|
m_pWindow->m_vRealSize.vec().y + 2 * BORDERSIZE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IHyprWindowDecoration::forceReload(CWindow* pWindow) {
|
||||||
|
updateWindow(pWindow);
|
||||||
|
}
|
||||||
|
|
||||||
bool IHyprWindowDecoration::allowsInput() {
|
bool IHyprWindowDecoration::allowsInput() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,8 @@ class IHyprWindowDecoration {
|
||||||
|
|
||||||
virtual void damageEntire() = 0;
|
virtual void damageEntire() = 0;
|
||||||
|
|
||||||
|
virtual void forceReload(CWindow*);
|
||||||
|
|
||||||
virtual SWindowDecorationExtents getWindowDecorationReservedArea();
|
virtual SWindowDecorationExtents getWindowDecorationReservedArea();
|
||||||
|
|
||||||
virtual CRegion getWindowDecorationRegion();
|
virtual CRegion getWindowDecorationRegion();
|
||||||
|
|
Loading…
Reference in a new issue