fix: 修复多个UI框架问题

- 修复 InspectorPanel InputText 使用 data()/capacity() 的错误
- 修复未使用变量警告
- 修复 ProjectManager 路径重复拼接 bug (Assets/Assets)
- 返回按钮在 Assets 目录时禁用但保持显示
- 删除 ProjectPanel 创建按钮,调整 Refresh 位置
- 修复 ProjectPanel 搜索过滤时的 ID 冲突
- 修复 InspectorPanel CollapsingHeader ID 冲突
This commit is contained in:
2026-03-12 18:58:06 +08:00
parent da7f19e9e8
commit 6e12efb67e
4 changed files with 31 additions and 23 deletions

View File

@@ -18,27 +18,24 @@ void ProjectPanel::Render() {
auto& manager = ProjectManager::Get();
if (manager.CanNavigateBack()) {
if (ImGui::Button("<")) {
bool canGoBack = manager.CanNavigateBack();
ImGui::BeginDisabled(!canGoBack);
if (ImGui::Button("<")) {
if (canGoBack) {
manager.NavigateBack();
}
ImGui::SameLine();
}
ImGui::EndDisabled();
ImGui::SameLine();
ImGui::Text("%s", manager.GetCurrentPath().c_str());
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 140.0f);
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 80.0f);
if (ImGui::Button("Refresh")) {
manager.RefreshCurrentFolder();
}
ImGui::SameLine();
if (ImGui::Button("+")) {
m_showCreateFolderPopup = true;
strcpy_s(m_newFolderName, "NewFolder");
}
ImGui::Separator();
ImGui::PushItemWidth(-1);
@@ -69,7 +66,7 @@ void ProjectPanel::Render() {
if (itemIndex > 0 && itemIndex % columns != 0) {
ImGui::SameLine();
}
RenderAssetItem(items[i], i);
RenderAssetItem(items[i], itemIndex);
itemIndex++;
}