diff options
author | electrikmilk <brandonjordan124@gmail.com> | 2022-02-12 19:08:48 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-13 10:18:37 +0100 |
commit | 8c32b42bdfe9dba55b97733dfd42dd121e42fec5 (patch) | |
tree | a8c1ff94d92c1ab2e555824344da0fd8e3df4097 /Userland/Applications/PixelPaint | |
parent | dc5675ef2206c0a8e992652c06cb27ec1dcb3b1e (diff) | |
download | serenity-8c32b42bdfe9dba55b97733dfd42dd121e42fec5.zip |
Base+PixelPaint: Add more icons
Diffstat (limited to 'Userland/Applications/PixelPaint')
-rw-r--r-- | Userland/Applications/PixelPaint/IconBag.cpp | 7 | ||||
-rw-r--r-- | Userland/Applications/PixelPaint/IconBag.h | 7 | ||||
-rw-r--r-- | Userland/Applications/PixelPaint/MainWidget.cpp | 14 |
3 files changed, 21 insertions, 7 deletions
diff --git a/Userland/Applications/PixelPaint/IconBag.cpp b/Userland/Applications/PixelPaint/IconBag.cpp index 88017b99e0..bbd1a2ab60 100644 --- a/Userland/Applications/PixelPaint/IconBag.cpp +++ b/Userland/Applications/PixelPaint/IconBag.cpp @@ -15,12 +15,18 @@ ErrorOr<IconBag> IconBag::try_create() icon_bag.filetype_pixelpaint = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-pixelpaint.png")); icon_bag.new_clipboard = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/new-clipboard.png")); icon_bag.file_export = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/file-export.png")); + icon_bag.close_image = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/close-tab.png")); icon_bag.edit_copy = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png")); icon_bag.clear_selection = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/clear-selection.png")); icon_bag.swap_colors = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/swap-colors.png")); icon_bag.default_colors = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/default-colors.png")); + icon_bag.load_color_palette = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/load-color-palette.png")); + icon_bag.save_color_palette = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/save-color-palette.png")); + icon_bag.add_guide = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/add-guide.png")); + icon_bag.clear_guides = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/clear-guides.png")); icon_bag.edit_flip_vertical = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-flip-vertical.png")); icon_bag.edit_flip_horizontal = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-flip-horizontal.png")); + icon_bag.crop = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/crop.png")); icon_bag.new_layer = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new-layer.png")); icon_bag.previous_layer = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/previous-layer.png")); icon_bag.next_layer = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/next-layer.png")); @@ -29,6 +35,7 @@ ErrorOr<IconBag> IconBag::try_create() icon_bag.active_layer_up = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/active-layer-up.png")); icon_bag.active_layer_down = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/active-layer-down.png")); icon_bag.delete_layer = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/delete.png")); + icon_bag.merge_visible = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/merge-visible.png")); icon_bag.filter = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/filter.png")); return icon_bag; diff --git a/Userland/Applications/PixelPaint/IconBag.h b/Userland/Applications/PixelPaint/IconBag.h index eab3879073..0eaf124422 100644 --- a/Userland/Applications/PixelPaint/IconBag.h +++ b/Userland/Applications/PixelPaint/IconBag.h @@ -16,12 +16,18 @@ struct IconBag final { RefPtr<Gfx::Bitmap> filetype_pixelpaint { nullptr }; RefPtr<Gfx::Bitmap> new_clipboard { nullptr }; RefPtr<Gfx::Bitmap> file_export { nullptr }; + RefPtr<Gfx::Bitmap> close_image { nullptr }; RefPtr<Gfx::Bitmap> edit_copy { nullptr }; RefPtr<Gfx::Bitmap> clear_selection { nullptr }; RefPtr<Gfx::Bitmap> swap_colors { nullptr }; RefPtr<Gfx::Bitmap> default_colors { nullptr }; + RefPtr<Gfx::Bitmap> load_color_palette { nullptr }; + RefPtr<Gfx::Bitmap> save_color_palette { nullptr }; + RefPtr<Gfx::Bitmap> add_guide { nullptr }; + RefPtr<Gfx::Bitmap> clear_guides { nullptr }; RefPtr<Gfx::Bitmap> edit_flip_vertical { nullptr }; RefPtr<Gfx::Bitmap> edit_flip_horizontal { nullptr }; + RefPtr<Gfx::Bitmap> crop { nullptr }; RefPtr<Gfx::Bitmap> new_layer { nullptr }; RefPtr<Gfx::Bitmap> previous_layer { nullptr }; RefPtr<Gfx::Bitmap> next_layer { nullptr }; @@ -30,6 +36,7 @@ struct IconBag final { RefPtr<Gfx::Bitmap> active_layer_up { nullptr }; RefPtr<Gfx::Bitmap> active_layer_down { nullptr }; RefPtr<Gfx::Bitmap> delete_layer { nullptr }; + RefPtr<Gfx::Bitmap> merge_visible { nullptr }; RefPtr<Gfx::Bitmap> filter { nullptr }; }; } diff --git a/Userland/Applications/PixelPaint/MainWidget.cpp b/Userland/Applications/PixelPaint/MainWidget.cpp index d1509c0326..e1c99f85ec 100644 --- a/Userland/Applications/PixelPaint/MainWidget.cpp +++ b/Userland/Applications/PixelPaint/MainWidget.cpp @@ -191,7 +191,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) file_menu.add_separator(); - m_close_image_action = GUI::Action::create("&Close Image", { Mod_Ctrl, Key_W }, [&](auto&) { + m_close_image_action = GUI::Action::create("&Close Image", { Mod_Ctrl, Key_W }, g_icon_bag.close_image, [&](auto&) { auto* active_widget = m_tab_widget->active_widget(); VERIFY(active_widget); m_tab_widget->on_tab_close_click(*active_widget); @@ -305,7 +305,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) editor->set_secondary_color(Color::White); })); m_edit_menu->add_action(GUI::Action::create( - "&Load Color Palette", [&](auto&) { + "&Load Color Palette", g_icon_bag.load_color_palette, [&](auto&) { auto response = FileSystemAccessClient::Client::the().try_open_file(&window, "Load Color Palette"); if (response.is_error()) return; @@ -319,7 +319,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) m_palette_widget->display_color_list(result.value()); })); m_edit_menu->add_action(GUI::Action::create( - "Sa&ve Color Palette", [&](auto&) { + "Sa&ve Color Palette", g_icon_bag.save_color_palette, [&](auto&) { auto response = FileSystemAccessClient::Client::the().try_save_file(&window, "untitled", "palette"); if (response.is_error()) return; @@ -352,7 +352,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) }); m_add_guide_action = GUI::Action::create( - "&Add Guide", [&](auto&) { + "&Add Guide", g_icon_bag.add_guide, [&](auto&) { auto dialog = PixelPaint::EditGuideDialog::construct(&window); if (dialog->exec() != GUI::Dialog::ExecOK) return; @@ -388,7 +388,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) m_view_menu->add_action(*m_show_guides_action); m_view_menu->add_action(GUI::Action::create( - "&Clear Guides", [&](auto&) { + "&Clear Guides", g_icon_bag.clear_guides, [&](auto&) { auto* editor = current_image_editor(); VERIFY(editor); editor->clear_guides(); @@ -462,7 +462,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) })); m_image_menu->add_separator(); m_image_menu->add_action(GUI::Action::create( - "&Crop To Selection", [&](auto&) { + "&Crop To Selection", g_icon_bag.crop, [&](auto&) { auto* editor = current_image_editor(); VERIFY(editor); // FIXME: disable this action if there is no selection @@ -584,7 +584,7 @@ void MainWidget::initialize_menubar(GUI::Window& window) })); m_layer_menu->add_action(GUI::Action::create( - "&Merge Visible", { Mod_Ctrl, Key_M }, [&](auto&) { + "&Merge Visible", { Mod_Ctrl, Key_M }, g_icon_bag.merge_visible, [&](auto&) { auto* editor = current_image_editor(); VERIFY(editor); editor->image().merge_visible_layers(); |