diff options
author | rtk0c <[email protected]> | 2021-05-06 21:56:40 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-05-06 21:56:40 -0700 |
commit | 1fd1e4b5f2418e3ac2909658993bfedb615537ec (patch) | |
tree | 6de080d2273890f8a74d7fcd3572bb44f44ac545 /core/src/UI/UI_Items.cpp | |
parent | 538e804fc9beb83e711a210ffbb6badc15f285d5 (diff) |
Change brace style to on new line, add initial deliveries view when an order entry is selected
Diffstat (limited to 'core/src/UI/UI_Items.cpp')
-rw-r--r-- | core/src/UI/UI_Items.cpp | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/core/src/UI/UI_Items.cpp b/core/src/UI/UI_Items.cpp index 624f942..8633c1f 100644 --- a/core/src/UI/UI_Items.cpp +++ b/core/src/UI/UI_Items.cpp @@ -10,7 +10,8 @@ namespace { -enum class ActionResult { +enum class ActionResult +{ Confirmed, Canceled, Pending, @@ -19,9 +20,16 @@ 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) { t.GetDescription(); }; - constexpr bool kHasEmail = requires(T t) { t.GetEmail(); }; +ActionResult ItemEditor(ItemList<T>& list, T* item) +{ + constexpr bool kHasDescription = requires(T t) + { + t.GetDescription(); + }; + constexpr bool kHasEmail = requires(T t) + { + t.GetEmail(); + }; auto ls = LocaleStrings::Instance.get(); auto& uis = UIState::GetInstance(); @@ -88,11 +96,24 @@ ActionResult ItemEditor(ItemList<T>& list, T* item) { } template <class T> -void ItemListEntries(ItemList<T>& list, int& selectedIdx) { - constexpr bool kHasDescription = requires(T t) { t.GetDescription(); }; - constexpr bool kHasEmail = requires(T t) { t.GetEmail(); }; - constexpr bool kHasStock = requires(T t) { t.GetPrice(); }; - constexpr bool kHasPrice = requires(T t) { t.GetPrice(); }; +void ItemListEntries(ItemList<T>& list, int& selectedIdx) +{ + constexpr bool kHasDescription = requires(T t) + { + t.GetDescription(); + }; + constexpr bool kHasEmail = requires(T t) + { + t.GetEmail(); + }; + constexpr bool kHasStock = requires(T t) + { + t.GetPrice(); + }; + constexpr bool kHasPrice = requires(T t) + { + t.GetPrice(); + }; constexpr int kColumns = 1 /* Name column */ + kHasDescription + kHasEmail + kHasStock + kHasPrice; auto ls = LocaleStrings::Instance.get(); @@ -148,7 +169,8 @@ void ItemListEntries(ItemList<T>& list, int& selectedIdx) { } template <class T> -void ItemListEditor(ItemList<T>& list) { +void ItemListEditor(ItemList<T>& list) +{ auto ls = LocaleStrings::Instance.get(); bool opened = true; @@ -216,7 +238,8 @@ void ItemListEditor(ItemList<T>& list) { } } // namespace -void UI::ItemsTab() { +void UI::ItemsTab() +{ auto ls = LocaleStrings::Instance.get(); auto& uis = UIState::GetInstance(); |