diff options
author | rtk0c <[email protected]> | 2021-04-28 15:18:51 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-04-28 15:18:51 -0700 |
commit | 00fd95526677d670d002ca81069636f0f74b91f7 (patch) | |
tree | a783f05be218a58c2b78175425f7576664c3f1a9 /core/src/UI/UI_Items.cpp | |
parent | b7d5b514e7bffd3149a99bc7f1424f8251876d85 (diff) |
Code cleanup, fix database view paging and selection
Diffstat (limited to 'core/src/UI/UI_Items.cpp')
-rw-r--r-- | core/src/UI/UI_Items.cpp | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/core/src/UI/UI_Items.cpp b/core/src/UI/UI_Items.cpp index 56d6c2a..899db6e 100644 --- a/core/src/UI/UI_Items.cpp +++ b/core/src/UI/UI_Items.cpp @@ -220,27 +220,19 @@ void UI::ItemsTab() { auto ls = LocaleStrings::Instance.get(); auto& uis = UIState::GetInstance(); - constexpr float kAmount = 16.0f; - int id = 0; - if (ImGui::CollapsingHeader(ls->ProductCategoryName.Get())) { - ImGui::PushID(id++); - ImGui::Indent(kAmount); - ItemListEditor(uis.CurrentProject->Products); - ImGui::Unindent(kAmount); - ImGui::PopID(); - } - if (ImGui::CollapsingHeader(ls->FactoryCategoryName.Get())) { - ImGui::PushID(id++); - ImGui::Indent(kAmount); - ItemListEditor(uis.CurrentProject->Factories); - ImGui::Unindent(kAmount); - ImGui::PopID(); - } - if (ImGui::CollapsingHeader(ls->CustomerCategoryName.Get())) { - ImGui::PushID(id++); - ImGui::Indent(kAmount); - ItemListEditor(uis.CurrentProject->Customers); - ImGui::Unindent(kAmount); - ImGui::PopID(); + if (ImGui::BeginTabBar("##ItemViewTabs")) { + if (ImGui::BeginTabItem(ls->ProductCategoryName.Get())) { + ItemListEditor(uis.CurrentProject->Products); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem(ls->FactoryCategoryName.Get())) { + ItemListEditor(uis.CurrentProject->Factories); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem(ls->CustomerCategoryName.Get())) { + ItemListEditor(uis.CurrentProject->Customers); + ImGui::EndTabItem(); + } + ImGui::EndTabBar(); } } |