diff options
author | electrikmilk <brandonjordan124@gmail.com> | 2022-01-03 21:00:24 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-01-12 10:55:04 +0100 |
commit | 983c784a8049980a6de5fea16178f72e72c8c6f9 (patch) | |
tree | de31e276ecb84136136acdb39f2897765e40a590 | |
parent | 10e473bf26477b8813ecb23d8dcdc4322fa9c95a (diff) | |
download | serenity-983c784a8049980a6de5fea16178f72e72c8c6f9.zip |
Base+WindowServer: Add icon to window menu move action
-rw-r--r-- | Base/res/icons/16x16/move.png | bin | 0 -> 2985 bytes | |||
-rw-r--r-- | Userland/Services/WindowServer/Window.cpp | 9 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Base/res/icons/16x16/move.png b/Base/res/icons/16x16/move.png Binary files differnew file mode 100644 index 0000000000..6a2f3cd580 --- /dev/null +++ b/Base/res/icons/16x16/move.png diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp index d0eaa7a603..ae1840ffe5 100644 --- a/Userland/Services/WindowServer/Window.cpp +++ b/Userland/Services/WindowServer/Window.cpp @@ -74,6 +74,14 @@ static Gfx::Bitmap& pin_icon() return *s_icon; } +static Gfx::Bitmap& move_icon() +{ + static RefPtr<Gfx::Bitmap> s_icon; + if (!s_icon) + s_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/move.png").release_value_but_fixme_should_propagate_errors(); + return *s_icon; +} + Window::Window(Core::Object& parent, WindowType type) : Core::Object(&parent) , m_type(type) @@ -795,6 +803,7 @@ void Window::ensure_window_menu() auto move_item = make<MenuItem>(*m_window_menu, (unsigned)WindowMenuAction::Move, "&Move"); m_window_menu_move_item = move_item.ptr(); + m_window_menu_move_item->set_icon(&move_icon()); m_window_menu->add_item(move(move_item)); m_window_menu->add_item(make<MenuItem>(*m_window_menu, MenuItem::Type::Separator)); |