fix: 修复多个UI框架问题
- 修复 InspectorPanel InputText 使用 data()/capacity() 的错误 - 修复未使用变量警告 - 修复 ProjectManager 路径重复拼接 bug (Assets/Assets) - 返回按钮在 Assets 目录时禁用但保持显示 - 删除 ProjectPanel 创建按钮,调整 Refresh 位置 - 修复 ProjectPanel 搜索过滤时的 ID 冲突 - 修复 InspectorPanel CollapsingHeader ID 冲突
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user