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

Cursors: Add new Eyedropper cursor

This can be used immediately in PixelPaint (separate commit), but
I am adding this as a system-wide cursor since it may also be useful
for other applications that want to use it.
This commit is contained in:
Mustafa Quraish 2021-08-31 22:16:53 -04:00 committed by Andreas Kling
parent 81326ac8c7
commit 30ce1d8562
8 changed files with 8 additions and 0 deletions

View file

@ -15,3 +15,4 @@ Help=help.x1y1.png
Drag=drag.png Drag=drag.png
Wait=wait.f14t100.png Wait=wait.f14t100.png
Crosshair=crosshair.png Crosshair=crosshair.png
Eyedropper=eyedropper.x2y2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

View file

@ -15,3 +15,4 @@ Help=help.x1y1.png
Drag=drag.png Drag=drag.png
Wait=wait.f14t100.png Wait=wait.f14t100.png
Crosshair=crosshair.png Crosshair=crosshair.png
Eyedropper=eyedropper.x2y2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

View file

@ -26,6 +26,7 @@ enum class StandardCursor {
Move, Move,
Wait, Wait,
Disallowed, Disallowed,
Eyedropper,
__Count, __Count,
}; };

View file

@ -109,6 +109,8 @@ RefPtr<Cursor> Cursor::create(Gfx::StandardCursor standard_cursor)
return WindowManager::the().wait_cursor(); return WindowManager::the().wait_cursor();
case Gfx::StandardCursor::Disallowed: case Gfx::StandardCursor::Disallowed:
return WindowManager::the().disallowed_cursor(); return WindowManager::the().disallowed_cursor();
case Gfx::StandardCursor::Eyedropper:
return WindowManager::the().eyedropper_cursor();
default: default:
VERIFY_NOT_REACHED(); VERIFY_NOT_REACHED();
} }

View file

@ -2080,6 +2080,7 @@ void WindowManager::apply_cursor_theme(const String& theme_name)
reload_cursor(m_drag_cursor, "Drag"); reload_cursor(m_drag_cursor, "Drag");
reload_cursor(m_wait_cursor, "Wait"); reload_cursor(m_wait_cursor, "Wait");
reload_cursor(m_crosshair_cursor, "Crosshair"); reload_cursor(m_crosshair_cursor, "Crosshair");
reload_cursor(m_eyedropper_cursor, "Eyedropper");
Compositor::the().invalidate_cursor(); Compositor::the().invalidate_cursor();
m_config->write_entry("Mouse", "CursorTheme", theme_name); m_config->write_entry("Mouse", "CursorTheme", theme_name);

View file

@ -150,6 +150,7 @@ public:
Cursor const& move_cursor() const { return *m_move_cursor; } Cursor const& move_cursor() const { return *m_move_cursor; }
Cursor const& drag_cursor() const { return *m_drag_cursor; } Cursor const& drag_cursor() const { return *m_drag_cursor; }
Cursor const& wait_cursor() const { return *m_wait_cursor; } Cursor const& wait_cursor() const { return *m_wait_cursor; }
Cursor const& eyedropper_cursor() const { return *m_eyedropper_cursor; }
Gfx::Font const& font() const; Gfx::Font const& font() const;
Gfx::Font const& window_title_font() const; Gfx::Font const& window_title_font() const;
@ -364,6 +365,7 @@ private:
RefPtr<Cursor> m_drag_cursor; RefPtr<Cursor> m_drag_cursor;
RefPtr<Cursor> m_wait_cursor; RefPtr<Cursor> m_wait_cursor;
RefPtr<Cursor> m_crosshair_cursor; RefPtr<Cursor> m_crosshair_cursor;
RefPtr<Cursor> m_eyedropper_cursor;
RefPtr<MultiScaleBitmaps> m_overlay_rect_shadow; RefPtr<MultiScaleBitmaps> m_overlay_rect_shadow;