Base+PixelPaint: Add more icons

This commit is contained in:
electrikmilk 2022-02-12 19:08:48 -05:00 committed by Andreas Kling
parent dc5675ef22
commit 8c32b42bdf
Notes: sideshowbarker 2024-07-17 18:56:40 +09:00
25 changed files with 21 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 B

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -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;

View file

@ -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 };
};
}

View file

@ -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();