mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 16:58:52 +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:
parent
42c95959a8
commit
dcf6726487
Notes:
sideshowbarker
2024-07-19 14:51:44 +09:00
Author: https://github.com/awesomekling
Commit: dcf6726487
13 changed files with 110 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue