fix: More hashes view layout issues

This commit is contained in:
WerWolv
2025-08-28 22:29:30 +02:00
parent 9e2c1de0f5
commit 92fa72eac7
5 changed files with 9 additions and 10 deletions

View File

@@ -6,7 +6,7 @@
"hex.hashes.view.hashes.hover_info": "Hover over the Hex Editor selection and hold down SHIFT to view the hashes of that region.",
"hex.hashes.view.hashes.name": "Hashes",
"hex.hashes.view.hashes.no_settings": "No settings available",
"hex.hashes.view.hashes.add": "Add hash",
"hex.hashes.view.hashes.add": "(Double click to add new Hash...)",
"hex.hashes.view.hashes.remove": "Remove hash",
"hex.hashes.view.hashes.hash_name": "Hash Name",
"hex.hashes.view.hashes.table.name": "Name",

View File

@@ -6,7 +6,6 @@
"hex.hashes.view.hashes.hover_info": "Passez la souris sur la sélection de l'éditeur hexadécimal et maintenez la touche MAJ enfoncée pour voir les hachages de cette région.",
"hex.hashes.view.hashes.name": "Hachages",
"hex.hashes.view.hashes.no_settings": "Aucun paramètre disponible",
"hex.hashes.view.hashes.add": "Ajouter un hachage",
"hex.hashes.view.hashes.remove": "Supprimer un hachage",
"hex.hashes.view.hashes.hash_name": "Nom du hachage",
"hex.hashes.view.hashes.table.name": "Nom",

View File

@@ -18,7 +18,6 @@
"hex.hashes.hash.common.xor_out": "XOR wyjścia",
"hex.hashes.hash.sum": "Suma",
"hex.hashes.hash.sum.fold": "Zwiń wynik",
"hex.hashes.view.hashes.add": "Dodaj hash",
"hex.hashes.view.hashes.function": "Funkcja skrótu",
"hex.hashes.view.hashes.hash": "Hash",
"hex.hashes.view.hashes.hash_name": "Nazwa hash",

View File

@@ -27,6 +27,5 @@
"hex.hashes.view.hashes.table.name": "名称",
"hex.hashes.view.hashes.table.result": "结果",
"hex.hashes.view.hashes.table.type": "类型",
"hex.hashes.view.hashes.add": "添加哈希",
"hex.hashes.view.hashes.hash_name": "​​哈希名称​"
}

View File

@@ -182,7 +182,7 @@ namespace hex::plugin::hashes {
if (m_newHashName.empty() && m_selectedHash != nullptr)
m_newHashName = fmt::format("{} {}", Lang(m_selectedHash->getUnlocalizedName()), static_cast<const char *>("hex.hashes.view.hashes.hash"_lang));
if (ImGuiExt::BeginSubWindow("hex.ui.common.settings"_lang, nullptr, scaled({ 0, 250 }))) {
if (ImGuiExt::BeginSubWindow("hex.ui.common.settings"_lang, nullptr, scaled({ 0, 100 }))) {
if (m_selectedHash != nullptr) {
auto startPos = ImGui::GetCursorPosY();
m_selectedHash->draw();
@@ -215,7 +215,7 @@ namespace hex::plugin::hashes {
ImGui::TableSetupColumn("hex.hashes.view.hashes.table.name"_lang);
ImGui::TableSetupColumn("hex.hashes.view.hashes.table.type"_lang);
ImGui::TableSetupColumn("hex.hashes.view.hashes.table.result"_lang, ImGuiTableColumnFlags_WidthStretch);
ImGui::TableSetupColumn("##buttons", ImGuiTableColumnFlags_WidthFixed, 50_scaled);
ImGui::TableSetupColumn("##buttons", ImGuiTableColumnFlags_WidthFixed, ImGui::GetTextLineHeight() * 2);
ImGui::TableHeadersRow();
@@ -226,7 +226,7 @@ namespace hex::plugin::hashes {
for (u32 i = 0; i < m_hashFunctions->size(); i++) {
auto &function = (*m_hashFunctions)[i];
ImGui::PushID(i);
ImGui::PushID(i + 1);
ImGui::TableNextRow();
ImGui::TableNextColumn();
@@ -248,14 +248,15 @@ namespace hex::plugin::hashes {
} catch (const std::exception &e) {
result = e.what();
}
}
else
} else {
result = "???";
}
ImGuiExt::TextFormattedSelectable("{}", result);
ImGui::TableNextColumn();
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
if (ImGuiExt::DimmedIconButton(ICON_VS_OPEN_PREVIEW, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
PopupTextHash::open(function);
}
@@ -263,6 +264,7 @@ namespace hex::plugin::hashes {
if (ImGuiExt::DimmedIconButton(ICON_VS_CHROME_CLOSE, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
indexToRemove = i;
}
ImGui::PopStyleVar();
ImGui::PopID();
}
@@ -289,7 +291,7 @@ namespace hex::plugin::hashes {
{
ImGui::PushClipRect(ImGui::GetWindowPos(), ImGui::GetWindowPos() + ImGui::GetWindowSize(), false);
const auto text = "(Double click to add new Hash...)";
const auto text = "hex.hashes.view.hashes.add"_lang;
const auto textSize = ImGui::CalcTextSize(text);
ImGui::SetCursorPosX((ImGui::GetWindowSize().x - textSize.x) / 2);
ImGuiExt::TextFormattedDisabled(text);