MCPcopy Create free account
hub / github.com/aiekick/ImGuiFileDialog / m_BeginFileColorIconStyle

Method m_BeginFileColorIconStyle

ImGuiFileDialog.cpp:4226–4257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4224}
4225
4226void IGFD::FileDialog::m_BeginFileColorIconStyle(std::shared_ptr<FileInfos> vFileInfos, bool& vOutShowColor, std::string& vOutStr, ImFont** vOutFont) {
4227 vOutStr.clear();
4228 vOutShowColor = false;
4229
4230 if (vFileInfos->fileStyle != nullptr) {
4231 vOutShowColor = true;
4232 *vOutFont = vFileInfos->fileStyle->font;
4233 }
4234
4235 if (vOutShowColor && !vFileInfos->fileStyle->icon.empty()) {
4236 vOutStr = vFileInfos->fileStyle->icon;
4237 } else if (vFileInfos->fileType.isDir()) {
4238 vOutStr = dirEntryString;
4239 } else if (vFileInfos->fileType.isLinkToUnknown()) {
4240 vOutStr = linkEntryString;
4241 } else if (vFileInfos->fileType.isFile()) {
4242 vOutStr = fileEntryString;
4243 }
4244
4245 vOutStr += " " + vFileInfos->fileNameExt;
4246
4247 if (vOutShowColor) {
4248 ImGui::PushStyleColor(ImGuiCol_Text, vFileInfos->fileStyle->color);
4249 }
4250 if (*vOutFont) {
4251#if IMGUI_VERSION_NUM < 19201
4252 ImGui::PushFont(*vOutFont);
4253#else
4254 ImGui::PushFont(*vOutFont, 0.0f);
4255#endif
4256 }
4257}
4258
4259void IGFD::FileDialog::m_EndFileColorIconStyle(const bool vShowColor, ImFont* vFont) {
4260 if (vFont) {

Callers

nothing calls this directly

Calls 5

clearMethod · 0.80
emptyMethod · 0.80
isDirMethod · 0.80
isLinkToUnknownMethod · 0.80
isFileMethod · 0.80

Tested by

no test coverage detected