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

Function getReadableSize

source/ui/utils/uihelper.cpp:77–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77BString 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
93void alignNextTextRightInColumn(const char* text) {
94 ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetColumnWidth() - ImGui::CalcTextSize(text).x - ImGui::GetScrollX() - 2 * ImGui::GetStyle().ItemSpacing.x);

Callers 1

updateCachedSizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected