diff options
author | rtk0c <[email protected]> | 2022-11-27 12:04:31 -0800 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-11-27 12:04:31 -0800 |
commit | 182c8f8357739f905bbd721006480502435b6b43 (patch) | |
tree | 082613a474d863182e2ad8f2167f1643f26e67a3 /app/source/Cplt/UI/UI_Items.cpp | |
parent | b01ed99a1cd0c863c8709930658513c04dd70f61 (diff) |
Update brace style to match rest of my projectscplt-imgui
Diffstat (limited to 'app/source/Cplt/UI/UI_Items.cpp')
-rw-r--r-- | app/source/Cplt/UI/UI_Items.cpp | 33 |
1 files changed, 11 insertions, 22 deletions
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 <class T> -ActionResult ItemEditor(ItemList<T>& list, T* item) -{ - constexpr bool kHasDescription = requires(T t) - { +ActionResult ItemEditor(ItemList<T>& 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<T>& list, T* item) } template <class T> -void ItemListEntries(ItemList<T>& list, int& selectedIdx) -{ - constexpr bool kHasDescription = requires(T t) - { +void ItemListEntries(ItemList<T>& 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<T>& list, int& selectedIdx) } template <class T> -void ItemListEditor(ItemList<T>& list) -{ +void ItemListEditor(ItemList<T>& list) { bool opened = true; static int selectedIdx = -1; static T* editingItem = nullptr; @@ -230,8 +220,7 @@ void ItemListEditor(ItemList<T>& list) } } // namespace CPLT_UNITY_ID -void UI::ItemsTab() -{ +void UI::ItemsTab() { auto& gs = GlobalStates::GetInstance(); if (ImGui::BeginTabBar("ItemViewTabs")) { |