From 99abe9aa790f0cb29581f1d83596035198d85719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sun, 2 Apr 2017 08:52:20 +0200 Subject: Replace a manual remove by std::remove in Layout::removeItem. Also reformat the file while we're at it. --- plugingui/layout.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'plugingui/layout.h') diff --git a/plugingui/layout.h b/plugingui/layout.h index 4d20eb6..37a7d6d 100644 --- a/plugingui/layout.h +++ b/plugingui/layout.h @@ -26,8 +26,8 @@ */ #pragma once -#include #include +#include #include @@ -60,11 +60,13 @@ class Layout : public Listener { public: - Layout(LayoutItem *parent); - virtual ~Layout() {} + Layout(LayoutItem* parent); + virtual ~Layout() + { + } - virtual void addItem(LayoutItem *item); - virtual void removeItem(LayoutItem *item); + virtual void addItem(LayoutItem* item); + virtual void removeItem(LayoutItem* item); //! \brief Reimplement this method to create a new Layout rule. virtual void layout() = 0; @@ -72,8 +74,8 @@ public: protected: void sizeChanged(int width, int height); - LayoutItem *parent; - typedef std::list LayoutItemList; + LayoutItem* parent; + typedef std::list LayoutItemList; LayoutItemList items; }; @@ -82,7 +84,7 @@ class BoxLayout : public Layout { public: - BoxLayout(LayoutItem *parent); + BoxLayout(LayoutItem* parent); //! \brief Set to false to only move the items, not scale them. void setResizeChildren(bool resize_children); @@ -90,14 +92,15 @@ public: void setSpacing(size_t spacing); // From Layout: - virtual void layout() override = 0; + virtual void layout() override = 0; protected: bool resizeChildren{false}; size_t spacing{0}; }; -enum class HAlignment { +enum class HAlignment +{ left, center, right, @@ -108,7 +111,7 @@ class VBoxLayout : public BoxLayout { public: - VBoxLayout(LayoutItem *parent); + VBoxLayout(LayoutItem* parent); void setHAlignment(HAlignment alignment); @@ -119,7 +122,8 @@ protected: HAlignment align; }; -enum class VAlignment { +enum class VAlignment +{ top, center, bottom, @@ -130,7 +134,7 @@ class HBoxLayout : public BoxLayout { public: - HBoxLayout(LayoutItem *parent); + HBoxLayout(LayoutItem* parent); void setVAlignment(VAlignment alignment); -- cgit v1.2.3