hyprlock/src/renderer/widgets/PasswordInputField.hpp

44 lines
1.2 KiB
C++
Raw Normal View History

2024-02-19 00:08:03 +01:00
#pragma once
#include "IWidget.hpp"
#include "../../helpers/Vector2D.hpp"
#include "../../helpers/Color.hpp"
#include <chrono>
#include <vector>
class CPasswordInputField : public IWidget {
public:
2024-02-19 02:22:22 +01:00
CPasswordInputField(const Vector2D& viewport, const Vector2D& size, const CColor& outer, const CColor& inner, int out_thick, bool fade_empty);
2024-02-19 00:08:03 +01:00
virtual bool draw();
private:
void updateDots();
2024-02-19 02:22:22 +01:00
void updateFade();
2024-02-19 00:08:03 +01:00
Vector2D size;
Vector2D pos;
int out_thick;
CColor inner, outer;
struct dot {
size_t idx = 0;
bool appearing = false;
bool animated = false;
float a = 0;
std::chrono::system_clock::time_point start;
};
2024-02-19 02:22:22 +01:00
struct {
std::chrono::system_clock::time_point start;
float a = 0;
bool appearing = true;
bool animated = false;
} fade;
bool fadeOnEmpty;
2024-02-19 00:08:03 +01:00
std::vector<dot> dots;
};