summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorelectrikmilk <brandonjordan124@gmail.com>2022-08-23 19:26:06 -0400
committerAndreas Kling <kling@serenityos.org>2022-08-24 12:01:19 +0200
commit1a9d4ffecfd59ec50d3067243436f41d42344624 (patch)
tree3c8572519549714e3ffa61e18f8bc6ff62df1423 /Userland/Applications
parent07a7d3e136cf1303fd9eec8f23a57c95afe45dc6 (diff)
downloadserenity-1a9d4ffecfd59ec50d3067243436f41d42344624.zip
PixelPaint: Add more icons
This adds menu item icons for Add Mask, Flatten Image, Fit Image To View, and Generic 5x5 Convolution. This modifies the menu item icon for Swap Colors to make the action more obvious and improve accessibility.
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/PixelPaint/IconBag.cpp4
-rw-r--r--Userland/Applications/PixelPaint/IconBag.h4
-rw-r--r--Userland/Applications/PixelPaint/MainWidget.cpp8
3 files changed, 12 insertions, 4 deletions
diff --git a/Userland/Applications/PixelPaint/IconBag.cpp b/Userland/Applications/PixelPaint/IconBag.cpp
index 0cd63b08d4..c896106d30 100644
--- a/Userland/Applications/PixelPaint/IconBag.cpp
+++ b/Userland/Applications/PixelPaint/IconBag.cpp
@@ -22,6 +22,7 @@ ErrorOr<IconBag> IconBag::try_create()
icon_bag.default_colors = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/default-colors.png"sv));
icon_bag.load_color_palette = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/load-color-palette.png"sv));
icon_bag.save_color_palette = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/save-color-palette.png"sv));
+ icon_bag.fit_image_to_view = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/fit-image-to-view.png"sv));
icon_bag.add_guide = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/add-guide.png"sv));
icon_bag.clear_guides = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/clear-guides.png"sv));
icon_bag.edit_flip_vertical = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-flip-vertical.png"sv));
@@ -36,11 +37,14 @@ ErrorOr<IconBag> IconBag::try_create()
icon_bag.active_layer_up = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/active-layer-up.png"sv));
icon_bag.active_layer_down = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/active-layer-down.png"sv));
icon_bag.delete_layer = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/delete.png"sv));
+ icon_bag.flatten_image = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/flatten-image.png"sv));
icon_bag.merge_visible = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/merge-visible.png"sv));
icon_bag.merge_active_layer_up = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/merge-active-layer-up.png"sv));
icon_bag.merge_active_layer_down = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/merge-active-layer-down.png"sv));
icon_bag.filter = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/filter.png"sv));
+ icon_bag.generic_5x5_convolution = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/generic-5x5-convolution.png"sv));
icon_bag.levels = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/levels.png"sv));
+ icon_bag.add_mask = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/add-mask.png"sv));
return icon_bag;
}
diff --git a/Userland/Applications/PixelPaint/IconBag.h b/Userland/Applications/PixelPaint/IconBag.h
index 97e5615464..1f5d6d4e71 100644
--- a/Userland/Applications/PixelPaint/IconBag.h
+++ b/Userland/Applications/PixelPaint/IconBag.h
@@ -23,6 +23,7 @@ struct IconBag final {
RefPtr<Gfx::Bitmap> default_colors { nullptr };
RefPtr<Gfx::Bitmap> load_color_palette { nullptr };
RefPtr<Gfx::Bitmap> save_color_palette { nullptr };
+ RefPtr<Gfx::Bitmap> fit_image_to_view { nullptr };
RefPtr<Gfx::Bitmap> add_guide { nullptr };
RefPtr<Gfx::Bitmap> clear_guides { nullptr };
RefPtr<Gfx::Bitmap> edit_flip_vertical { nullptr };
@@ -37,10 +38,13 @@ 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> flatten_image { nullptr };
RefPtr<Gfx::Bitmap> merge_visible { nullptr };
RefPtr<Gfx::Bitmap> merge_active_layer_up { nullptr };
RefPtr<Gfx::Bitmap> merge_active_layer_down { nullptr };
RefPtr<Gfx::Bitmap> filter { nullptr };
+ RefPtr<Gfx::Bitmap> generic_5x5_convolution { nullptr };
RefPtr<Gfx::Bitmap> levels { nullptr };
+ RefPtr<Gfx::Bitmap> add_mask { nullptr };
};
}
diff --git a/Userland/Applications/PixelPaint/MainWidget.cpp b/Userland/Applications/PixelPaint/MainWidget.cpp
index f3de3a0f3d..0d63b9ed4b 100644
--- a/Userland/Applications/PixelPaint/MainWidget.cpp
+++ b/Userland/Applications/PixelPaint/MainWidget.cpp
@@ -450,7 +450,7 @@ void MainWidget::initialize_menubar(GUI::Window& window)
m_view_menu->add_action(*m_zoom_out_action);
m_view_menu->add_action(*m_reset_zoom_action);
m_view_menu->add_action(GUI::Action::create(
- "Fit Image To &View", [&](auto&) {
+ "Fit Image To &View", g_icon_bag.fit_image_to_view, [&](auto&) {
auto* editor = current_image_editor();
VERIFY(editor);
editor->fit_image_to_view();
@@ -594,7 +594,7 @@ void MainWidget::initialize_menubar(GUI::Window& window)
m_layer_menu->add_separator();
m_layer_menu->add_action(GUI::Action::create(
- "Add M&ask", { Mod_Ctrl | Mod_Shift, Key_M }, nullptr, [&](auto&) {
+ "Add M&ask", { Mod_Ctrl | Mod_Shift, Key_M }, g_icon_bag.add_mask, [&](auto&) {
auto* editor = current_image_editor();
VERIFY(editor);
auto active_layer = editor->active_layer();
@@ -691,7 +691,7 @@ void MainWidget::initialize_menubar(GUI::Window& window)
};
m_layer_menu->add_separator();
m_layer_menu->add_action(GUI::Action::create(
- "Fl&atten Image", { Mod_Ctrl, Key_F }, [&](auto&) {
+ "Fl&atten Image", { Mod_Ctrl, Key_F }, g_icon_bag.flatten_image, [&](auto&) {
auto* editor = current_image_editor();
VERIFY(editor);
editor->image().flatten_all_layers();
@@ -784,7 +784,7 @@ void MainWidget::initialize_menubar(GUI::Window& window)
}));
m_filter_menu->add_separator();
- m_filter_menu->add_action(GUI::Action::create("Generic 5x5 &Convolution", [&](auto&) {
+ m_filter_menu->add_action(GUI::Action::create("Generic 5x5 &Convolution", g_icon_bag.generic_5x5_convolution, [&](auto&) {
auto* editor = current_image_editor();
VERIFY(editor);
if (auto* layer = editor->active_layer()) {