parent
9b327ddfd1
commit
5cc6cb4945
2 changed files with 15 additions and 5 deletions
|
|
@ -29,7 +29,6 @@ SDecorationPositioningInfo CHyprGroupBarDecoration::getPositioningInfo() {
|
||||||
static auto PHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:height");
|
static auto PHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:height");
|
||||||
static auto PINDICATORGAP = CConfigValue<Hyprlang::INT>("group:groupbar:indicator_gap");
|
static auto PINDICATORGAP = CConfigValue<Hyprlang::INT>("group:groupbar:indicator_gap");
|
||||||
static auto PINDICATORHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:indicator_height");
|
static auto PINDICATORHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:indicator_height");
|
||||||
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 PGRADIENTS = CConfigValue<Hyprlang::INT>("group:groupbar:gradients");
|
static auto PGRADIENTS = CConfigValue<Hyprlang::INT>("group:groupbar:gradients");
|
||||||
static auto PPRIORITY = CConfigValue<Hyprlang::INT>("group:groupbar:priority");
|
static auto PPRIORITY = CConfigValue<Hyprlang::INT>("group:groupbar:priority");
|
||||||
|
|
@ -43,7 +42,7 @@ SDecorationPositioningInfo CHyprGroupBarDecoration::getPositioningInfo() {
|
||||||
info.priority = *PPRIORITY;
|
info.priority = *PPRIORITY;
|
||||||
info.reserved = true;
|
info.reserved = true;
|
||||||
|
|
||||||
if (*PENABLED && m_window->m_windowData.decorate.valueOrDefault()) {
|
if (visible()) {
|
||||||
if (*PSTACKED) {
|
if (*PSTACKED) {
|
||||||
const auto ONEBARHEIGHT = *POUTERGAP + *PINDICATORHEIGHT + *PINDICATORGAP + (*PGRADIENTS || *PRENDERTITLES ? *PHEIGHT : 0);
|
const auto ONEBARHEIGHT = *POUTERGAP + *PINDICATORHEIGHT + *PINDICATORGAP + (*PGRADIENTS || *PRENDERTITLES ? *PHEIGHT : 0);
|
||||||
info.desiredExtents = {{0, (ONEBARHEIGHT * m_dwGroupMembers.size()) + (*PKEEPUPPERGAP * *POUTERGAP)}, {0, 0}};
|
info.desiredExtents = {{0, (ONEBARHEIGHT * m_dwGroupMembers.size()) + (*PKEEPUPPERGAP * *POUTERGAP)}, {0, 0}};
|
||||||
|
|
@ -96,11 +95,14 @@ void CHyprGroupBarDecoration::damageEntire() {
|
||||||
|
|
||||||
void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) {
|
void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) {
|
||||||
// get how many bars we will draw
|
// get how many bars we will draw
|
||||||
int barsToDraw = m_dwGroupMembers.size();
|
int barsToDraw = m_dwGroupMembers.size();
|
||||||
|
|
||||||
static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:enabled");
|
const bool VISIBLE = visible();
|
||||||
|
|
||||||
if (!*PENABLED || !m_window->m_windowData.decorate.valueOrDefault())
|
if (VISIBLE != m_bLastVisibilityStatus)
|
||||||
|
g_pDecorationPositioner->repositionDeco(this);
|
||||||
|
|
||||||
|
if (!VISIBLE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
static auto PRENDERTITLES = CConfigValue<Hyprlang::INT>("group:groupbar:render_titles");
|
static auto PRENDERTITLES = CConfigValue<Hyprlang::INT>("group:groupbar:render_titles");
|
||||||
|
|
@ -583,3 +585,8 @@ CBox CHyprGroupBarDecoration::assignedBoxGlobal() {
|
||||||
|
|
||||||
return box.round();
|
return box.round();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CHyprGroupBarDecoration::visible() {
|
||||||
|
static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:enabled");
|
||||||
|
return *PENABLED && m_window->m_windowData.decorate.valueOrDefault();
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,10 +56,13 @@ class CHyprGroupBarDecoration : public IHyprWindowDecoration {
|
||||||
float m_barWidth;
|
float m_barWidth;
|
||||||
float m_barHeight;
|
float m_barHeight;
|
||||||
|
|
||||||
|
bool m_bLastVisibilityStatus = true;
|
||||||
|
|
||||||
CTitleTex* textureFromTitle(const std::string&);
|
CTitleTex* textureFromTitle(const std::string&);
|
||||||
void invalidateTextures();
|
void invalidateTextures();
|
||||||
|
|
||||||
CBox assignedBoxGlobal();
|
CBox assignedBoxGlobal();
|
||||||
|
bool visible();
|
||||||
|
|
||||||
bool onBeginWindowDragOnDeco(const Vector2D&);
|
bool onBeginWindowDragOnDeco(const Vector2D&);
|
||||||
bool onEndWindowDragOnDeco(const Vector2D&, PHLWINDOW);
|
bool onEndWindowDragOnDeco(const Vector2D&, PHLWINDOW);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue