Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Sources/Overload/OvUI/include/OvUI/Widgets/AWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ namespace OvUI::Widgets
virtual void _Draw_Impl() = 0;

public:
std::string tooltip;
bool enabled = true;
bool disabled = false;
bool lineBreak = true;
Expand Down
8 changes: 8 additions & 0 deletions Sources/Overload/OvUI/src/OvUI/Widgets/AWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ void OvUI::Widgets::AWidget::Draw()

_Draw_Impl();

if (!tooltip.empty())
{
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled))
{
ImGui::SetTooltip(tooltip.c_str());
}
}

if (disabled)
{
ImGui::EndDisabled();
Expand Down