mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
WindowServer: Add support for per-window override cursors.
Use this to implement automatic switching to an I-beam cursor when hovering over a GTextEditor. :^)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <LibGUI/GFontDatabase.h>
|
||||
#include <LibGUI/GClipboard.h>
|
||||
#include <LibGUI/GPainter.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include <Kernel/KeyCode.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <unistd.h>
|
||||
@@ -801,3 +802,15 @@ void GTextEditor::paste()
|
||||
printf("Paste: \"%s\"\n", paste_text.characters());
|
||||
insert_at_cursor_or_replace_selection(paste_text);
|
||||
}
|
||||
|
||||
void GTextEditor::enter_event(GEvent&)
|
||||
{
|
||||
ASSERT(window());
|
||||
window()->set_override_cursor(GStandardCursor::IBeam);
|
||||
}
|
||||
|
||||
void GTextEditor::leave_event(GEvent&)
|
||||
{
|
||||
ASSERT(window());
|
||||
window()->set_override_cursor(GStandardCursor::None);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user