Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

Opaque popups, menus, tooltips and windows in every look (PopupBg/WindowBg alpha 1); ui_opaque_popups checks each look and scheme

islandmed2e1b5bec4c21
diff --git a/changes/fix-opaque-popups.md b/changes/fix-opaque-popups.md
new file mode 100644
index 00000000..bb3b4d37
--- /dev/null
+++ b/changes/fix-opaque-popups.md
@@ -0,0 +1,11 @@
+---
+whats_new: **Opaque popups**: menus, popups, tooltips and windows no longer let the interface behind them show
+ through (it was easy to see at 200% scale), in every look and colour scheme.
+fixed: Popups, menus, tooltips, the Command Palette, the Quick Menu and floating windows are fully opaque in every look
+ (Classic, Forge Terminal and its schemes, Phosphor, Blueprint); at 200% the Preferences popup showed the Sculpt
+ Timeline's "Save with project" and the shelf text through it. Overlays on the 3D view keep their translucency.
+testers:
+ - Windows at 200% scaling: Edit > Preferences with the Sculpt Timeline showing; nothing behind the popup reads through.
+ - Any OS: switch Preferences > Interface > Look through each look; open a menu and hover for a tooltip, both solid.
+---
+UI test: tests/ui/opaque_popups.sfui (style_popup_alpha / style_menu_alpha / style_window_alpha == 1 per look and scheme).
diff --git a/src/app/CommandPalette.cpp b/src/app/CommandPalette.cpp
index 05f56ee9..6506e9dd 100644
--- a/src/app/CommandPalette.cpp
+++ b/src/app/CommandPalette.cpp
@@ -192,7 +192,7 @@ void CommandPalette::draw(App& app, const CanvasRect& area) {
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8.0f * s, 8.0f * s));
ImGui::PushStyleVar(ImGuiStyleVar_PopupRounding, 6.0f * s);
ImGui::PushStyleVar(ImGuiStyleVar_PopupBorderSize, 1.0f);
- ImGui::PushStyleColor(ImGuiCol_PopupBg, ImVec4(0x25 / 255.0f, 0x25 / 255.0f, 0x28 / 255.0f, 0.98f));
+ ImGui::PushStyleColor(ImGuiCol_PopupBg, ImVec4(0x25 / 255.0f, 0x25 / 255.0f, 0x28 / 255.0f, 1.0f));
ImGui::PushStyleColor(ImGuiCol_Border, ImGui::ColorConvertU32ToFloat4(IM_COL32(0xf0, 0x88, 0x2e, 0x70)));
std::function<void()> pending;
std::string prefill;
diff --git a/src/app/Config.cpp b/src/app/Config.cpp
index 93af069a..a2271b5d 100644
--- a/src/app/Config.cpp
+++ b/src/app/Config.cpp
@@ -1439,7 +1439,7 @@ void App::drawHelpConsoleUi() {
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(16.0f * s, 12.0f * s));
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 6.0f * s);
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 1.0f);
- ImGui::PushStyleColor(ImGuiCol_WindowBg, col(IM_COL32(0x18, 0x18, 0x1a, 0xf8)));
+ ImGui::PushStyleColor(ImGuiCol_WindowBg, col(IM_COL32(0x18, 0x18, 0x1a, 0xff)));
ImGui::PushStyleColor(ImGuiCol_Border, col(IM_COL32(0xf0, 0x88, 0x2e, 0xa0)));
if (ImGui::Begin("##shortcut_capture", nullptr,
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings |
diff --git a/src/app/Input.cpp b/src/app/Input.cpp
index f6a6bcd7..823b63be 100644
--- a/src/app/Input.cpp
+++ b/src/app/Input.cpp
@@ -769,7 +769,7 @@ void App::drawQuickMenu() {
ImGui::SetNextWindowPos(ImVec2(quickMenu_.at.x - width * 0.5f, quickMenu_.at.y - tile * 0.5f), ImGuiCond_Appearing);
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 6.0f);
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8, 8));
- ImGui::PushStyleColor(ImGuiCol_WindowBg, theme::u32(theme::panelBg, 0.96f)); // the look's own grey, no blue tint
+ ImGui::PushStyleColor(ImGuiCol_WindowBg, theme::u32(theme::panelBg)); // the look's own grey, no blue tint, opaque
bool close = false;
if (ImGui::Begin(tr("Quick Menu##quickmenu"), nullptr,
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings |
diff --git a/src/app/Theme.cpp b/src/app/Theme.cpp
index a3867836..d970a665 100644
--- a/src/app/Theme.cpp
+++ b/src/app/Theme.cpp
@@ -38,9 +38,10 @@ void applyStyle() {
ImVec4* c = s.Colors;
c[ImGuiCol_Text] = text;
c[ImGuiCol_TextDisabled] = textDim;
- c[ImGuiCol_WindowBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 0.98f);
+ // Opaque: text behind a window, menu or tooltip showed through at 200% (overlays on the 3D view set their own alpha).
+ c[ImGuiCol_WindowBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 1.0f);
c[ImGuiCol_ChildBg] = ImVec4(0, 0, 0, 0);
- c[ImGuiCol_PopupBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 0.98f);
+ c[ImGuiCol_PopupBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 1.0f);
c[ImGuiCol_Border] = rgb(0x3c3c3c, 0.9f);
c[ImGuiCol_BorderShadow] = ImVec4(0, 0, 0, 0);
c[ImGuiCol_FrameBg] = frame;
@@ -247,8 +248,8 @@ void applyLook(const LookSettings& settings, std::string* status) {
s.WindowBorderSize = s.PopupBorderSize = 1.0f;
ImVec4* c = s.Colors;
const ImVec4 s1 = rgb(palette.surface1), s2 = rgb(palette.surface2);
- c[ImGuiCol_WindowBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 0.99f);
- c[ImGuiCol_PopupBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 0.99f);
+ c[ImGuiCol_WindowBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 1.0f); // opaque, as in Classic
+ c[ImGuiCol_PopupBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 1.0f);
c[ImGuiCol_Border] = look.outlines == 0 ? mixc(panelBg, strong, 0.3f) : tileBorder; // (popups keep an edge)
c[ImGuiCol_FrameBgActive] = s1;
c[ImGuiCol_TitleBgActive] = s1;
diff --git a/src/app/UiTest.cpp b/src/app/UiTest.cpp
index 01ecbde8..219bbb65 100644
--- a/src/app/UiTest.cpp
+++ b/src/app/UiTest.cpp
@@ -116,6 +116,8 @@
// timeline_height / library_height (the strips, logical px; 0 not shown), library_tile,
// axis_view (the side view named under the axis gizmo: 0-5 = +x +y +z -x -y -z, -1 none),
// style_window_min (ImGui's minimum window height, unscaled px: 32 in every look),
+// style_popup_alpha / style_menu_alpha / style_window_alpha (the look's PopupBg, MenuBarBg and
+// WindowBg alpha: 1, opaque, in every look),
// tablet_mouse_mode (Preferences > Tablet > Mouse mode),
// ui_mouse_x / ui_mouse_y (where ImGui sees the pointer), backface_culling, drawn_triangles,
// floor_grid (View > Display > Floor grid), floor_grid_drawn (the 3D view drawn once more
@@ -1144,6 +1146,9 @@ double Demo::query(const std::string& name, bool& known) const {
if (name == "frame_height") return double(ImGui::GetFrameHeight()); // a button's height: font + style padding
if (name == "panel_width") return double(app_.shell_.rightShelf.w); // the right shelf, 52 logical px
if (name == "title_height") return double(app_.shell_.title.h);
+ if (name == "style_popup_alpha") return double(ImGui::GetStyle().Colors[ImGuiCol_PopupBg].w);
+ if (name == "style_menu_alpha") return double(ImGui::GetStyle().Colors[ImGuiCol_MenuBarBg].w);
+ if (name == "style_window_alpha") return double(ImGui::GetStyle().Colors[ImGuiCol_WindowBg].w);
if (name == "style_window_min") return double(ImGui::GetStyle().WindowMinSize.y / std::max(app_.uiScale_, 0.01f));
// Draw > Camera > Gizmo size and View Figure: the axes' length in unscaled px (34 at Medium), the figure shown.
if (name == "axis_gizmo_length") return double(34.0f * app_.axisGizmoUnit() / std::max(app_.uiScale_, 0.01f));
diff --git a/tests/ui/opaque_popups.sfui b/tests/ui/opaque_popups.sfui
new file mode 100644
index 00000000..65bb0373
--- /dev/null
+++ b/tests/ui/opaque_popups.sfui
@@ -0,0 +1,71 @@
+# Opaque popups (fix/opaque-popups): at 200% the Preferences popup showed the Sculpt Timeline's "Save with project" and
+# the shelf text through it (PopupBg alpha 0.98/0.99). Popups, menus, tooltips and windows are opaque in every look and
+# colour scheme; overlays on the 3D view (timeline, hints, badges) keep their own translucency.
+run new_sphere subdivisions=3
+stroke 0.35 0.40 0.60 0.45
+stroke 0.35 0.50 0.60 0.55
+ui_scale 200
+wait_idle 10
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+expect_value style_window_alpha == 1
+click "Edit##menu.edit"
+click "Preferences##section.preferences"
+expect "Preferences/##totray"
+shot preferences-forge-200
+key escape
+
+run ui_look look=classic layout=classic
+wait 0.2
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+expect_value style_window_alpha == 1
+click "Preferences##palette.preferences"
+shot preferences-classic-200
+key escape
+
+run ui_look look=phosphor phosphor=amber effects=true layout=sculptforge
+wait 0.2
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+expect_value style_window_alpha == 1
+run ui_look look=blueprint
+wait 0.2
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+expect_value style_window_alpha == 1
+
+# Every Forge Terminal colour scheme.
+run ui_look look=forge scheme=neutral
+wait 0.2
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+run ui_look scheme=tokyo_night
+wait 0.2
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+run ui_look scheme=catppuccin_mocha
+wait 0.2
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+run ui_look scheme=gruvbox_dark
+wait 0.2
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+run ui_look scheme=nord
+wait 0.2
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+run ui_look scheme=rose_pine
+wait 0.2
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+run ui_look scheme=kanagawa
+wait 0.2
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+run ui_look scheme=everforest outlines=off
+wait 0.2
+expect_value style_popup_alpha == 1
+expect_value style_menu_alpha == 1
+expect_value style_window_alpha == 1