impr: Get rid of more unnecessary ImGui::Text() calls

This commit is contained in:
WerWolv 2024-06-26 19:41:06 +02:00
parent 1dfce6a5c2
commit e2d55446fe
4 changed files with 13 additions and 13 deletions

View file

@ -60,7 +60,7 @@ namespace hex::plugin::builtin {
const u8 c = data[0];
switch (c) {
case 0x00:
ImGui::Text(" ");
ImGui::TextUnformatted(" ");
break;
case 0xFF:
ImGui::TextDisabled("##");

View file

@ -267,7 +267,7 @@ namespace hex::plugin::builtin {
ImGui::Image(process->icon, process->icon.getSize());
ImGui::TableNextColumn();
ImGui::Text("%d", process->id);
ImGuiExt::TextFormatted("{}", process->id);
ImGui::TableNextColumn();
if (ImGui::Selectable(process->name.c_str(), m_selectedProcess != nullptr && process->id == m_selectedProcess->id, ImGuiSelectableFlags_SpanAllColumns, ImVec2(0, process->icon.getSize().y)))

View file

@ -482,7 +482,7 @@ namespace hex::plugin::builtin {
ImGui::TableNextColumn();
ImGui::Text("=");
ImGui::TextUnformatted("=");
// Sign.
ImGui::TableNextColumn();
@ -496,14 +496,14 @@ namespace hex::plugin::builtin {
ImGui::Indent(10_scaled);
ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, signColorU32);
if (ieee754.signBits == 1)
ImGui::Text("-1");
ImGui::TextUnformatted("-1");
else
ImGui::Text("+1");
ImGui::TextUnformatted("+1");
ImGui::Unindent(10_scaled);
// Times.
ImGui::TableNextColumn();
ImGui::Text("x");
ImGui::TextUnformatted("x");
ImGui::TableNextColumn();
// Exponent.
@ -512,13 +512,13 @@ namespace hex::plugin::builtin {
ImGui::Indent(20_scaled);
if (ieee754.numberType == NumberType::NaN) {
if (ieee754.valueType == ValueType::QuietNaN)
ImGui::Text("qNaN");
ImGui::TextUnformatted("qNaN");
else
ImGui::Text("sNaN");
ImGui::TextUnformatted("sNaN");
} else if (ieee754.numberType == NumberType::Infinity) {
ImGui::Text("Inf");
ImGui::TextUnformatted("Inf");
} else if (ieee754.numberType == NumberType::Zero) {
ImGui::Text("0");
ImGui::TextUnformatted("0");
} else if (ieee754.numberType == NumberType::Denormal) {
ImGuiExt::TextFormatted("2^{0}", 1 - ieee754.exponentBias);
} else {
@ -529,7 +529,7 @@ namespace hex::plugin::builtin {
// Times.
ImGui::TableNextColumn();
ImGui::Text("x");
ImGui::TextUnformatted("x");
ImGui::TableNextColumn();
// Mantissa.
@ -652,7 +652,7 @@ namespace hex::plugin::builtin {
// Equals.
ImGui::TableNextColumn();
ImGui::Text("=");
ImGui::TextUnformatted("=");
FormatBits(signBitPosition, exponentBitPosition, mantissaBitPosition);

View file

@ -109,7 +109,7 @@ namespace hex::plugin::builtin {
}
ImGui::TableNextColumn();
// The space makes a padding in the UI
ImGui::Text("%s ", wolv::util::combineStrings(entry.authors, ", ").c_str());
ImGuiExt::TextFormatted("{} ", wolv::util::combineStrings(entry.authors, ", "));
ImGui::TableNextColumn();
const auto buttonSize = ImVec2(100_scaled, ImGui::GetTextLineHeightWithSpacing());