mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 00:22:07 +01:00
added rounded corners to group bar
This commit is contained in:
parent
b03f41efec
commit
25337ce4b2
2 changed files with 7 additions and 3 deletions
|
@ -360,6 +360,7 @@ CConfigManager::CConfigManager() {
|
|||
m_pConfig->addConfigValue("group:groupbar:enabled", Hyprlang::INT{1});
|
||||
m_pConfig->addConfigValue("group:groupbar:font_family", {STRVAL_EMPTY});
|
||||
m_pConfig->addConfigValue("group:groupbar:font_size", Hyprlang::INT{8});
|
||||
m_pConfig->addConfigValue("group:groupbar:group_rounding", Hyprlang::INT{0});
|
||||
m_pConfig->addConfigValue("group:groupbar:gradients", Hyprlang::INT{1});
|
||||
m_pConfig->addConfigValue("group:groupbar:height", Hyprlang::INT{14});
|
||||
m_pConfig->addConfigValue("group:groupbar:priority", Hyprlang::INT{3});
|
||||
|
|
|
@ -100,6 +100,7 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a) {
|
|||
|
||||
static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:enabled");
|
||||
static auto PRENDERTITLES = CConfigValue<Hyprlang::INT>("group:groupbar:render_titles");
|
||||
static auto PGROUPROUNDING = CConfigValue<Hyprlang::INT>("group:groupbar:group_rounding");
|
||||
static auto PTITLEFONTSIZE = CConfigValue<Hyprlang::INT>("group:groupbar:font_size");
|
||||
static auto PHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:height");
|
||||
static auto PGRADIENTS = CConfigValue<Hyprlang::INT>("group:groupbar:gradients");
|
||||
|
@ -149,18 +150,20 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a) {
|
|||
|
||||
CColor color = m_dwGroupMembers[WINDOWINDEX].lock() == g_pCompositor->m_pLastWindow.lock() ? PCOLACTIVE->m_vColors[0] : PCOLINACTIVE->m_vColors[0];
|
||||
color.a *= a;
|
||||
g_pHyprOpenGL->renderRect(&rect, color);
|
||||
|
||||
rect = {ASSIGNEDBOX.x + floor(xoff) - pMonitor->vecPosition.x + m_pWindow->m_vFloatingOffset.x,
|
||||
ASSIGNEDBOX.y + ASSIGNEDBOX.h - floor(yoff) - ONEBARHEIGHT - pMonitor->vecPosition.y + m_pWindow->m_vFloatingOffset.y, m_fBarWidth,
|
||||
(*PGRADIENTS || *PRENDERTITLES ? *PHEIGHT : 0)};
|
||||
|
||||
g_pHyprOpenGL->renderRect(&rect, color, *PGROUPROUNDING);
|
||||
|
||||
rect.scale(pMonitor->scale);
|
||||
|
||||
if (*PGRADIENTS) {
|
||||
const auto GRADIENTTEX = (m_dwGroupMembers[WINDOWINDEX] == g_pCompositor->m_pLastWindow ? (GROUPLOCKED ? m_tGradientLockedActive : m_tGradientActive) :
|
||||
(GROUPLOCKED ? m_tGradientLockedInactive : m_tGradientInactive));
|
||||
if (GRADIENTTEX->m_iTexID != 0)
|
||||
g_pHyprOpenGL->renderTexture(GRADIENTTEX, &rect, 1.0);
|
||||
g_pHyprOpenGL->renderTexture(GRADIENTTEX, &rect, 1.0, *PGROUPROUNDING);
|
||||
}
|
||||
|
||||
if (*PRENDERTITLES) {
|
||||
|
@ -178,7 +181,7 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a) {
|
|||
rect.x += (m_fBarWidth * pMonitor->scale) / 2.0 - (pTitleTex->textWidth / 2.0);
|
||||
rect.round();
|
||||
|
||||
g_pHyprOpenGL->renderTexture(pTitleTex->tex, &rect, 1.f);
|
||||
g_pHyprOpenGL->renderTexture(pTitleTex->tex, &rect, 1.f, *PGROUPROUNDING);
|
||||
}
|
||||
|
||||
if (*PSTACKED)
|
||||
|
|
Loading…
Add table
Reference in a new issue