From 7f6783c3dd0795679b6fcc127a17724e7a507b08 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 6 Jul 2023 18:02:25 -0400 Subject: [PATCH] Re-render browser module framebuffers when settings::preferDarkPanels is changed. --- src/app/Browser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/Browser.cpp b/src/app/Browser.cpp index 7c0bc3c0..aa917ff1 100644 --- a/src/app/Browser.cpp +++ b/src/app/Browser.cpp @@ -469,6 +469,7 @@ struct Browser : widget::OpaqueWidget { std::string brand; std::set tagIds = {}; bool favorite = false; + bool lastPreferDarkPanels = false; // Caches and temporary state std::map prefilteredModelScores; @@ -600,6 +601,14 @@ struct Browser : widget::OpaqueWidget { modelMargin->box.size.y = modelContainer->box.size.y + margin; modelContainer->box.size.x = modelMargin->box.size.x - margin; + // Check if preferDarkPanels has changed + if (settings::preferDarkPanels != lastPreferDarkPanels) { + lastPreferDarkPanels = settings::preferDarkPanels; + // Request module framebuffers to re-render + Widget::DirtyEvent eDirty; + modelContainer->onDirty(eDirty); + } + OpaqueWidget::step(); }