From 182c8f8357739f905bbd721006480502435b6b43 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 27 Nov 2022 12:04:31 -0800 Subject: Update brace style to match rest of my projects --- app/source/Cplt/UI/UI_Items.cpp | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'app/source/Cplt/UI/UI_Items.cpp') diff --git a/app/source/Cplt/UI/UI_Items.cpp b/app/source/Cplt/UI/UI_Items.cpp index 0170e1a..07787d5 100644 --- a/app/source/Cplt/UI/UI_Items.cpp +++ b/app/source/Cplt/UI/UI_Items.cpp @@ -10,8 +10,7 @@ namespace CPLT_UNITY_ID { -enum class ActionResult -{ +enum class ActionResult { Confirmed, Canceled, Pending, @@ -20,14 +19,11 @@ enum class ActionResult /// \param list Item list that the item is in. /// \param item A non-null pointer to the currently being edited item. It should not change until this function returns a non-\c ActionResult::Pending value. template -ActionResult ItemEditor(ItemList& list, T* item) -{ - constexpr bool kHasDescription = requires(T t) - { +ActionResult ItemEditor(ItemList& list, T* item) { + constexpr bool kHasDescription = requires(T t) { t.GetDescription(); }; - constexpr bool kHasEmail = requires(T t) - { + constexpr bool kHasEmail = requires(T t) { t.GetEmail(); }; @@ -93,22 +89,17 @@ ActionResult ItemEditor(ItemList& list, T* item) } template -void ItemListEntries(ItemList& list, int& selectedIdx) -{ - constexpr bool kHasDescription = requires(T t) - { +void ItemListEntries(ItemList& list, int& selectedIdx) { + constexpr bool kHasDescription = requires(T t) { t.GetDescription(); }; - constexpr bool kHasEmail = requires(T t) - { + constexpr bool kHasEmail = requires(T t) { t.GetEmail(); }; - constexpr bool kHasStock = requires(T t) - { + constexpr bool kHasStock = requires(T t) { t.GetPrice(); }; - constexpr bool kHasPrice = requires(T t) - { + constexpr bool kHasPrice = requires(T t) { t.GetPrice(); }; constexpr int kColumns = 1 /* Name column */ + kHasDescription + kHasEmail + kHasStock + kHasPrice; @@ -163,8 +154,7 @@ void ItemListEntries(ItemList& list, int& selectedIdx) } template -void ItemListEditor(ItemList& list) -{ +void ItemListEditor(ItemList& list) { bool opened = true; static int selectedIdx = -1; static T* editingItem = nullptr; @@ -230,8 +220,7 @@ void ItemListEditor(ItemList& list) } } // namespace CPLT_UNITY_ID -void UI::ItemsTab() -{ +void UI::ItemsTab() { auto& gs = GlobalStates::GetInstance(); if (ImGui::BeginTabBar("ItemViewTabs")) { -- cgit v1.2.3-70-g09d2