| 75 | } |
| 76 | |
| 77 | BString getReadableSize(U64 bytes) { |
| 78 | if (bytes < 4096) { |
| 79 | return BString::valueOf(bytes)+" B"; |
| 80 | } |
| 81 | bytes /= 1024; |
| 82 | if (bytes < 4096) { |
| 83 | return BString::valueOf(bytes)+" KB"; |
| 84 | } |
| 85 | bytes /= 1024; |
| 86 | if (bytes < 4096) { |
| 87 | return BString::valueOf(bytes)+" MB"; |
| 88 | } |
| 89 | bytes /= 1024; |
| 90 | return BString::valueOf(bytes)+" GB"; |
| 91 | } |
| 92 | |
| 93 | void alignNextTextRightInColumn(const char* text) { |
| 94 | ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetColumnWidth() - ImGui::CalcTextSize(text).x - ImGui::GetScrollX() - 2 * ImGui::GetStyle().ItemSpacing.x); |