INSTINCT Code Coverage Report


Directory: src/
File: internal/gui/widgets/HelpMarker.cpp
Date: 2025-02-07 16:54:41
Exec Total Coverage
Lines: 0 21 0.0%
Functions: 0 3 0.0%
Branches: 0 8 0.0%

Line Branch Exec Source
1 // This file is part of INSTINCT, the INS Toolkit for Integrated
2 // Navigation Concepts and Training by the Institute of Navigation of
3 // the University of Stuttgart, Germany.
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9 #include "HelpMarker.hpp"
10
11 #include "imgui.h"
12 #include <imgui_internal.h>
13
14 void NAV::gui::widgets::HelpMarker(const char* desc, const char* symbol) // NOLINT(clang-diagnostic-unused-function)
15 {
16 ImGui::TextDisabled("%s", symbol);
17
18 if (ImGui::IsItemHovered())
19 {
20 ImGui::BeginTooltip();
21 ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0F);
22 ImGui::TextUnformatted(desc);
23 ImGui::PopTextWrapPos();
24 ImGui::EndTooltip();
25 }
26 }
27
28 bool NAV::gui::widgets::BeginHelpMarker(const char* symbol, float textWrapLength)
29 {
30 ImGui::TextDisabled("%s", symbol);
31
32 if (ImGui::IsItemHovered())
33 {
34 ImGui::BeginTooltip();
35 if (textWrapLength > 0.0F)
36 {
37 ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0F);
38 }
39 return true;
40 }
41 return false;
42 }
43
44 void NAV::gui::widgets::EndHelpMarker(bool wrapText)
45 {
46 if (wrapText) { ImGui::PopTextWrapPos(); }
47 ImGui::EndTooltip();
48 }
49