From 4b13cd666b5962e78982f7ea7b5090d69b0721e4 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 19 Nov 2023 18:22:57 +0100 Subject: [PATCH] fix: Resetting shortcuts not saving change to settings --- plugins/builtin/source/content/settings_entries.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/builtin/source/content/settings_entries.cpp b/plugins/builtin/source/content/settings_entries.cpp index 80bb0ee76..4f296b73d 100644 --- a/plugins/builtin/source/content/settings_entries.cpp +++ b/plugins/builtin/source/content/settings_entries.cpp @@ -224,10 +224,14 @@ namespace hex::plugin::builtin { if (this->m_hasDuplicate) ImGui::PopStyleColor(); + bool settingChanged = false; + ImGui::BeginDisabled(this->m_shortcut == this->m_defaultShortcut); if (ImGuiExt::IconButton(ICON_VS_X, ImGui::GetStyleColorVec4(ImGuiCol_Text))) { this->m_hasDuplicate = !ShortcutManager::updateShortcut(this->m_shortcut, this->m_defaultShortcut, this->m_view); this->m_shortcut = this->m_defaultShortcut; + + settingChanged = true; } ImGui::EndDisabled(); @@ -247,11 +251,11 @@ namespace hex::plugin::builtin { this->m_editing = false; ShortcutManager::resumeShortcuts(); - return true; + settingChanged = true; } } - return false; + return settingChanged; } void load(const nlohmann::json &data) override {