1
0
mirror of synced 2024-12-01 02:37:18 +01:00

impr: Added "Hold SHIFT for more info" text to provider tooltip (#1171)

As discussed on discord
This commit is contained in:
iTrooz 2023-06-30 22:28:37 +02:00 committed by GitHub
parent 050a71913a
commit aec38328d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 12 deletions

View File

@ -411,6 +411,7 @@
"hex.builtin.popup.save_layout.title": "Save Layout", "hex.builtin.popup.save_layout.title": "Save Layout",
"hex.builtin.popup.save_layout.desc": "Enter a name under which to save the current layout.", "hex.builtin.popup.save_layout.desc": "Enter a name under which to save the current layout.",
"hex.builtin.popup.waiting_for_tasks.desc": "There are still tasks running in the background.\nImHex will close after they are finished.", "hex.builtin.popup.waiting_for_tasks.desc": "There are still tasks running in the background.\nImHex will close after they are finished.",
"hex.builtin.provider.tooltip.show_more": "Hold SHIFT for more information",
"hex.builtin.provider.error.open": "Failed to open provider: {}", "hex.builtin.provider.error.open": "Failed to open provider: {}",
"hex.builtin.provider.disk": "Raw Disk Provider", "hex.builtin.provider.disk": "Raw Disk Provider",
"hex.builtin.provider.disk.disk_size": "Disk Size", "hex.builtin.provider.disk.disk_size": "Disk Size",

View File

@ -250,23 +250,27 @@ namespace hex::plugin::builtin {
ImGui::TextFormatted("{}", tabProvider->getName().c_str()); ImGui::TextFormatted("{}", tabProvider->getName().c_str());
const auto &description = provider->getDataDescription(); const auto &description = provider->getDataDescription();
if (ImGui::GetIO().KeyShift && !description.empty()) { if (!description.empty()) {
ImGui::Separator(); ImGui::Separator();
if (ImGui::GetIO().KeyShift && !description.empty()) {
if (ImGui::BeginTable("information", 2, ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_RowBg | ImGuiTableFlags_NoKeepColumnsVisible, ImVec2(400_scaled, 0))) { if (ImGui::BeginTable("information", 2, ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_RowBg | ImGuiTableFlags_NoKeepColumnsVisible, ImVec2(400_scaled, 0))) {
ImGui::TableSetupColumn("type"); ImGui::TableSetupColumn("type");
ImGui::TableSetupColumn("value", ImGuiTableColumnFlags_WidthStretch); ImGui::TableSetupColumn("value", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableNextRow(); ImGui::TableNextRow();
for (auto &[name, value] : description) { for (auto &[name, value] : description) {
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::TextFormatted("{}", name); ImGui::TextFormatted("{}", name);
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::TextFormattedWrapped("{}", value); ImGui::TextFormattedWrapped("{}", value);
}
ImGui::EndTable();
} }
} else {
ImGui::EndTable(); ImGui::TextFormattedDisabled("hex.builtin.provider.tooltip.show_more"_lang);
} }
} }