From 487cc7f5914c0d8e37ae3bc112d94f6355bdfa56 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sun, 4 Jun 2023 17:17:26 -0700 Subject: [PATCH] ui: Make snapshot Replace button red --- ui/xui/main-menu.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/xui/main-menu.cc b/ui/xui/main-menu.cc index dee90317be..79ab0dbb67 100644 --- a/ui/xui/main-menu.cc +++ b/ui/xui/main-menu.cc @@ -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());