1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:17:35 +00:00

Terminal+LibGUI: Make the terminal cursor blink.

Added a GTimer class to help with this. It's just a simple GObject subclass
that sets up an event loop timer and invokes a callback on timeout.
This commit is contained in:
Andreas Kling 2019-03-30 21:40:27 +01:00
parent 245c4bd7c8
commit 25f28a54a1
5 changed files with 96 additions and 1 deletions

View file

@ -7,6 +7,7 @@
#include <SharedGraphics/Rect.h>
#include <LibGUI/GWidget.h>
#include <LibGUI/GNotifier.h>
#include <LibGUI/GTimer.h>
class Font;
@ -65,6 +66,7 @@ private:
word rows() const { return m_rows; }
Rect glyph_rect(word row, word column);
Rect row_rect(word row);
void update_cursor();
struct Attribute {
Attribute() { reset(); }
@ -154,6 +156,9 @@ private:
float m_opacity { 1 };
bool m_needs_background_fill { true };
bool m_cursor_blink_state { true };
int m_glyph_width { 0 };
GTimer m_cursor_blink_timer;
};