impr: Draw settings tooltips under the setting value

This commit is contained in:
WerWolv 2025-08-05 22:20:06 +02:00
parent 3cf7622707
commit a27b10f69a
1 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,6 @@
#include "content/views/view_settings.hpp"
#include <fonts/fonts.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/api/events/requests_gui.hpp>
#include <hex/helpers/logger.hpp>
@ -108,8 +109,16 @@ namespace hex::plugin::builtin {
ImGui::PopItemWidth();
ImGui::EndDisabled();
if (const auto &tooltip = setting.widget->getTooltip(); tooltip.has_value() && ImGui::IsItemHovered())
ImGuiExt::InfoTooltip(Lang(tooltip.value()));
if (const auto &tooltip = setting.widget->getTooltip(); tooltip.has_value()) {
ImGui::BeginDisabled();
ImGui::Indent();
fonts::Default().push(0.8F);
ImGuiExt::TextFormattedWrapped(Lang(tooltip.value()));
ImGui::NewLine();
fonts::Default().pop();
ImGui::Unindent();
ImGui::EndDisabled();
}
auto &widget = setting.widget;