Line data Source code
1 : #pragma once
2 :
3 : #include <imgui.h>
4 : #include <functional>
5 :
6 : namespace Amplitron {
7 :
8 56 : struct LedProps {
9 56 : bool enabled = false;
10 56 : ImVec4 led_color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
11 56 : const char* tooltip = nullptr;
12 :
13 : // Pulse animation options
14 56 : bool blink = false;
15 56 : float blink_time = 0.0f; // time used to calculate blink rate
16 : };
17 :
18 : class LedComponent {
19 : public:
20 : /**
21 : * @brief Render a status LED indicator with glowing outlines.
22 : * @param imgui_id Unique ID for ImGui interactions (tooltip hover area).
23 : * @param props LED state, color, and tooltip.
24 : * @param zoom DPI zoom factor.
25 : * @param center Center coordinate of the LED.
26 : */
27 : static void render(const char* imgui_id, const LedProps& props, float zoom, ImVec2 center);
28 : };
29 :
30 : } // namespace Amplitron
|