mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 00:42:11 +01:00
bottom bar is optonal + renamed groupbar_rounding to rounding
This commit is contained in:
parent
25337ce4b2
commit
178e72ca8a
2 changed files with 12 additions and 9 deletions
|
@ -360,7 +360,8 @@ CConfigManager::CConfigManager() {
|
||||||
m_pConfig->addConfigValue("group:groupbar:enabled", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("group:groupbar:enabled", Hyprlang::INT{1});
|
||||||
m_pConfig->addConfigValue("group:groupbar:font_family", {STRVAL_EMPTY});
|
m_pConfig->addConfigValue("group:groupbar:font_family", {STRVAL_EMPTY});
|
||||||
m_pConfig->addConfigValue("group:groupbar:font_size", Hyprlang::INT{8});
|
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:rounding", Hyprlang::INT{0});
|
||||||
|
m_pConfig->addConfigValue("group:groupbar:bottom_bar", Hyprlang::INT{1});
|
||||||
m_pConfig->addConfigValue("group:groupbar:gradients", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("group:groupbar:gradients", Hyprlang::INT{1});
|
||||||
m_pConfig->addConfigValue("group:groupbar:height", Hyprlang::INT{14});
|
m_pConfig->addConfigValue("group:groupbar:height", Hyprlang::INT{14});
|
||||||
m_pConfig->addConfigValue("group:groupbar:priority", Hyprlang::INT{3});
|
m_pConfig->addConfigValue("group:groupbar:priority", Hyprlang::INT{3});
|
||||||
|
|
|
@ -100,7 +100,8 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a) {
|
||||||
|
|
||||||
static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:enabled");
|
static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:enabled");
|
||||||
static auto PRENDERTITLES = CConfigValue<Hyprlang::INT>("group:groupbar:render_titles");
|
static auto PRENDERTITLES = CConfigValue<Hyprlang::INT>("group:groupbar:render_titles");
|
||||||
static auto PGROUPROUNDING = CConfigValue<Hyprlang::INT>("group:groupbar:group_rounding");
|
static auto PROUNDING = CConfigValue<Hyprlang::INT>("group:groupbar:rounding");
|
||||||
|
static auto PBOTTOMBAR = CConfigValue<Hyprlang::INT>("group:groupbar:bottom_bar");
|
||||||
static auto PTITLEFONTSIZE = CConfigValue<Hyprlang::INT>("group:groupbar:font_size");
|
static auto PTITLEFONTSIZE = CConfigValue<Hyprlang::INT>("group:groupbar:font_size");
|
||||||
static auto PHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:height");
|
static auto PHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:height");
|
||||||
static auto PGRADIENTS = CConfigValue<Hyprlang::INT>("group:groupbar:gradients");
|
static auto PGRADIENTS = CConfigValue<Hyprlang::INT>("group:groupbar:gradients");
|
||||||
|
@ -126,9 +127,9 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a) {
|
||||||
for (int i = 0; i < barsToDraw; ++i) {
|
for (int i = 0; i < barsToDraw; ++i) {
|
||||||
const auto WINDOWINDEX = *PSTACKED ? m_dwGroupMembers.size() - i - 1 : i;
|
const auto WINDOWINDEX = *PSTACKED ? m_dwGroupMembers.size() - i - 1 : i;
|
||||||
|
|
||||||
CBox rect = {ASSIGNEDBOX.x + floor(xoff) - pMonitor->vecPosition.x + m_pWindow->m_vFloatingOffset.x,
|
CBox rect = {ASSIGNEDBOX.x + floor(xoff) - pMonitor->vecPosition.x + m_pWindow->m_vFloatingOffset.x + *PROUNDING,
|
||||||
ASSIGNEDBOX.y + ASSIGNEDBOX.h - floor(yoff) - BAR_INDICATOR_HEIGHT - BAR_PADDING_OUTER_VERT - pMonitor->vecPosition.y + m_pWindow->m_vFloatingOffset.y,
|
ASSIGNEDBOX.y + ASSIGNEDBOX.h - floor(yoff) - BAR_INDICATOR_HEIGHT - BAR_PADDING_OUTER_VERT - pMonitor->vecPosition.y + m_pWindow->m_vFloatingOffset.y,
|
||||||
m_fBarWidth, BAR_INDICATOR_HEIGHT};
|
m_fBarWidth - (*PROUNDING * 2), BAR_INDICATOR_HEIGHT};
|
||||||
|
|
||||||
if (rect.width <= 0 || rect.height <= 0)
|
if (rect.width <= 0 || rect.height <= 0)
|
||||||
break;
|
break;
|
||||||
|
@ -151,19 +152,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];
|
CColor color = m_dwGroupMembers[WINDOWINDEX].lock() == g_pCompositor->m_pLastWindow.lock() ? PCOLACTIVE->m_vColors[0] : PCOLINACTIVE->m_vColors[0];
|
||||||
color.a *= a;
|
color.a *= a;
|
||||||
|
|
||||||
|
if (*PBOTTOMBAR)
|
||||||
|
g_pHyprOpenGL->renderRect(&rect, color);
|
||||||
|
|
||||||
rect = {ASSIGNEDBOX.x + floor(xoff) - pMonitor->vecPosition.x + m_pWindow->m_vFloatingOffset.x,
|
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,
|
ASSIGNEDBOX.y + ASSIGNEDBOX.h - floor(yoff) - ONEBARHEIGHT - pMonitor->vecPosition.y + m_pWindow->m_vFloatingOffset.y, m_fBarWidth,
|
||||||
(*PGRADIENTS || *PRENDERTITLES ? *PHEIGHT : 0)};
|
(*PGRADIENTS || *PRENDERTITLES ? *PHEIGHT : 0)};
|
||||||
|
|
||||||
g_pHyprOpenGL->renderRect(&rect, color, *PGROUPROUNDING);
|
|
||||||
|
|
||||||
rect.scale(pMonitor->scale);
|
rect.scale(pMonitor->scale);
|
||||||
|
|
||||||
if (*PGRADIENTS) {
|
if (*PGRADIENTS) {
|
||||||
const auto GRADIENTTEX = (m_dwGroupMembers[WINDOWINDEX] == g_pCompositor->m_pLastWindow ? (GROUPLOCKED ? m_tGradientLockedActive : m_tGradientActive) :
|
const auto GRADIENTTEX = (m_dwGroupMembers[WINDOWINDEX] == g_pCompositor->m_pLastWindow ? (GROUPLOCKED ? m_tGradientLockedActive : m_tGradientActive) :
|
||||||
(GROUPLOCKED ? m_tGradientLockedInactive : m_tGradientInactive));
|
(GROUPLOCKED ? m_tGradientLockedInactive : m_tGradientInactive));
|
||||||
if (GRADIENTTEX->m_iTexID != 0)
|
if (GRADIENTTEX->m_iTexID != 0)
|
||||||
g_pHyprOpenGL->renderTexture(GRADIENTTEX, &rect, 1.0, *PGROUPROUNDING);
|
g_pHyprOpenGL->renderTexture(GRADIENTTEX, &rect, 1.0, *PROUNDING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*PRENDERTITLES) {
|
if (*PRENDERTITLES) {
|
||||||
|
@ -181,7 +183,7 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a) {
|
||||||
rect.x += (m_fBarWidth * pMonitor->scale) / 2.0 - (pTitleTex->textWidth / 2.0);
|
rect.x += (m_fBarWidth * pMonitor->scale) / 2.0 - (pTitleTex->textWidth / 2.0);
|
||||||
rect.round();
|
rect.round();
|
||||||
|
|
||||||
g_pHyprOpenGL->renderTexture(pTitleTex->tex, &rect, 1.f, *PGROUPROUNDING);
|
g_pHyprOpenGL->renderTexture(pTitleTex->tex, &rect, 1.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*PSTACKED)
|
if (*PSTACKED)
|
||||||
|
|
Loading…
Add table
Reference in a new issue