From a36a7fe4b2ebb59758b020e4560bb1e12ce8fe17 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Sat, 28 Dec 2024 00:35:00 +0100 Subject: [PATCH] BugFix Render Shader Editor --- src/ShaderEditWindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ShaderEditWindow.cpp b/src/ShaderEditWindow.cpp index 00f657d..4b30975 100644 --- a/src/ShaderEditWindow.cpp +++ b/src/ShaderEditWindow.cpp @@ -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));