mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Draw settings tooltips under the setting value
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user