From a172e896202af8aecf183883cb67b3de2e063b32 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 20 May 2024 10:16:11 +0200 Subject: [PATCH] fix: Don't restore toolbar items when they're empty --- plugins/builtin/source/content/settings_entries.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/builtin/source/content/settings_entries.cpp b/plugins/builtin/source/content/settings_entries.cpp index 4124dd5d3..2c873ad67 100644 --- a/plugins/builtin/source/content/settings_entries.cpp +++ b/plugins/builtin/source/content/settings_entries.cpp @@ -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>>(); 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;