Base+Userland: Add menu item icons
Base+Userland: Add menu item icons This adds missing icons to Presenter Presentation menu. This adds missing icon to Image Viewer View menu. This adds a scale icon for the Image Viewer and Font Editor. This moves the Fit Image to View icon to the 16x16 folder as it's now used by Image Viewer and not only Pixel Paint. This improves the fullscreen and play icons so that they fit together better.
Author: https://github.com/electrikmilk Commit: https://github.com/SerenityOS/serenity/commit/4321a7def1 Pull-request: https://github.com/SerenityOS/serenity/pull/16768 Reviewed-by: https://github.com/kleinesfilmroellchen ✅
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 160 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 200 B |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 153 B |
BIN
Base/res/icons/16x16/scale.png
Normal file
After Width: | Height: | Size: 146 B |
@ -709,6 +709,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
|
||||
TRY(view_menu->try_add_action(*m_show_system_emoji_action));
|
||||
TRY(view_menu->try_add_separator());
|
||||
auto scale_menu = TRY(view_menu->try_add_submenu("&Scale"));
|
||||
scale_menu->set_icon(TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/scale.png"sv)));
|
||||
TRY(scale_menu->try_add_action(*m_scale_five_action));
|
||||
TRY(scale_menu->try_add_action(*m_scale_ten_action));
|
||||
TRY(scale_menu->try_add_action(*m_scale_fifteen_action));
|
||||
|
@ -215,7 +215,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
window);
|
||||
|
||||
auto fit_image_to_view_action = GUI::Action::create(
|
||||
"Fit Image To &View", [&](auto&) {
|
||||
"Fit Image To &View", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/fit-image-to-view.png"sv)), [&](auto&) {
|
||||
widget->fit_content_to_view();
|
||||
});
|
||||
|
||||
@ -314,6 +314,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
TRY(view_menu->try_add_separator());
|
||||
|
||||
auto scaling_mode_menu = TRY(view_menu->try_add_submenu("&Scaling Mode"));
|
||||
scaling_mode_menu->set_icon(TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/scale.png"sv)));
|
||||
|
||||
auto scaling_mode_group = make<GUI::ActionGroup>();
|
||||
scaling_mode_group->set_exclusive(true);
|
||||
|
@ -23,7 +23,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.fit_image_to_view = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/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));
|
||||
|
@ -41,14 +41,14 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
|
||||
TRY(file_menu.try_add_action(about_action));
|
||||
|
||||
auto& presentation_menu = window->add_menu("&Presentation");
|
||||
auto next_slide_action = GUI::Action::create("&Next", { KeyCode::Key_Right }, [this](auto&) {
|
||||
auto next_slide_action = GUI::Action::create("&Next", { KeyCode::Key_Right }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv)), [this](auto&) {
|
||||
if (m_current_presentation) {
|
||||
m_current_presentation->next_frame();
|
||||
outln("Switched forward to slide {} frame {}", m_current_presentation->current_slide_number(), m_current_presentation->current_frame_in_slide_number());
|
||||
update();
|
||||
}
|
||||
});
|
||||
auto previous_slide_action = GUI::Action::create("&Previous", { KeyCode::Key_Left }, [this](auto&) {
|
||||
auto previous_slide_action = GUI::Action::create("&Previous", { KeyCode::Key_Left }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png"sv)), [this](auto&) {
|
||||
if (m_current_presentation) {
|
||||
m_current_presentation->previous_frame();
|
||||
outln("Switched backward to slide {} frame {}", m_current_presentation->current_slide_number(), m_current_presentation->current_frame_in_slide_number());
|
||||
@ -60,10 +60,10 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
|
||||
m_next_slide_action = next_slide_action;
|
||||
m_previous_slide_action = previous_slide_action;
|
||||
|
||||
TRY(presentation_menu.try_add_action(GUI::Action::create("&Full Screen", { KeyModifier::Mod_Shift, KeyCode::Key_F5 }, { KeyCode::Key_F11 }, [this](auto&) {
|
||||
TRY(presentation_menu.try_add_action(GUI::Action::create("&Full Screen", { KeyModifier::Mod_Shift, KeyCode::Key_F5 }, { KeyCode::Key_F11 }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/fullscreen.png"sv)), [this](auto&) {
|
||||
this->window()->set_fullscreen(true);
|
||||
})));
|
||||
TRY(presentation_menu.try_add_action(GUI::Action::create("Present From First &Slide", { KeyCode::Key_F5 }, [this](auto&) {
|
||||
TRY(presentation_menu.try_add_action(GUI::Action::create("Present From First &Slide", { KeyCode::Key_F5 }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/play.png"sv)), [this](auto&) {
|
||||
if (m_current_presentation)
|
||||
m_current_presentation->go_to_first_slide();
|
||||
this->window()->set_fullscreen(true);
|
||||
|