aboutsummaryrefslogtreecommitdiff
path: root/core/src/UI/UI_Items.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/UI/UI_Items.cpp')
-rw-r--r--core/src/UI/UI_Items.cpp36
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();
}
}