impr: Update settings menu values when settings are changed
This commit is contained in:
parent
002b7b4f87
commit
c46dea4c9e
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user