Browse Source

Re-render browser module framebuffers when settings::preferDarkPanels is changed.

tags/v2.4.0
Andrew Belt 1 year ago
parent
commit
7f6783c3dd
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      src/app/Browser.cpp

+ 9
- 0
src/app/Browser.cpp View File

@@ -469,6 +469,7 @@ struct Browser : widget::OpaqueWidget {
std::string brand;
std::set<int> tagIds = {};
bool favorite = false;
bool lastPreferDarkPanels = false;

// Caches and temporary state
std::map<plugin::Model*, float> 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();
}



Loading…
Cancel
Save