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

Method runApps

source/ui/controls/installView.cpp:55–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void InstallView::runApps(std::vector<AppFilePtr>& apps) {
56 ImGui::PushFont(GlobalSettings::largeFont);
57 ImGui::Dummy(ImVec2(0.0f, this->extraVerticalSpacing));
58 SAFE_IMGUI_TEXT(c_getTranslation(Msg::INSTALLVIEW_DEMO_TITLE));
59 ImGui::PopFont();
60
61 ImVec2 size = ImGui::GetWindowContentRegionMax();
62 size.y -= ImGui::GetCursorPosY() + GlobalSettings::scaleFloatUI(8.0f);
63
64 ImGui::PushFont(GlobalSettings::mediumFont);
65 //ImGui::BeginChildFrame(401, size);
66 ImGui::Dummy(ImVec2(0.0f, this->extraVerticalSpacing));
67 for (auto& app : apps) {
68 ImGui::Dummy(ImVec2(this->extraVerticalSpacing, 0.0f));
69 ImGui::SameLine();
70 ImVec2 pos = ImGui::GetCursorPos();
71 pos.y += this->extraVerticalSpacing;
72 ImGui::SetCursorPos(pos);
73
74 BString buttonLabel = B("Install");
75 ImGui::PushID(&app);
76 if (ImGui::Button(buttonLabel.c_str())) {
77 if (Fs::doesNativePathExist(app->localFilePath)) {
78 app->install();
79 } else {
80 GlobalSettings::downloadFile(app->filePath, app->localFilePath, app->name, app->size, [&app](bool sucess) {
81 app->install();
82 });
83 }
84 }
85 ImGui::PopID();
86 ImGui::SameLine();
87
88 //ImGui::SameLine(pos.x + this->wineButtonTotalColumnWidth);
89 BString name = app->name;
90 BString name2;
91 if (!Fs::doesNativePathExist(app->localFilePath)) {
92 name2 += "(";
93 name2 += getTranslation(Msg::INSTALLVIEW_DEMO_DOWNLOAD_SIZE);
94 name2 += app->size;
95 name2 += " MB)";
96 }
97 if (app->iconTexture) {
98 float pad = ImGui::GetStyle().FramePadding.y;
99 ImGui::Image(app->iconTexture->getTexture(), ImVec2(ImGui::GetTextLineHeight()+pad*2, ImGui::GetTextLineHeight()+pad*2));
100 ImGui::SameLine();
101 }
102 SAFE_IMGUI_TEXT(name.c_str());
103 ImGui::SameLine();
104 ImGui::PushFont(GlobalSettings::defaultFont);
105 pos = ImGui::GetCursorPos();
106 float y = pos.y;
107 pos.y += GlobalSettings::mediumFont->FontSize / 2 - GlobalSettings::defaultFont->FontSize / 2;
108 ImGui::SetCursorPos(pos);
109 SAFE_IMGUI_TEXT(name2.c_str());
110 ImGui::PopFont();
111 if (app->help.length()) {
112 pos = ImGui::GetCursorPos();

Callers

nothing calls this directly

Calls 10

ImVec2Class · 0.85
c_getTranslationFunction · 0.85
BFunction · 0.85
downloadFileFunction · 0.85
getTranslationFunction · 0.85
getTextureMethod · 0.80
c_strMethod · 0.45
installMethod · 0.45
lengthMethod · 0.45
drawToolTipMethod · 0.45

Tested by

no test coverage detected