fix: Resetting shortcuts not saving change to settings
This commit is contained in:
parent
836d66a150
commit
4b13cd666b
@ -224,10 +224,14 @@ namespace hex::plugin::builtin {
|
|||||||
if (this->m_hasDuplicate)
|
if (this->m_hasDuplicate)
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
|
|
||||||
|
bool settingChanged = false;
|
||||||
|
|
||||||
ImGui::BeginDisabled(this->m_shortcut == this->m_defaultShortcut);
|
ImGui::BeginDisabled(this->m_shortcut == this->m_defaultShortcut);
|
||||||
if (ImGuiExt::IconButton(ICON_VS_X, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
|
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_hasDuplicate = !ShortcutManager::updateShortcut(this->m_shortcut, this->m_defaultShortcut, this->m_view);
|
||||||
this->m_shortcut = this->m_defaultShortcut;
|
this->m_shortcut = this->m_defaultShortcut;
|
||||||
|
|
||||||
|
settingChanged = true;
|
||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
|
||||||
@ -247,11 +251,11 @@ namespace hex::plugin::builtin {
|
|||||||
this->m_editing = false;
|
this->m_editing = false;
|
||||||
ShortcutManager::resumeShortcuts();
|
ShortcutManager::resumeShortcuts();
|
||||||
|
|
||||||
return true;
|
settingChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return settingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
void load(const nlohmann::json &data) override {
|
void load(const nlohmann::json &data) override {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user