mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 01:41:59 -05:00
WindowServer+LibGfx: Add Gfx::StandardCursor::Hidden cursor
This commit is contained in:
parent
328915a279
commit
fb5ea8a212
6 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,7 @@ Height=768
|
|||
Name=Default
|
||||
|
||||
[Cursor]
|
||||
Hidden=/res/cursors/hidden.png
|
||||
Arrow=/res/cursors/arrow.png
|
||||
ResizeH=/res/cursors/resize-horizontal.png
|
||||
ResizeV=/res/cursors/resize-vertical.png
|
||||
|
|
BIN
Base/res/cursors/hidden.png
Normal file
BIN
Base/res/cursors/hidden.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 128 B |
|
@ -30,6 +30,7 @@ namespace Gfx {
|
|||
|
||||
enum class StandardCursor {
|
||||
None = 0,
|
||||
Hidden,
|
||||
Arrow,
|
||||
Crosshair,
|
||||
IBeam,
|
||||
|
|
|
@ -54,6 +54,8 @@ RefPtr<Cursor> Cursor::create(Gfx::StandardCursor standard_cursor)
|
|||
switch (standard_cursor) {
|
||||
case Gfx::StandardCursor::None:
|
||||
return nullptr;
|
||||
case Gfx::StandardCursor::Hidden:
|
||||
return WindowManager::the().hidden_cursor();
|
||||
case Gfx::StandardCursor::Arrow:
|
||||
return WindowManager::the().arrow_cursor();
|
||||
case Gfx::StandardCursor::Crosshair:
|
||||
|
|
|
@ -112,6 +112,7 @@ void WindowManager::reload_config(bool set_screen)
|
|||
set_resolution(m_config->read_num_entry("Screen", "Width", 1920), m_config->read_num_entry("Screen", "Height", 1080));
|
||||
}
|
||||
|
||||
m_hidden_cursor = get_cursor("Hidden");
|
||||
m_arrow_cursor = get_cursor("Arrow", { 2, 2 });
|
||||
m_hand_cursor = get_cursor("Hand", { 8, 4 });
|
||||
m_help_cursor = get_cursor("Help", { 1, 1 });
|
||||
|
|
|
@ -123,6 +123,7 @@ public:
|
|||
Gfx::IntRect desktop_rect() const;
|
||||
|
||||
const Cursor& active_cursor() const;
|
||||
const Cursor& hidden_cursor() const { return *m_hidden_cursor; }
|
||||
const Cursor& arrow_cursor() const { return *m_arrow_cursor; }
|
||||
const Cursor& crosshair_cursor() const { return *m_crosshair_cursor; }
|
||||
const Cursor& hand_cursor() const { return *m_hand_cursor; }
|
||||
|
@ -247,6 +248,7 @@ private:
|
|||
|
||||
void do_move_to_front(Window&, bool, bool);
|
||||
|
||||
RefPtr<Cursor> m_hidden_cursor;
|
||||
RefPtr<Cursor> m_arrow_cursor;
|
||||
RefPtr<Cursor> m_hand_cursor;
|
||||
RefPtr<Cursor> m_help_cursor;
|
||||
|
|
Loading…
Reference in a new issue