MCPcopy Create free account
hub / github.com/chrxh/alien / processYesNo

Method processYesNo

source/Gui/GenericMessageDialog.cpp:80–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void GenericMessageDialog::processYesNo()
81{
82 if (!_sizeInitialized) {
83 auto size = ImGui::GetWindowSize();
84 auto factor = WindowController::get().getContentScaleFactor() / WindowController::get().getLastContentScaleFactor();
85 ImGui::SetWindowSize({size.x * factor, size.y * factor});
86 _sizeInitialized = true;
87 }
88
89 ImGui::TextWrapped("%s", _message.c_str());
90
91 ImGui::Dummy({0, ImGui::GetContentRegionAvail().y - scale(50.0f)});
92 AlienImGui::Separator();
93
94 if (AlienImGui::Button("Yes")) {
95 close();
96 _execFunction();
97 }
98 ImGui::SameLine();
99 if (AlienImGui::Button("No")) {
100 close();
101 }
102}

Callers

nothing calls this directly

Calls 3

scaleFunction · 0.85
getContentScaleFactorMethod · 0.80

Tested by

no test coverage detected