| 4224 | } |
| 4225 | |
| 4226 | void 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 | |
| 4259 | void IGFD::FileDialog::m_EndFileColorIconStyle(const bool vShowColor, ImFont* vFont) { |
| 4260 | if (vFont) { |
nothing calls this directly
no test coverage detected