1
0
mirror of synced 2025-01-10 21:41:53 +01:00

impr: Update settings menu values when settings are changed

This commit is contained in:
WerWolv 2024-12-15 11:12:56 +01:00
parent 002b7b4f87
commit c46dea4c9e
3 changed files with 7 additions and 1 deletions

View File

@ -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);

View File

@ -211,6 +211,8 @@ namespace hex {
}
}
}
EventAnySettingChanged::post();
}
}

View File

@ -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);
}