Skip to content

Commit

Permalink
arealights: load the UI style without icons to not need image importers.
Browse files Browse the repository at this point in the history
Now it runs on the web without having to link the extra plugins. Yay!
  • Loading branch information
mosra committed Oct 2, 2024
1 parent e12d1e2 commit 06acb6b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/arealights/AreaLightsExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, {});
Expand Down

0 comments on commit 06acb6b

Please sign in to comment.