diff options
author | Robin Burchell <robin+git@viroteck.net> | 2019-05-28 11:53:16 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-28 17:31:20 +0200 |
commit | 0dc9af5f7e26b0dfa42cb75c900b9ef7a2192425 (patch) | |
tree | 93dbbbeb714f258bd7fb044633eb83bdcd908286 /LibGUI/GWidget.h | |
parent | c11351ac507f863699d78aec46a77bd4d59e743c (diff) | |
download | serenity-0dc9af5f7e26b0dfa42cb75c900b9ef7a2192425.zip |
Add clang-format file
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
Diffstat (limited to 'LibGUI/GWidget.h')
-rw-r--r-- | LibGUI/GWidget.h | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/LibGUI/GWidget.h b/LibGUI/GWidget.h index 6416145672..6e73c7e4c1 100644 --- a/LibGUI/GWidget.h +++ b/LibGUI/GWidget.h @@ -1,15 +1,15 @@ #pragma once +#include <AK/AKString.h> +#include <AK/Badge.h> +#include <AK/HashMap.h> #include <LibCore/CElapsedTimer.h> +#include <LibCore/CObject.h> #include <LibGUI/GEvent.h> #include <LibGUI/GShortcut.h> -#include <LibCore/CObject.h> -#include <SharedGraphics/Rect.h> #include <SharedGraphics/Color.h> #include <SharedGraphics/Font.h> -#include <AK/Badge.h> -#include <AK/AKString.h> -#include <AK/HashMap.h> +#include <SharedGraphics/Rect.h> class GraphicsBitmap; class GAction; @@ -17,10 +17,26 @@ class GLayout; class GMenu; class GWindow; -enum class SizePolicy { Fixed, Fill }; -enum class Orientation { Horizontal, Vertical }; -enum class HorizontalDirection { Left, Right }; -enum class VerticalDirection { Up, Down }; +enum class SizePolicy +{ + Fixed, + Fill +}; +enum class Orientation +{ + Horizontal, + Vertical +}; +enum class HorizontalDirection +{ + Left, + Right +}; +enum class VerticalDirection +{ + Up, + Down +}; class GWidget : public CObject { public: @@ -178,7 +194,7 @@ public: template<typename Callback> void for_each_child_widget(Callback callback) { - for_each_child([&] (auto& child) { + for_each_child([&](auto& child) { if (is<GWidget>(child)) return callback(to<GWidget>(child)); return IterationDecision::Continue; @@ -224,7 +240,8 @@ private: HashMap<GShortcut, GAction*> m_local_shortcut_actions; }; -template<> inline bool is<GWidget>(const CObject& object) +template<> +inline bool is<GWidget>(const CObject& object) { return object.is_widget(); } |