Refactor GraphicsEditor tab handling for improved readability and structure
This commit is contained in:
@@ -54,25 +54,24 @@ constexpr ImGuiTableFlags kGfxEditFlags = ImGuiTableFlags_Reorderable |
|
|||||||
ImGuiTableFlags_SizingStretchSame;
|
ImGuiTableFlags_SizingStretchSame;
|
||||||
|
|
||||||
absl::Status GraphicsEditor::Update() {
|
absl::Status GraphicsEditor::Update() {
|
||||||
TAB_BAR("##TabBar")
|
if (ImGui::BeginTabBar("##TabBar")) {
|
||||||
status_ = UpdateGfxEdit();
|
status_ = UpdateGfxEdit();
|
||||||
TAB_ITEM("Sheet Browser")
|
TAB_ITEM("Sheet Browser")
|
||||||
if (asset_browser_.Initialized == false) {
|
if (asset_browser_.Initialized == false) {
|
||||||
asset_browser_.Initialize(rom()->gfx_sheets());
|
asset_browser_.Initialize(rom()->gfx_sheets());
|
||||||
}
|
}
|
||||||
asset_browser_.Draw(rom()->gfx_sheets());
|
asset_browser_.Draw(rom()->gfx_sheets());
|
||||||
|
|
||||||
END_TAB_ITEM()
|
END_TAB_ITEM()
|
||||||
status_ = UpdateScadView();
|
status_ = UpdateScadView();
|
||||||
status_ = UpdateLinkGfxView();
|
status_ = UpdateLinkGfxView();
|
||||||
END_TAB_BAR()
|
ImGui::EndTabBar();
|
||||||
|
}
|
||||||
CLEAR_AND_RETURN_STATUS(status_)
|
CLEAR_AND_RETURN_STATUS(status_)
|
||||||
return absl::OkStatus();
|
return absl::OkStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
absl::Status GraphicsEditor::UpdateGfxEdit() {
|
absl::Status GraphicsEditor::UpdateGfxEdit() {
|
||||||
TAB_ITEM("Sheet Editor")
|
if (ImGui::BeginTabItem("Sheet Editor")) {
|
||||||
|
|
||||||
if (ImGui::BeginTable("##GfxEditTable", 3, kGfxEditTableFlags,
|
if (ImGui::BeginTable("##GfxEditTable", 3, kGfxEditTableFlags,
|
||||||
ImVec2(0, 0))) {
|
ImVec2(0, 0))) {
|
||||||
for (const auto& name :
|
for (const auto& name :
|
||||||
@@ -97,7 +96,8 @@ absl::Status GraphicsEditor::UpdateGfxEdit() {
|
|||||||
}
|
}
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
|
|
||||||
END_TAB_ITEM()
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
return absl::OkStatus();
|
return absl::OkStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user