1
0
mirror of synced 2025-01-29 19:17:28 +01:00

ui: Turned spinner into ImGui widget

This commit is contained in:
WerWolv 2021-02-22 13:06:53 +01:00
parent 7f21cdffa2
commit ced9706c5b
6 changed files with 11 additions and 6 deletions

View File

@ -13,4 +13,5 @@ namespace ImGui {
void UnderlinedText(const char* label, ImColor color, const ImVec2& size_arg = ImVec2(0, 0));
void Disabled(std::function<void()> widgets, bool disabled);
void TextSpinner(const char* label);
}

View File

@ -153,4 +153,8 @@ namespace ImGui {
}
}
void TextSpinner(const char* label) {
ImGui::Text("[%c] %s", "|/-\\"[ImU32(ImGui::GetTime() * 20) % 4], label);
}
}

View File

@ -108,7 +108,7 @@ namespace hex::plugin::builtin {
{ "hex.view.disassembler.sparc.v9", "Sparc V9 mode" },
{ "hex.view.disassembler.disassemble", "Disassemble" },
{ "hex.view.disassembler.disassembling", "[%c] Disassembling..." },
{ "hex.view.disassembler.disassembling", "Disassembling..." },
{ "hex.view.disassembler.disassembly.title", "Disassembly" },
{ "hex.view.disassembler.disassembly.address", "Address" },
{ "hex.view.disassembler.disassembly.offset", "Offset" },
@ -221,7 +221,7 @@ namespace hex::plugin::builtin {
{ "hex.view.pattern.accept_pattern.question", "Do you want to apply the selected pattern?" },
{ "hex.view.pattern.menu.file.load_pattern", "Load pattern..." },
{ "hex.view.pattern.open_pattern", "Open pattern" },
{ "hex.view.pattern.evaluating", "[%c] Evaluating..." },
{ "hex.view.pattern.evaluating", "Evaluating..." },
{ "hex.view.pattern.auto", "Auto evaluate" },
{ "hex.view.pattern_data.name", "Pattern Data" },
@ -240,7 +240,7 @@ namespace hex::plugin::builtin {
{ "hex.view.strings.min_length", "Minimum length" },
{ "hex.view.strings.filter", "Filter" },
{ "hex.view.strings.extract", "Extract" },
{ "hex.view.strings.searching", "[%c] Searching..." },
{ "hex.view.strings.searching", "Searching..." },
{ "hex.view.strings.offset", "Offset" },
{ "hex.view.strings.size", "Size" },
{ "hex.view.strings.string", "String" },

View File

@ -249,7 +249,7 @@ namespace hex {
if (this->m_disassembling) {
ImGui::SameLine();
ImGui::Text("hex.view.disassembler.disassembling"_lang, "|/-\\"[u8(ImGui::GetTime() * 20) % 4]);
ImGui::TextSpinner("hex.view.disassembler.disassembling"_lang);
}
ImGui::NewLine();

View File

@ -267,7 +267,7 @@ namespace hex {
ImGui::SameLine();
if (this->m_evaluatorRunning)
ImGui::Text("hex.view.pattern.evaluating"_lang, "|/-\\"[u8(ImGui::GetTime() * 20) % 4]);
ImGui::TextSpinner("hex.view.pattern.evaluating"_lang);
else
ImGui::Checkbox("hex.view.pattern.auto"_lang, &this->m_runAutomatically);

View File

@ -102,7 +102,7 @@ namespace hex {
if (this->m_searching) {
ImGui::SameLine();
ImGui::Text("hex.view.strings.searching"_lang, "|/-\\"[u8(ImGui::GetTime() * 20) % 4]);
ImGui::TextSpinner("hex.view.strings.searching"_lang);
}