Application: use ImGui::BeginTooltip() correctly.

This commit is contained in:
Guillaume Jacquemin 2024-03-10 12:49:02 +01:00
parent cd5213a3f9
commit 387647669f
Signed by: williamjcm
SSH key fingerprint: SHA256:AYLOg+iTV0ElElnlu4vqM4edFazVdRiuQB0Y5LoKc4A
2 changed files with 2 additions and 4 deletions

View file

@ -402,8 +402,7 @@ Application::drawHelpMarker(Containers::StringView text, float wrap_pos) {
void void
Application::drawTooltip(Containers::StringView text, float wrap_pos) { Application::drawTooltip(Containers::StringView text, float wrap_pos) {
if(ImGui::IsItemHovered()){ if(ImGui::IsItemHovered() && ImGui::BeginTooltip()) {
ImGui::BeginTooltip();
if(wrap_pos > 0.0f) { if(wrap_pos > 0.0f) {
ImGui::PushTextWrapPos(wrap_pos); ImGui::PushTextWrapPos(wrap_pos);
} }

View file

@ -267,8 +267,7 @@ Application::drawBackupListPopup() {
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::TextUnformatted(backup.company.cbegin(), backup.company.cend()); ImGui::TextUnformatted(backup.company.cbegin(), backup.company.cend());
if(ImGui::IsItemHovered()) { if(ImGui::IsItemHovered() && ImGui::BeginTooltip()) {
ImGui::BeginTooltip();
for(const auto& file : backup.includedFiles) { for(const auto& file : backup.includedFiles) {
ImGui::TextUnformatted(file.cbegin()); ImGui::TextUnformatted(file.cbegin());
} }