mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Update settings menu values when settings are changed
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -211,6 +211,8 @@ namespace hex {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EventAnySettingChanged::post();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user