From 06acb6b73876483a8e7fec3614c1cd9b93732eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 2 Oct 2024 12:46:18 +0200 Subject: [PATCH] arealights: load the UI style without icons to not need image importers. Now it runs on the web without having to link the extra plugins. Yay! --- src/arealights/AreaLightsExample.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/arealights/AreaLightsExample.cpp b/src/arealights/AreaLightsExample.cpp index 6a2c1294..f63d256a 100644 --- a/src/arealights/AreaLightsExample.cpp +++ b/src/arealights/AreaLightsExample.cpp @@ -421,7 +421,10 @@ AreaLightsExample::AreaLightsExample(const Arguments& arguments): Platform::Appl /* Create the UI */ { - _ui.ui.create(Vector2{windowSize()}/dpiScaling(), Vector2{windowSize()}, framebufferSize(), Ui::McssDarkStyle{}); + /* We don't use the icons for anything, load the style without to not + need to link to image importers on the web */ + Ui::McssDarkStyle style; + _ui.ui.create(Vector2{windowSize()}/dpiScaling(), Vector2{windowSize()}, framebufferSize(), style, style.features() & ~Ui::StyleFeature::TextLayerImages); /** @todo make a builtin API for this, or, better, make it automatic */ CORRADE_INTERNAL_ASSERT(_ui.ui.textLayer().shared().font(Ui::fontHandle(1, 1)).fillGlyphCache(_ui.ui.textLayer().shared().glyphCache(), "ƒ₀")); Ui::NodeHandle root = Ui::snap(_ui.ui, Ui::Snap::Fill|Ui::Snap::NoPad, {});