BugFix Render Shader Editor

This commit is contained in:
Bruno Herbelin
2024-12-28 00:35:00 +01:00
parent 717a8f2771
commit a36a7fe4b2

View File

@@ -489,14 +489,14 @@ void ShaderEditWindow::Render()
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_ITALIC);
ImGui::Text("Status: %s", status_.c_str());
const float w = ImGui::GetContentRegionAvail().x - ImGui::GetTextLineHeight();
ImVec2 txtsize = ImGui::CalcTextSize(Settings::application.recentShaderCode.path.c_str(), NULL);
ImGui::SameLine(w - txtsize.x - IMGUI_SAME_LINE, 0);
// Right-align on same line than status
// Display name of program for embedded code
if (current_ != nullptr) {
const float w = ImGui::GetContentRegionAvail().x - ImGui::GetTextLineHeight();
ImVec2 txtsize = ImGui::CalcTextSize(Settings::application.recentShaderCode.path.c_str(), NULL);
ImGui::SameLine(w - txtsize.x - IMGUI_SAME_LINE, 0);
if (filters_[current_].filename().empty()) {
// right-aligned in italics and greyed out
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.8, 0.8, 0.8, 0.9f));