Fix black popup windows (issue #10129)#1
Conversation
JIRA: [STUDIO-12867] [STUDIO-12529] [STUDIO-13313] Change-Id: Ia36b3b1c9835f9d1d30d0178f27837836a6b8175
JIRA: [NONE]
JIRA: [STUDIO-16267] Change-Id: Id3692f6d9fdb8d3c52feaca87fa4d9d44eaf238d
- render_all_plates_stats (Statistics of All Plates): Add ImGuiCol_WindowBg and ImGuiCol_Text with proper light/dark mode colors. The base ImGui style uses a nearly black window background (0.1, 0.1, 0.1, 0.8) and this function was not overriding it, causing the popup to appear black. - render_legend (Legend panel): Same fix - add explicit WindowBg and Text colors with dark/light mode support. Remove commented-out WindowBg line. - SliceInfoPopup (wxWidgets): Add SetBackgroundColour(*wxWHITE) on the popup window itself, not just the child m_panel. On Windows, wxPopupTransientWindow does not inherit child background colors, causing a black background. Fixes: bambulab#10129 Co-Authored-By: QingSong <xin.zhang@bambulab.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| ImGui::PushStyleColor(ImGuiCol_Separator, ImVec4(1.0f, 1.0f, 1.0f, 0.6f)); | ||
| ImGui::PushStyleColor(ImGuiCol_WindowBg, is_dark ? ImGuiWrapper::COL_WINDOW_BG_DARK : ImGuiWrapper::COL_WINDOW_BG); | ||
| ImGui::PushStyleColor(ImGuiCol_Text, is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.88f) : ImVec4(50 / 255.0f, 58 / 255.0f, 61 / 255.0f, 1.00f)); | ||
| ImGui::PushStyleColor(ImGuiCol_Separator, is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.6f) : ImVec4(1.0f, 1.0f, 1.0f, 0.6f)); |
There was a problem hiding this comment.
🟡 Separator color ternary is a no-op: dark and light mode values are identical in render_all_plates_stats
At src/slic3r/GUI/GCodeRenderer/BaseRenderer.cpp:691, the ternary is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.6f) : ImVec4(1.0f, 1.0f, 1.0f, 0.6f) uses the exact same white color for both dark and light mode. This is a copy-paste oversight — every other color push in this block (WindowBg, Text) correctly differentiates between modes. A white separator at 60% opacity will be nearly invisible against the light-mode background (COL_WINDOW_BG), defeating the purpose of the dark-mode fix.
Prompt for agents
In render_all_plates_stats, line 691, the ImGuiCol_Separator push uses the same ImVec4(1.0f, 1.0f, 1.0f, 0.6f) for both the dark and light branches of the ternary. The light-mode branch should use a darker separator color appropriate for the light window background (COL_WINDOW_BG). A similar pattern exists in render_legend at line 1339 of the same file and should be fixed consistently. Look at how Text and WindowBg colors are handled in the same block for the correct pattern of differentiating dark vs light mode colors.
Was this helpful? React with 👍 or 👎 to provide feedback.
| ImGui::PushStyleColor(ImGuiCol_Separator, ImVec4(1.0f, 1.0f, 1.0f, 0.6f)); | ||
| ImGui::PushStyleColor(ImGuiCol_WindowBg, is_dark ? ImGuiWrapper::COL_WINDOW_BG_DARK : ImGuiWrapper::COL_WINDOW_BG); | ||
| ImGui::PushStyleColor(ImGuiCol_Text, is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.88f) : ImVec4(50 / 255.0f, 58 / 255.0f, 61 / 255.0f, 1.00f)); | ||
| ImGui::PushStyleColor(ImGuiCol_Separator, is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.6f) : ImVec4(1.0f, 1.0f, 1.0f, 0.6f)); |
There was a problem hiding this comment.
🟡 Separator color ternary is a no-op: dark and light mode values are identical in render_legend
At src/slic3r/GUI/GCodeRenderer/BaseRenderer.cpp:1339, the same copy-paste issue as in render_all_plates_stats: is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.6f) : ImVec4(1.0f, 1.0f, 1.0f, 0.6f) produces identical colors for both modes. The light-mode separator will be white-on-light, making it nearly invisible.
Prompt for agents
In render_legend, line 1339, the ImGuiCol_Separator push uses the same ImVec4(1.0f, 1.0f, 1.0f, 0.6f) for both branches of the is_dark ternary. The light-mode branch needs a different, darker separator color suitable for a light background. This is the same issue as line 691 in render_all_plates_stats and both should be fixed consistently.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Fixes black popup windows reported in bambulab/BambuStudio#10129.
Root cause: The ImGui base style sets
ImGuiCol_WindowBgto a near-black color(0.1, 0.1, 0.1, 0.8)viainit_style(). Bothrender_all_plates_stats("Statistics of All Plates" popup) andrender_legend(GCode legend panel) are rendered outside of anypush_toolbar_style()context, so they inherit the dark base style regardless of the user's light/dark mode setting. Similarly,SliceInfoPopuponly sets background color on its childm_panelbut not on thewxPopupTransientWindowitself, which on Windows results in a black frame.Changes:
render_all_plates_stats: Add explicitImGuiCol_WindowBgandImGuiCol_Textstyle colors with dark/light mode awareness, updatePopStyleColorcount from 6→8.render_legend: Same fix — addImGuiCol_WindowBgandImGuiCol_Text, replace commented-outWindowBgline, updatePopStyleColorcount from 7→9 in both exit paths (folded and normal).SliceInfoPopup: AddSetBackgroundColour(*wxWHITE)on the popup window itself (consistent with other popups likeAmsMappingPopup,SelectMachinePop, etc.).Review & Testing Checklist for Human
render_all_plates_stats: 8 pushes / 8 pops.render_legend: 9 pushes / 9 pops (two exit paths). Count them carefully.SetNextWindowBgAlpha(0.8f)with newImGuiCol_WindowBginrender_legend— the alpha override is still applied after the explicit WindowBg color push. Verify the legend panel still has the expected semi-transparent appearance.is_dark ? ImVec4(1,1,1,0.6) : ImVec4(1,1,1,0.6)uses the same value for both branches. This preserves existing behavior but could be simplified.Notes
ImGuiWrapper::push_toolbar_style()to ensure visual consistency with other ImGui panels.Link to Devin session: https://app.devin.ai/sessions/96ab934b56a34beb97ae5931d266e271
Requested by: @XinZhangBambu