Update SnesColorButton and PaletteEditor

This commit is contained in:
scawful
2024-02-02 23:58:52 -05:00
parent 427b7f6f41
commit 626d38ec0d
8 changed files with 79 additions and 39 deletions

View File

@@ -106,7 +106,7 @@ void ResourceLabelManager::SelectableLabelWithNameEdit(
ImGui::Selectable(label.c_str(), selected,
ImGuiSelectableFlags_AllowDoubleClick);
std::string label_id = type + "_" + key;
if (ImGui::IsMouseClicked(ImGuiMouseButton_Right)) {
if (ImGui::IsItemHovered() && ImGui::IsMouseClicked(ImGuiMouseButton_Right)) {
ImGui::OpenPopup(label_id.c_str());
}
@@ -118,8 +118,6 @@ void ResourceLabelManager::SelectableLabelWithNameEdit(
}
ImGui::EndPopup();
}
// ImGui::PopID();
}
std::string ResourceLabelManager::CreateOrGetLabel(

View File

@@ -35,6 +35,8 @@ class ResourceLabelManager {
const std::string& defaultValue);
std::string CreateOrGetLabel(const std::string& type, const std::string& key,
const std::string& defaultValue);
std::string CreateOrGetLabel(const std::string& type, const std::string& key,
const absl::string_view& defaultValue);
private:
bool labels_loaded_ = false;