hyprerror: make hyprerror reserve space (#8040)
This commit is contained in:
parent
60308a2bb5
commit
91299f7039
3 changed files with 45 additions and 4 deletions
|
|
@ -3,6 +3,9 @@
|
|||
#include "../Compositor.hpp"
|
||||
#include "../config/ConfigValue.hpp"
|
||||
|
||||
#include <hyprutils/utils/ScopeGuard.hpp>
|
||||
using namespace Hyprutils::Utils;
|
||||
|
||||
CHyprError::CHyprError() {
|
||||
m_fFadeOpacity.create(AVARTYPE_FLOAT, g_pConfigManager->getAnimationPropertyConfig("fadeIn"), AVARDAMAGE_NONE);
|
||||
m_fFadeOpacity.registerVar();
|
||||
|
|
@ -130,6 +133,8 @@ void CHyprError::createQueued() {
|
|||
}
|
||||
m_szQueued = "";
|
||||
|
||||
m_fLastHeight = yoffset + PAD + 1;
|
||||
|
||||
pango_font_description_free(pangoFD);
|
||||
g_object_unref(layoutText);
|
||||
|
||||
|
|
@ -158,6 +163,8 @@ void CHyprError::createQueued() {
|
|||
m_cQueued = CColor();
|
||||
|
||||
g_pHyprRenderer->damageMonitor(PMONITOR);
|
||||
|
||||
g_pHyprRenderer->arrangeLayersForMonitor(PMONITOR->ID);
|
||||
}
|
||||
|
||||
void CHyprError::draw() {
|
||||
|
|
@ -174,6 +181,11 @@ void CHyprError::draw() {
|
|||
m_pTexture->destroyTexture();
|
||||
m_bIsCreated = false;
|
||||
m_szQueued = "";
|
||||
|
||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||
g_pHyprRenderer->arrangeLayersForMonitor(m->ID);
|
||||
}
|
||||
|
||||
return;
|
||||
} else {
|
||||
m_fFadeOpacity.setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeOut"));
|
||||
|
|
@ -203,3 +215,11 @@ void CHyprError::destroy() {
|
|||
else
|
||||
m_szQueued = "";
|
||||
}
|
||||
|
||||
bool CHyprError::active() {
|
||||
return m_bIsCreated;
|
||||
}
|
||||
|
||||
float CHyprError::height() {
|
||||
return m_fLastHeight;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,12 @@ class CHyprError {
|
|||
CHyprError();
|
||||
~CHyprError();
|
||||
|
||||
void queueCreate(std::string message, const CColor& color);
|
||||
void draw();
|
||||
void destroy();
|
||||
void queueCreate(std::string message, const CColor& color);
|
||||
void draw();
|
||||
void destroy();
|
||||
|
||||
bool active();
|
||||
float height(); // logical
|
||||
|
||||
private:
|
||||
void createQueued();
|
||||
|
|
@ -23,7 +26,8 @@ class CHyprError {
|
|||
bool m_bIsCreated = false;
|
||||
SP<CTexture> m_pTexture;
|
||||
CAnimatedVariable<float> m_fFadeOpacity;
|
||||
CBox m_bDamageBox = {0, 0, 0, 0};
|
||||
CBox m_bDamageBox = {0, 0, 0, 0};
|
||||
float m_fLastHeight = 0.F;
|
||||
|
||||
bool m_bMonitorChanged = false;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue