impr: Added hint when patterns are still loading
This commit is contained in:
parent
60649d1cba
commit
58cef2361b
@ -245,4 +245,5 @@ namespace ImGui {
|
||||
bool DimmedIconButton(const char *symbol, ImVec4 color, ImVec2 size_arg = ImVec2(0, 0));
|
||||
bool DimmedIconToggle(const char *icon, bool *v);
|
||||
|
||||
void TextOverlay(const char *text, ImVec2 pos);
|
||||
}
|
@ -810,4 +810,17 @@ namespace ImGui {
|
||||
return toggled;
|
||||
}
|
||||
|
||||
void TextOverlay(const char *text, ImVec2 pos) {
|
||||
const auto textSize = ImGui::CalcTextSize(text);
|
||||
const auto textPos = pos - textSize / 2;
|
||||
const auto margin = ImGui::GetStyle().FramePadding * 2;
|
||||
const auto textRect = ImRect(textPos - margin, textPos + textSize + margin);
|
||||
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
|
||||
drawList->AddRectFilled(textRect.Min, textRect.Max, ImGui::GetColorU32(ImGuiCol_WindowBg) | 0xFF000000);
|
||||
drawList->AddRect(textRect.Min, textRect.Max, ImGui::GetColorU32(ImGuiCol_Border));
|
||||
drawList->AddText(textPos, ImGui::GetColorU32(ImGuiCol_Text), text);
|
||||
}
|
||||
|
||||
}
|
@ -436,6 +436,7 @@
|
||||
"hex.builtin.pattern_drawer.tree_style.auto_expanded": "Auto Expanded Tree",
|
||||
"hex.builtin.pattern_drawer.tree_style.flattened": "Flattened",
|
||||
"hex.builtin.pattern_drawer.type": "Type",
|
||||
"hex.builtin.pattern_drawer.updating": "Updating patterns...",
|
||||
"hex.builtin.pattern_drawer.value": "Value",
|
||||
"hex.builtin.pattern_drawer.var_name": "Name",
|
||||
"hex.builtin.pattern_drawer.visualizer.unknown": "Unknown visualizer",
|
||||
|
@ -1167,6 +1167,10 @@ namespace hex::plugin::builtin::ui {
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
||||
if (this->m_favoritesUpdateTask.isRunning()) {
|
||||
ImGui::TextOverlay("hex.builtin.pattern_drawer.updating"_lang, ImGui::GetWindowPos() + ImGui::GetWindowSize() / 2);
|
||||
}
|
||||
}
|
||||
|
||||
void PatternDrawer::reset() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user