ui: Make snapshot Replace button red

This commit is contained in:
Matt Borgerson 2023-06-04 17:17:26 -07:00 committed by mborgerson
parent 386a114c01
commit 487cc7f591

View File

@ -804,10 +804,18 @@ void MainMenuSnapshotsView::Draw()
}
ImGui::SameLine();
if (snapshot_with_create_name_exists) {
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.8, 0, 0, 1));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(1, 0, 0, 1));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(1, 0, 0, 1));
}
if (ImGui::Button(snapshot_with_create_name_exists ? "Replace" : "Create", ImVec2(-FLT_MIN, 0))) {
xemu_snapshots_save(m_search_buf.empty() ? NULL : m_search_buf.c_str(), NULL);
ClearSearch();
}
if (snapshot_with_create_name_exists) {
ImGui::PopStyleColor(3);
}
if (snapshot_with_create_name_exists && ImGui::IsItemHovered()) {
ImGui::SetTooltip("A snapshot with the name \"%s\" already exists. This button will overwrite the existing snapshot.", m_search_buf.c_str());