1
0
mirror of synced 2024-11-12 02:00:52 +01:00

fix: Don't restore toolbar items when they're empty

This commit is contained in:
WerWolv 2024-05-20 10:16:11 +02:00
parent ecb9537c4e
commit a172e89620

View File

@ -585,13 +585,13 @@ namespace hex::plugin::builtin {
if (data.is_null())
return;
for (auto &[priority, menuItem] : ContentRegistry::Interface::impl::getMenuItemsMutable())
menuItem.toolbarIndex = -1;
auto toolbarItems = data.get<std::map<i32, std::pair<std::string, u32>>>();
if (toolbarItems.empty())
return;
for (auto &[priority, menuItem] : ContentRegistry::Interface::impl::getMenuItemsMutable())
menuItem.toolbarIndex = -1;
for (auto &[priority, menuItem] : ContentRegistry::Interface::impl::getMenuItemsMutable()) {
for (const auto &[index, value] : toolbarItems) {
const auto &[name, color] = value;