diff options
Diffstat (limited to 'src/render/decorations')
7 files changed, 16 insertions, 22 deletions
diff --git a/src/render/decorations/CHyprBorderDecoration.cpp b/src/render/decorations/CHyprBorderDecoration.cpp index b0de4a64..93490f31 100644 --- a/src/render/decorations/CHyprBorderDecoration.cpp +++ b/src/render/decorations/CHyprBorderDecoration.cpp @@ -3,8 +3,8 @@ #include "../../config/ConfigValue.hpp" #include "../../managers/eventLoop/EventLoopManager.hpp" -CHyprBorderDecoration::CHyprBorderDecoration(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow) { - m_pWindow = pWindow; +CHyprBorderDecoration::CHyprBorderDecoration(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow), m_pWindow(pWindow) { + ; } CHyprBorderDecoration::~CHyprBorderDecoration() { diff --git a/src/render/decorations/CHyprDropShadowDecoration.cpp b/src/render/decorations/CHyprDropShadowDecoration.cpp index 39398878..38ced9af 100644 --- a/src/render/decorations/CHyprDropShadowDecoration.cpp +++ b/src/render/decorations/CHyprDropShadowDecoration.cpp @@ -3,11 +3,11 @@ #include "../../Compositor.hpp" #include "../../config/ConfigValue.hpp" -CHyprDropShadowDecoration::CHyprDropShadowDecoration(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow) { - m_pWindow = pWindow; +CHyprDropShadowDecoration::CHyprDropShadowDecoration(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow), m_pWindow(pWindow) { + ; } -CHyprDropShadowDecoration::~CHyprDropShadowDecoration() {} +CHyprDropShadowDecoration::~CHyprDropShadowDecoration() = default; eDecorationType CHyprDropShadowDecoration::getDecorationType() { return DECORATION_SHADOW; diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 937c913d..3138c326 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -17,16 +17,15 @@ constexpr int BAR_PADDING_OUTER_HORZ = 2; constexpr int BAR_TEXT_PAD = 2; constexpr int BAR_HORIZONTAL_PADDING = 2; -CHyprGroupBarDecoration::CHyprGroupBarDecoration(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow) { +CHyprGroupBarDecoration::CHyprGroupBarDecoration(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow), m_pWindow(pWindow) { static auto PGRADIENTS = CConfigValue<Hyprlang::INT>("group:groupbar:enabled"); static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:gradients"); - m_pWindow = pWindow; if (m_tGradientActive->m_iTexID == 0 && *PENABLED && *PGRADIENTS) refreshGroupBarGradients(); } -CHyprGroupBarDecoration::~CHyprGroupBarDecoration() {} +CHyprGroupBarDecoration::~CHyprGroupBarDecoration() = default; SDecorationPositioningInfo CHyprGroupBarDecoration::getPositioningInfo() { static auto PHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:height"); diff --git a/src/render/decorations/DecorationPositioner.cpp b/src/render/decorations/DecorationPositioner.cpp index 995283c6..6a41cbdc 100644 --- a/src/render/decorations/DecorationPositioner.cpp +++ b/src/render/decorations/DecorationPositioner.cpp @@ -85,12 +85,7 @@ CDecorationPositioner::SWindowPositioningData* CDecorationPositioner::getDataFor } void CDecorationPositioner::sanitizeDatas() { - std::erase_if(m_mWindowDatas, [](const auto& other) { - if (!valid(other.first)) - return true; - - return false; - }); + std::erase_if(m_mWindowDatas, [](const auto& other) { return !valid(other.first); }); std::erase_if(m_vWindowPositioningDatas, [](const auto& other) { if (!validMapped(other->pWindow)) return true; diff --git a/src/render/decorations/DecorationPositioner.hpp b/src/render/decorations/DecorationPositioner.hpp index 27e56f0b..c2d69881 100644 --- a/src/render/decorations/DecorationPositioner.hpp +++ b/src/render/decorations/DecorationPositioner.hpp @@ -9,12 +9,12 @@ class CWindow; class IHyprWindowDecoration; -enum eDecorationPositioningPolicy { +enum eDecorationPositioningPolicy : uint8_t { DECORATION_POSITION_ABSOLUTE = 0, /* Decoration wants absolute positioning */ DECORATION_POSITION_STICKY, /* Decoration is stuck to some edge of a window */ }; -enum eDecorationEdges { +enum eDecorationEdges : uint8_t { DECORATION_EDGE_TOP = 1 << 0, DECORATION_EDGE_BOTTOM = 1 << 1, DECORATION_EDGE_LEFT = 1 << 2, diff --git a/src/render/decorations/IHyprWindowDecoration.cpp b/src/render/decorations/IHyprWindowDecoration.cpp index f3736b2d..cb9e166b 100644 --- a/src/render/decorations/IHyprWindowDecoration.cpp +++ b/src/render/decorations/IHyprWindowDecoration.cpp @@ -2,11 +2,11 @@ class CWindow; -IHyprWindowDecoration::IHyprWindowDecoration(PHLWINDOW pWindow) { - m_pWindow = pWindow; +IHyprWindowDecoration::IHyprWindowDecoration(PHLWINDOW pWindow) : m_pWindow(pWindow) { + ; } -IHyprWindowDecoration::~IHyprWindowDecoration() {} +IHyprWindowDecoration::~IHyprWindowDecoration() = default; bool IHyprWindowDecoration::onInputOnDeco(const eInputType, const Vector2D&, std::any) { return false; diff --git a/src/render/decorations/IHyprWindowDecoration.hpp b/src/render/decorations/IHyprWindowDecoration.hpp index d6d57902..10145f40 100644 --- a/src/render/decorations/IHyprWindowDecoration.hpp +++ b/src/render/decorations/IHyprWindowDecoration.hpp @@ -5,7 +5,7 @@ #include "../../helpers/math/Math.hpp" #include "DecorationPositioner.hpp" -enum eDecorationType { +enum eDecorationType : int8_t { DECORATION_NONE = -1, DECORATION_GROUPBAR, DECORATION_SHADOW, @@ -13,14 +13,14 @@ enum eDecorationType { DECORATION_CUSTOM }; -enum eDecorationLayer { +enum eDecorationLayer : uint8_t { DECORATION_LAYER_BOTTOM = 0, /* lowest. */ DECORATION_LAYER_UNDER, /* under the window, but above BOTTOM */ DECORATION_LAYER_OVER, /* above the window, but below its popups */ DECORATION_LAYER_OVERLAY /* above everything of the window, including popups */ }; -enum eDecorationFlags { +enum eDecorationFlags : uint8_t { DECORATION_ALLOWS_MOUSE_INPUT = 1 << 0, /* this decoration accepts mouse input */ DECORATION_PART_OF_MAIN_WINDOW = 1 << 1, /* this decoration is a *seamless* part of the main window, so stuff like shadows will include it */ DECORATION_NON_SOLID = 1 << 2, /* this decoration is not solid. Other decorations should draw on top of it. Example: shadow */ |
