mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 17:16:04 +00:00
UI/AppKit: Support image cursors
This commit is contained in:
parent
e0b5e742de
commit
fc4a2eeba8
Notes:
github-actions[bot]
2025-02-28 12:51:08 +00:00
Author: https://github.com/AtkinsSJ
Commit: fc4a2eeba8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3644
1 changed files with 81 additions and 80 deletions
|
@ -450,14 +450,14 @@ static void copy_data_to_clipboard(StringView data, NSPasteboardType pasteboard_
|
|||
if (self == nil) {
|
||||
return;
|
||||
}
|
||||
if (!cursor.template has<Gfx::StandardCursor>()) {
|
||||
// FIXME: Implement image cursors in AppKit.
|
||||
[[NSCursor arrowCursor] set];
|
||||
return;
|
||||
}
|
||||
|
||||
auto standard_cursor = cursor.template get<Gfx::StandardCursor>();
|
||||
cursor.template visit(
|
||||
[](Gfx::ImageCursor const& image_cursor) {
|
||||
auto* cursor_image = Ladybird::gfx_bitmap_to_ns_image(*image_cursor.bitmap.bitmap());
|
||||
auto hotspot = Ladybird::gfx_point_to_ns_point(image_cursor.hotspot);
|
||||
|
||||
[[[NSCursor alloc] initWithImage:cursor_image hotSpot:hotspot] set];
|
||||
},
|
||||
[&self](Gfx::StandardCursor standard_cursor) {
|
||||
if (standard_cursor == Gfx::StandardCursor::Hidden) {
|
||||
if (!m_hidden_cursor.has_value()) {
|
||||
m_hidden_cursor.emplace();
|
||||
|
@ -534,6 +534,7 @@ static void copy_data_to_clipboard(StringView data, NSPasteboardType pasteboard_
|
|||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
m_web_view_bridge->on_zoom_level_changed = [weak_self]() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue