MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / showYesNoMessageBox

Function showYesNoMessageBox

source/ui/utils/uihelper.cpp:47–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47bool showYesNoMessageBox(BString id, bool open, const char* title, const char* msg, bool* yes) {
48 bool result = true;
49 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(GlobalSettings::scaleFloatUI(8.0f), GlobalSettings::scaleFloatUI(8.0f)));
50 ImGui::PushID(id.c_str());
51 if (open) {
52 ImGui::OpenPopup(title);
53 }
54 if (ImGui::BeginPopupModal(title, nullptr, ImGuiWindowFlags_AlwaysAutoResize))
55 {
56 SAFE_IMGUI_TEXT(msg);
57 ImGui::Separator();
58
59 if (ImGui::Button(c_getTranslation(Msg::GENERIC_DLG_YES), ImVec2(GlobalSettings::scaleFloatUIAndFont(120.0f), 0))) {
60 ImGui::CloseCurrentPopup();
61 result = false;
62 *yes = true;
63 }
64 ImGui::SameLine();
65 if (ImGui::Button(c_getTranslation(Msg::GENERIC_DLG_NO), ImVec2(GlobalSettings::scaleFloatUIAndFont(120.0f), 0))) {
66 ImGui::CloseCurrentPopup();
67 result = false;
68 }
69 ImGui::SetItemDefaultFocus();
70 ImGui::EndPopup();
71 }
72 ImGui::PopID();
73 ImGui::PopStyleVar();
74 return result;
75}
76
77BString getReadableSize(U64 bytes) {
78 if (bytes < 4096) {

Callers 1

runWineOptionsMethod · 0.85

Calls 3

ImVec2Class · 0.85
c_getTranslationFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected