diff --git a/lib/libimhex/include/hex/api/event_manager.hpp b/lib/libimhex/include/hex/api/event_manager.hpp index 1fc3c253b..c8b04c9a7 100644 --- a/lib/libimhex/include/hex/api/event_manager.hpp +++ b/lib/libimhex/include/hex/api/event_manager.hpp @@ -258,6 +258,7 @@ namespace hex { EVENT_DEF(EventSearchBoxClicked, u32); EVENT_DEF(EventViewOpened, View*); EVENT_DEF(EventFirstLaunch); + EVENT_DEF(EventAnySettingChanged); EVENT_DEF(EventFileDragged, bool); EVENT_DEF(EventFileDropped, std::fs::path); diff --git a/lib/libimhex/source/api/content_registry.cpp b/lib/libimhex/source/api/content_registry.cpp index 102009ac9..7198aecd2 100644 --- a/lib/libimhex/source/api/content_registry.cpp +++ b/lib/libimhex/source/api/content_registry.cpp @@ -211,6 +211,8 @@ namespace hex { } } } + + EventAnySettingChanged::post(); } } diff --git a/plugins/builtin/source/content/views/view_settings.cpp b/plugins/builtin/source/content/views/view_settings.cpp index 21d55d90e..7d367cc94 100644 --- a/plugins/builtin/source/content/views/view_settings.cpp +++ b/plugins/builtin/source/content/views/view_settings.cpp @@ -26,7 +26,7 @@ namespace hex::plugin::builtin { this->getWindowOpenState() = true; }); - EventImHexStartupFinished::subscribe(this, [] { + EventAnySettingChanged::subscribe(this, [] { for (const auto &[unlocalizedCategory, unlocalizedDescription, subCategories] : ContentRegistry::Settings::impl::getSettings()) { for (const auto &[unlocalizedSubCategory, entries] : subCategories) { for (const auto &[unlocalizedName, widget] : entries) { @@ -41,10 +41,13 @@ namespace hex::plugin::builtin { } } }); + + EventImHexStartupFinished::subscribe(this, []{ EventAnySettingChanged::post(); }); } ViewSettings::~ViewSettings() { RequestOpenWindow::unsubscribe(this); + EventAnySettingChanged::unsubscribe(this); EventImHexStartupFinished::unsubscribe(this); }