mirror of https://github.com/WerWolv/ImHex
impr: Draw settings tooltips under the setting value
This commit is contained in:
parent
3cf7622707
commit
a27b10f69a
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue