feat(chat): implement message expiration after 5 seconds

This commit is contained in:
2026-07-20 10:16:12 +08:00
parent 6d3a0518ed
commit ce10290959
5 changed files with 23 additions and 7 deletions

View File

@@ -33,11 +33,11 @@ public:
private:
static constexpr int MAX_MESSGAES_SUM = 50;
static constexpr float DISAPPEAR_TIME = 5.0f;
struct Line {
std::unique_ptr<Label> label;
uint64_t time;
bool render = false;
bool render = true;
};
int m_lines = 10;
bool m_scale = 1.0f;

View File

@@ -26,7 +26,7 @@ public:
TextField& set_app(App* app);
TextField& set_typing(bool typing, bool finished);
TextField& clear_input();
bool is_typing() const;
bool handle_mouse_move_event(const MouseMoveEvent& e) override;
bool handle_mouse_button_event(const MouseButtonEvent& e) override;
bool handle_text_input_event(const TextInputEvent& e) override;