1
0
mirror of synced 2025-01-25 15:53:43 +01:00

impr: Replaced centered text notes with overlays

This commit is contained in:
WerWolv 2024-12-23 21:30:31 +01:00
parent 7cc99c6fc9
commit c5d3387962
3 changed files with 3 additions and 9 deletions

View File

@ -290,7 +290,7 @@ namespace hex::plugin::builtin {
if (ImGui::BeginChild("##bookmarks")) {
if (m_bookmarks->empty()) {
ImGuiExt::TextFormattedCentered("hex.builtin.view.bookmarks.no_bookmarks"_lang);
ImGuiExt::TextOverlay("hex.builtin.view.bookmarks.no_bookmarks"_lang, ImGui::GetWindowPos() + ImGui::GetWindowSize() / 2, ImGui::GetWindowWidth() * 0.7);
}
auto bookmarkToRemove = m_bookmarks->end();

View File

@ -248,13 +248,7 @@ namespace hex::plugin::builtin {
}
if (m_selectedProvider == nullptr || !m_selectedProvider->isReadable() || m_validBytes <= 0) {
// Draw a message when no bytes are selected
std::string text = "hex.builtin.view.data_inspector.no_data"_lang;
auto textSize = ImGui::CalcTextSize(text.c_str());
auto availableSpace = ImGui::GetContentRegionAvail();
ImGui::SetCursorPos((availableSpace - textSize) / 2.0F);
ImGui::TextUnformatted(text.c_str());
ImGuiExt::TextOverlay("hex.builtin.view.data_inspector.no_data"_lang, ImGui::GetWindowPos() + ImGui::GetWindowSize() / 2, ImGui::GetWindowWidth() * 0.7);
return;
}

View File

@ -505,7 +505,7 @@ namespace hex::ui {
m_frameStartSelectionRegion = selection;
if (m_provider == nullptr || m_provider->getActualSize() == 0) {
ImGuiExt::TextFormattedCentered("{}", "hex.ui.hex_editor.no_bytes"_lang);
ImGuiExt::TextOverlay("hex.ui.hex_editor.no_bytes"_lang, ImGui::GetWindowPos() + ImGui::GetWindowSize() / 2, ImGui::GetWindowWidth() * 0.7);
}
if (!m_editingAddress.has_value() && ImGui::IsKeyPressed(ImGuiKey_Escape))