diff options
author | André Nusser <andre.nusser@googlemail.com> | 2017-04-02 08:52:20 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2017-04-02 08:52:20 +0200 |
commit | 99abe9aa790f0cb29581f1d83596035198d85719 (patch) | |
tree | 9bb4ee590c7ba1ebb9637628a9976ae9b0fc20c9 /plugingui/layout.h | |
parent | 9774762dd014bed4f4e3c4ac142a7b9634944fe4 (diff) |
Replace a manual remove by std::remove in Layout::removeItem.
Also reformat the file while we're at it.
Diffstat (limited to 'plugingui/layout.h')
-rw-r--r-- | plugingui/layout.h | 30 |
1 files changed, 17 insertions, 13 deletions
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 <list> #include <cstdlib> +#include <list> #include <notifier.h> @@ -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<LayoutItem *> LayoutItemList; + LayoutItem* parent; + typedef std::list<LayoutItem*> 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); |