mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:07:46 +00:00
LibGfx: Remove try_
prefix from bitmap creation functions
Those don't have any non-try counterpart, so we might as well just omit it.
This commit is contained in:
parent
1971bff314
commit
82a152b696
186 changed files with 598 additions and 598 deletions
|
@ -58,7 +58,7 @@ private:
|
|||
{
|
||||
constexpr u16 RENDER_WIDTH = 640;
|
||||
constexpr u16 RENDER_HEIGHT = 480;
|
||||
m_bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, { RENDER_WIDTH, RENDER_HEIGHT }).release_value_but_fixme_should_propagate_errors();
|
||||
m_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { RENDER_WIDTH, RENDER_HEIGHT }).release_value_but_fixme_should_propagate_errors();
|
||||
m_context = MUST(GL::create_context(*m_bitmap));
|
||||
|
||||
start_timer(20);
|
||||
|
@ -335,14 +335,14 @@ bool GLContextWidget::load_file(Core::File& file)
|
|||
// Attempt to open the texture file from disk
|
||||
RefPtr<Gfx::Bitmap> texture_image;
|
||||
if (Core::File::exists(texture_path)) {
|
||||
auto bitmap_or_error = Gfx::Bitmap::try_load_from_file(texture_path);
|
||||
auto bitmap_or_error = Gfx::Bitmap::load_from_file(texture_path);
|
||||
if (!bitmap_or_error.is_error())
|
||||
texture_image = bitmap_or_error.release_value_but_fixme_should_propagate_errors();
|
||||
} else {
|
||||
auto response = FileSystemAccessClient::Client::the().try_request_file_deprecated(window(), builder.string_view(), Core::OpenMode::ReadOnly);
|
||||
if (!response.is_error()) {
|
||||
auto texture_file = response.value();
|
||||
auto bitmap_or_error = Gfx::Bitmap::try_load_from_fd_and_close(texture_file->leak_fd(), texture_file->filename());
|
||||
auto bitmap_or_error = Gfx::Bitmap::load_from_fd_and_close(texture_file->leak_fd(), texture_file->filename());
|
||||
if (!bitmap_or_error.is_error())
|
||||
texture_image = bitmap_or_error.release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
|
|
@ -58,13 +58,13 @@ class ResultRow final : public GUI::Button {
|
|||
m_context_menu = GUI::Menu::construct();
|
||||
|
||||
if (LexicalPath path { text() }; path.is_absolute()) {
|
||||
m_context_menu->add_action(GUI::Action::create("&Show in File Manager", MUST(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-file-manager.png"sv)), [=](auto&) {
|
||||
m_context_menu->add_action(GUI::Action::create("&Show in File Manager", MUST(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-file-manager.png"sv)), [=](auto&) {
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme(path.dirname(), path.basename()));
|
||||
}));
|
||||
m_context_menu->add_separator();
|
||||
}
|
||||
|
||||
m_context_menu->add_action(GUI::Action::create("&Copy as Text", MUST(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png"sv)), [&](auto&) {
|
||||
m_context_menu->add_action(GUI::Action::create("&Copy as Text", MUST(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"sv)), [&](auto&) {
|
||||
GUI::Clipboard::the().set_plain_text(text());
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ BookmarksBarWidget::BookmarksBarWidget(DeprecatedString const& bookmarks_file, b
|
|||
m_additional = GUI::Button::construct();
|
||||
m_additional->set_tooltip("Show hidden bookmarks");
|
||||
m_additional->set_menu(m_additional_menu);
|
||||
auto bitmap_or_error = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/overflow-menu.png"sv);
|
||||
auto bitmap_or_error = Gfx::Bitmap::load_from_file("/res/icons/16x16/overflow-menu.png"sv);
|
||||
if (!bitmap_or_error.is_error())
|
||||
m_additional->set_icon(bitmap_or_error.release_value());
|
||||
m_additional->set_button_style(Gfx::ButtonStyle::Coolbar);
|
||||
|
|
|
@ -355,7 +355,7 @@ void BrowserWindow::build_menus()
|
|||
}
|
||||
|
||||
settings_menu.add_separator();
|
||||
auto open_settings_action = GUI::Action::create("Browser &Settings", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/settings.png"sv).release_value_but_fixme_should_propagate_errors(),
|
||||
auto open_settings_action = GUI::Action::create("Browser &Settings", Gfx::Bitmap::load_from_file("/res/icons/16x16/settings.png"sv).release_value_but_fixme_should_propagate_errors(),
|
||||
[this](auto&) {
|
||||
GUI::Process::spawn_or_show_error(this, "/bin/BrowserSettings"sv);
|
||||
});
|
||||
|
|
|
@ -12,37 +12,37 @@ ErrorOr<IconBag> IconBag::try_create()
|
|||
{
|
||||
IconBag icon_bag;
|
||||
|
||||
icon_bag.filetype_html = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-html.png"sv));
|
||||
icon_bag.filetype_text = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-text.png"sv));
|
||||
icon_bag.filetype_javascript = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-javascript.png"sv));
|
||||
icon_bag.filetype_image = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-image.png"sv));
|
||||
icon_bag.bookmark_contour = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/bookmark-contour.png"sv));
|
||||
icon_bag.bookmark_filled = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/bookmark-filled.png"sv));
|
||||
icon_bag.inspector_object = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object.png"sv));
|
||||
icon_bag.go_home = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-home.png"sv));
|
||||
icon_bag.find = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find.png"sv));
|
||||
icon_bag.color_chooser = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/color-chooser.png"sv));
|
||||
icon_bag.delete_icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/delete.png"sv));
|
||||
icon_bag.new_tab = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new-tab.png"sv));
|
||||
icon_bag.duplicate_tab = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/duplicate-tab.png"sv));
|
||||
icon_bag.close_other_tabs = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/close-other-tabs.png"sv));
|
||||
icon_bag.new_window = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new-window.png"sv));
|
||||
icon_bag.code = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/code.png"sv));
|
||||
icon_bag.dom_tree = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/browser/dom-tree.png"sv));
|
||||
icon_bag.layout = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/layout.png"sv));
|
||||
icon_bag.layers = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/layers.png"sv));
|
||||
icon_bag.filetype_css = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-css.png"sv));
|
||||
icon_bag.inspect = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspect.png"sv));
|
||||
icon_bag.history = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/history.png"sv));
|
||||
icon_bag.cookie = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/browser/cookie.png"sv));
|
||||
icon_bag.local_storage = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/browser/local-storage.png"sv));
|
||||
icon_bag.trash_can = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/trash-can.png"sv));
|
||||
icon_bag.clear_cache = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/browser/clear-cache.png"sv));
|
||||
icon_bag.spoof = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/spoof.png"sv));
|
||||
icon_bag.go_to = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv));
|
||||
icon_bag.download = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/download.png"sv));
|
||||
icon_bag.copy = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png"sv));
|
||||
icon_bag.rename = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/rename.png"sv));
|
||||
icon_bag.filetype_html = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png"sv));
|
||||
icon_bag.filetype_text = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-text.png"sv));
|
||||
icon_bag.filetype_javascript = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-javascript.png"sv));
|
||||
icon_bag.filetype_image = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-image.png"sv));
|
||||
icon_bag.bookmark_contour = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/bookmark-contour.png"sv));
|
||||
icon_bag.bookmark_filled = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/bookmark-filled.png"sv));
|
||||
icon_bag.inspector_object = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/inspector-object.png"sv));
|
||||
icon_bag.go_home = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-home.png"sv));
|
||||
icon_bag.find = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv));
|
||||
icon_bag.color_chooser = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/color-chooser.png"sv));
|
||||
icon_bag.delete_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/delete.png"sv));
|
||||
icon_bag.new_tab = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/new-tab.png"sv));
|
||||
icon_bag.duplicate_tab = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/duplicate-tab.png"sv));
|
||||
icon_bag.close_other_tabs = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/close-other-tabs.png"sv));
|
||||
icon_bag.new_window = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/new-window.png"sv));
|
||||
icon_bag.code = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/code.png"sv));
|
||||
icon_bag.dom_tree = TRY(Gfx::Bitmap::load_from_file("/res/icons/browser/dom-tree.png"sv));
|
||||
icon_bag.layout = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/layout.png"sv));
|
||||
icon_bag.layers = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/layers.png"sv));
|
||||
icon_bag.filetype_css = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-css.png"sv));
|
||||
icon_bag.inspect = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/inspect.png"sv));
|
||||
icon_bag.history = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/history.png"sv));
|
||||
icon_bag.cookie = TRY(Gfx::Bitmap::load_from_file("/res/icons/browser/cookie.png"sv));
|
||||
icon_bag.local_storage = TRY(Gfx::Bitmap::load_from_file("/res/icons/browser/local-storage.png"sv));
|
||||
icon_bag.trash_can = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/trash-can.png"sv));
|
||||
icon_bag.clear_cache = TRY(Gfx::Bitmap::load_from_file("/res/icons/browser/clear-cache.png"sv));
|
||||
icon_bag.spoof = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/spoof.png"sv));
|
||||
icon_bag.go_to = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv));
|
||||
icon_bag.download = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/download.png"sv));
|
||||
icon_bag.copy = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"sv));
|
||||
icon_bag.rename = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/rename.png"sv));
|
||||
|
||||
return icon_bag;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ StorageWidget::StorageWidget()
|
|||
m_cookies_table_view->set_alternating_row_colors(true);
|
||||
|
||||
auto delete_cookie_action = GUI::Action::create(
|
||||
"&Delete Cookie", { Key_Delete }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/delete.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto const&) {
|
||||
"&Delete Cookie", { Key_Delete }, Gfx::Bitmap::load_from_file("/res/icons/16x16/delete.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto const&) {
|
||||
auto cookie_index = m_cookies_table_view->selection().first();
|
||||
delete_cookie(m_cookies_model->take_cookie(cookie_index));
|
||||
},
|
||||
|
|
|
@ -61,13 +61,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto& constants_menu = window->add_menu("&Constants");
|
||||
auto const power = Crypto::NumberTheory::Power("10"_bigint, "10"_bigint);
|
||||
|
||||
constants_menu.add_action(GUI::Action::create("&Pi", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/calculator/pi.png"sv)), [&](auto&) {
|
||||
constants_menu.add_action(GUI::Action::create("&Pi", TRY(Gfx::Bitmap::load_from_file("/res/icons/calculator/pi.png"sv)), [&](auto&) {
|
||||
widget->set_entry(Crypto::BigFraction { Crypto::SignedBigInteger(31415926535), power });
|
||||
}));
|
||||
constants_menu.add_action(GUI::Action::create("&Euler's Number", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/calculator/eulers_number.png"sv)), [&](auto&) {
|
||||
constants_menu.add_action(GUI::Action::create("&Euler's Number", TRY(Gfx::Bitmap::load_from_file("/res/icons/calculator/eulers_number.png"sv)), [&](auto&) {
|
||||
widget->set_entry(Crypto::BigFraction { Crypto::SignedBigInteger(27182818284), power });
|
||||
}));
|
||||
constants_menu.add_action(GUI::Action::create("&Phi", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/calculator/phi.png"sv)), [&](auto&) {
|
||||
constants_menu.add_action(GUI::Action::create("&Phi", TRY(Gfx::Bitmap::load_from_file("/res/icons/calculator/phi.png"sv)), [&](auto&) {
|
||||
widget->set_entry(Crypto::BigFraction { Crypto::SignedBigInteger(16180339887), power });
|
||||
}));
|
||||
|
||||
|
@ -102,7 +102,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
widget->set_rounding_custom(round_custom, format);
|
||||
|
||||
auto shrink_action = GUI::Action::create("&Shrink...", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-cut.png"sv)), [&](auto&) {
|
||||
auto shrink_action = GUI::Action::create("&Shrink...", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-cut.png"sv)), [&](auto&) {
|
||||
unsigned shrink_length = widget->rounding_length();
|
||||
|
||||
if (RoundingDialog::show(window, "Choose shrinking length"sv, shrink_length) == GUI::Dialog::ExecResult::OK) {
|
||||
|
|
|
@ -48,7 +48,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto toolbar = main_widget->find_descendant_of_type_named<GUI::Toolbar>("toolbar");
|
||||
auto calendar = main_widget->find_descendant_of_type_named<GUI::Calendar>("calendar");
|
||||
|
||||
auto prev_date_action = GUI::Action::create({}, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png"sv)), [&](const GUI::Action&) {
|
||||
auto prev_date_action = GUI::Action::create({}, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv)), [&](const GUI::Action&) {
|
||||
unsigned view_month = calendar->view_month();
|
||||
unsigned view_year = calendar->view_year();
|
||||
if (calendar->mode() == GUI::Calendar::Month) {
|
||||
|
@ -63,7 +63,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
calendar->update_tiles(view_year, view_month);
|
||||
});
|
||||
|
||||
auto next_date_action = GUI::Action::create({}, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv)), [&](const GUI::Action&) {
|
||||
auto next_date_action = GUI::Action::create({}, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv)), [&](const GUI::Action&) {
|
||||
unsigned view_month = calendar->view_month();
|
||||
unsigned view_year = calendar->view_year();
|
||||
if (calendar->mode() == GUI::Calendar::Month) {
|
||||
|
@ -78,22 +78,22 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
calendar->update_tiles(view_year, view_month);
|
||||
});
|
||||
|
||||
auto add_event_action = GUI::Action::create("&Add Event", {}, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/add-event.png"sv)), [&](const GUI::Action&) {
|
||||
auto add_event_action = GUI::Action::create("&Add Event", {}, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/add-event.png"sv)), [&](const GUI::Action&) {
|
||||
AddEventDialog::show(calendar->selected_date(), window);
|
||||
});
|
||||
|
||||
auto jump_to_action = GUI::Action::create("Jump to &Today", {}, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/calendar-date.png"sv)), [&](const GUI::Action&) {
|
||||
auto jump_to_action = GUI::Action::create("Jump to &Today", {}, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/calendar-date.png"sv)), [&](const GUI::Action&) {
|
||||
calendar->set_selected_date(Core::DateTime::now());
|
||||
calendar->update_tiles(Core::DateTime::now().year(), Core::DateTime::now().month());
|
||||
});
|
||||
|
||||
auto view_month_action = GUI::Action::create_checkable("&Month View", { Mod_Ctrl, KeyCode::Key_1 }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/calendar-month-view.png"sv)), [&](const GUI::Action&) {
|
||||
auto view_month_action = GUI::Action::create_checkable("&Month View", { Mod_Ctrl, KeyCode::Key_1 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/calendar-month-view.png"sv)), [&](const GUI::Action&) {
|
||||
if (calendar->mode() == GUI::Calendar::Year)
|
||||
calendar->toggle_mode();
|
||||
});
|
||||
view_month_action->set_checked(true);
|
||||
|
||||
auto view_year_action = GUI::Action::create_checkable("&Year View", { Mod_Ctrl, KeyCode::Key_2 }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/icon-view.png"sv)), [&](const GUI::Action&) {
|
||||
auto view_year_action = GUI::Action::create_checkable("&Year View", { Mod_Ctrl, KeyCode::Key_2 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/icon-view.png"sv)), [&](const GUI::Action&) {
|
||||
if (calendar->mode() == GUI::Calendar::Month)
|
||||
calendar->toggle_mode();
|
||||
});
|
||||
|
@ -106,7 +106,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (default_view == "Year")
|
||||
view_year_action->set_checked(true);
|
||||
|
||||
auto open_settings_action = GUI::Action::create("&Settings", {}, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-settings.png"sv)), [&](GUI::Action const&) {
|
||||
auto open_settings_action = GUI::Action::create("&Settings", {}, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-settings.png"sv)), [&](GUI::Action const&) {
|
||||
GUI::Process::spawn_or_show_error(window, "/bin/CalendarSettings"sv);
|
||||
});
|
||||
|
||||
|
@ -129,7 +129,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
};
|
||||
|
||||
auto& file_menu = window->add_menu("&File");
|
||||
file_menu.add_action(GUI::Action::create("&Add Event", { Mod_Ctrl | Mod_Shift, Key_E }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/add-event.png"sv)),
|
||||
file_menu.add_action(GUI::Action::create("&Add Event", { Mod_Ctrl | Mod_Shift, Key_E }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/add-event.png"sv)),
|
||||
[&](const GUI::Action&) {
|
||||
AddEventDialog::show(calendar->selected_date(), window);
|
||||
}));
|
||||
|
|
|
@ -37,7 +37,7 @@ CharacterMapWidget::CharacterMapWidget()
|
|||
m_statusbar = find_descendant_of_type_named<GUI::Statusbar>("statusbar");
|
||||
m_unicode_block_listview = find_descendant_of_type_named<GUI::ListView>("unicode_block_listview");
|
||||
|
||||
m_choose_font_action = GUI::Action::create("Choose Font...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_choose_font_action = GUI::Action::create("Choose Font...", Gfx::Bitmap::load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
auto font_picker = GUI::FontPicker::construct(window(), &font(), false);
|
||||
if (font_picker->exec() == GUI::Dialog::ExecResult::OK) {
|
||||
auto& font = *font_picker->font();
|
||||
|
@ -58,17 +58,17 @@ CharacterMapWidget::CharacterMapWidget()
|
|||
});
|
||||
m_copy_selection_action->set_status_tip("Copy the highlighted characters to the clipboard");
|
||||
|
||||
m_previous_glyph_action = GUI::Action::create("Previous character", { Mod_Alt, Key_Left }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_previous_glyph_action = GUI::Action::create("Previous character", { Mod_Alt, Key_Left }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_glyph_map->select_previous_existing_glyph();
|
||||
});
|
||||
m_previous_glyph_action->set_status_tip("Seek the previous visible glyph");
|
||||
|
||||
m_next_glyph_action = GUI::Action::create("&Next Glyph", { Mod_Alt, Key_Right }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_next_glyph_action = GUI::Action::create("&Next Glyph", { Mod_Alt, Key_Right }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_glyph_map->select_next_existing_glyph();
|
||||
});
|
||||
m_next_glyph_action->set_status_tip("Seek the next visible glyph");
|
||||
|
||||
m_go_to_glyph_action = GUI::Action::create("Go to glyph...", { Mod_Ctrl, Key_G }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_go_to_glyph_action = GUI::Action::create("Go to glyph...", { Mod_Ctrl, Key_G }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
DeprecatedString input;
|
||||
if (GUI::InputBox::show(window(), input, "Hexadecimal:"sv, "Go to glyph"sv) == GUI::InputBox::ExecResult::OK && !input.is_empty()) {
|
||||
auto maybe_code_point = AK::StringUtils::convert_to_uint_from_hex(input);
|
||||
|
@ -83,7 +83,7 @@ CharacterMapWidget::CharacterMapWidget()
|
|||
});
|
||||
m_go_to_glyph_action->set_status_tip("Go to the specified code point");
|
||||
|
||||
m_find_glyphs_action = GUI::Action::create("&Find glyphs...", { Mod_Ctrl, Key_F }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_find_glyphs_action = GUI::Action::create("&Find glyphs...", { Mod_Ctrl, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
if (m_find_window.is_null()) {
|
||||
m_find_window = GUI::Window::construct(window());
|
||||
auto search_widget = m_find_window->set_main_widget<CharacterSearchWidget>().release_value_but_fixme_should_propagate_errors();
|
||||
|
|
|
@ -44,14 +44,14 @@ ErrorOr<NonnullRefPtr<TimeZoneSettingsWidget>> TimeZoneSettingsWidget::create()
|
|||
{
|
||||
auto timezonesettings_widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) TimeZoneSettingsWidget));
|
||||
|
||||
auto time_zone_map_bitmap = TRY(Gfx::Bitmap::try_load_from_file("/res/graphics/map.png"sv));
|
||||
auto time_zone_map_bitmap = TRY(Gfx::Bitmap::load_from_file("/res/graphics/map.png"sv));
|
||||
auto time_zone_rect = time_zone_map_bitmap->rect().shrunken(TIME_ZONE_MAP_NORTHERN_TRIM, 0, TIME_ZONE_MAP_SOUTHERN_TRIM, 0);
|
||||
time_zone_map_bitmap = TRY(time_zone_map_bitmap->cropped(time_zone_rect));
|
||||
|
||||
timezonesettings_widget->m_time_zone_map = *timezonesettings_widget->find_descendant_of_type_named<GUI::ImageWidget>("time_zone_map");
|
||||
timezonesettings_widget->m_time_zone_map->set_bitmap(time_zone_map_bitmap);
|
||||
|
||||
auto time_zone_marker = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/ladyball.png"sv));
|
||||
auto time_zone_marker = TRY(Gfx::Bitmap::load_from_file("/res/icons/32x32/ladyball.png"sv));
|
||||
timezonesettings_widget->m_time_zone_marker = TRY(time_zone_marker->scaled(0.75f, 0.75f));
|
||||
|
||||
timezonesettings_widget->set_time_zone_location();
|
||||
|
|
|
@ -265,13 +265,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
close_button.set_focus(true);
|
||||
|
||||
auto& debug_button = *widget->find_descendant_of_type_named<GUI::Button>("debug_button");
|
||||
debug_button.set_icon(TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-hack-studio.png"sv)));
|
||||
debug_button.set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-hack-studio.png"sv)));
|
||||
debug_button.on_click = [&](int) {
|
||||
GUI::Process::spawn_or_show_error(window, "/bin/HackStudio"sv, Array { "-c", coredump_path.characters() });
|
||||
};
|
||||
|
||||
auto& save_backtrace_button = *widget->find_descendant_of_type_named<GUI::Button>("save_backtrace_button");
|
||||
save_backtrace_button.set_icon(TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save.png"sv)));
|
||||
save_backtrace_button.set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"sv)));
|
||||
save_backtrace_button.on_click = [&](auto) {
|
||||
LexicalPath lexical_path(DeprecatedString::formatted("{}_{}_backtrace.txt", pid, app_name));
|
||||
auto file_or_error = FileSystemAccessClient::Client::the().save_file(window, lexical_path.title(), lexical_path.extension());
|
||||
|
|
|
@ -63,7 +63,7 @@ void BackgroundSettingsWidget::create_frame()
|
|||
};
|
||||
|
||||
m_context_menu = GUI::Menu::construct();
|
||||
m_show_in_file_manager_action = GUI::Action::create("Show in File Manager", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-file-manager.png"sv).release_value_but_fixme_should_propagate_errors(), [this](GUI::Action const&) {
|
||||
m_show_in_file_manager_action = GUI::Action::create("Show in File Manager", Gfx::Bitmap::load_from_file("/res/icons/16x16/app-file-manager.png"sv).release_value_but_fixme_should_propagate_errors(), [this](GUI::Action const&) {
|
||||
LexicalPath path { m_monitor_widget->wallpaper() };
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme(path.dirname(), path.basename()));
|
||||
});
|
||||
|
|
|
@ -19,8 +19,8 @@ namespace DisplaySettings {
|
|||
MonitorWidget::MonitorWidget()
|
||||
{
|
||||
m_desktop_resolution = GUI::Desktop::the().rect().size();
|
||||
m_monitor_bitmap = Gfx::Bitmap::try_load_from_file("/res/graphics/monitor.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_desktop_bitmap = Gfx::Bitmap::try_create(m_monitor_bitmap->format(), { 280, 158 }).release_value_but_fixme_should_propagate_errors();
|
||||
m_monitor_bitmap = Gfx::Bitmap::load_from_file("/res/graphics/monitor.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_desktop_bitmap = Gfx::Bitmap::create(m_monitor_bitmap->format(), { 280, 158 }).release_value_but_fixme_should_propagate_errors();
|
||||
m_monitor_rect = { { 12, 13 }, m_desktop_bitmap->size() };
|
||||
set_fixed_size(304, 201);
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ bool MonitorWidget::set_wallpaper(DeprecatedString path)
|
|||
[path](auto&) -> ErrorOr<NonnullRefPtr<Gfx::Bitmap>> {
|
||||
if (path.is_empty())
|
||||
return Error::from_errno(ENOENT);
|
||||
return Gfx::Bitmap::try_load_from_file(path);
|
||||
return Gfx::Bitmap::load_from_file(path);
|
||||
},
|
||||
|
||||
[this, path](ErrorOr<NonnullRefPtr<Gfx::Bitmap>> bitmap_or_error) -> ErrorOr<void> {
|
||||
|
@ -155,7 +155,7 @@ void MonitorWidget::paint_event(GUI::PaintEvent& event)
|
|||
// Render text label scaled with scale factor to hint at its effect.
|
||||
// FIXME: Once bitmaps have intrinsic scale factors, we could create a bitmap with an intrinsic scale factor of m_desktop_scale_factor
|
||||
// and that should give us the same effect with less code.
|
||||
auto text_bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, Gfx::IntSize { painter.font().width(displayed_resolution_string) + 1, painter.font().glyph_height() + 1 });
|
||||
auto text_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, Gfx::IntSize { painter.font().width(displayed_resolution_string) + 1, painter.font().glyph_height() + 1 });
|
||||
GUI::Painter text_painter(*text_bitmap);
|
||||
text_painter.set_font(painter.font());
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ ThemesSettingsWidget::ThemesSettingsWidget(bool& background_settings_changed)
|
|||
};
|
||||
m_themes_combo->set_selected_index(current_theme_index, GUI::AllowCallback::No);
|
||||
|
||||
auto mouse_settings_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-mouse.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
auto mouse_settings_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/app-mouse.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_cursor_themes_button = *find_descendant_of_type_named<GUI::Button>("cursor_themes_button");
|
||||
m_cursor_themes_button->set_icon(mouse_settings_icon);
|
||||
m_cursor_themes_button->on_click = [&](auto) {
|
||||
|
|
|
@ -575,7 +575,7 @@ void DirectoryView::handle_selection_change()
|
|||
|
||||
void DirectoryView::setup_actions()
|
||||
{
|
||||
m_mkdir_action = GUI::Action::create("&New Directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/mkdir.png"sv).release_value_but_fixme_should_propagate_errors(), [&](GUI::Action const&) {
|
||||
m_mkdir_action = GUI::Action::create("&New Directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/mkdir.png"sv).release_value_but_fixme_should_propagate_errors(), [&](GUI::Action const&) {
|
||||
DeprecatedString value;
|
||||
if (GUI::InputBox::show(window(), value, "Enter name:"sv, "New directory"sv) == GUI::InputBox::ExecResult::OK && !value.is_empty()) {
|
||||
auto new_dir_path = LexicalPath::canonicalized_path(DeprecatedString::formatted("{}/{}", path(), value));
|
||||
|
@ -587,7 +587,7 @@ void DirectoryView::setup_actions()
|
|||
}
|
||||
});
|
||||
|
||||
m_touch_action = GUI::Action::create("New &File...", { Mod_Ctrl | Mod_Shift, Key_F }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new.png"sv).release_value_but_fixme_should_propagate_errors(), [&](GUI::Action const&) {
|
||||
m_touch_action = GUI::Action::create("New &File...", { Mod_Ctrl | Mod_Shift, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/new.png"sv).release_value_but_fixme_should_propagate_errors(), [&](GUI::Action const&) {
|
||||
DeprecatedString value;
|
||||
if (GUI::InputBox::show(window(), value, "Enter name:"sv, "New file"sv) == GUI::InputBox::ExecResult::OK && !value.is_empty()) {
|
||||
auto new_file_path = LexicalPath::canonicalized_path(DeprecatedString::formatted("{}/{}", path(), value));
|
||||
|
@ -613,7 +613,7 @@ void DirectoryView::setup_actions()
|
|||
}
|
||||
});
|
||||
|
||||
m_open_terminal_action = GUI::Action::create("Open &Terminal Here", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-terminal.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_open_terminal_action = GUI::Action::create("Open &Terminal Here", Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
spawn_terminal(path());
|
||||
});
|
||||
|
||||
|
@ -630,21 +630,21 @@ void DirectoryView::setup_actions()
|
|||
window());
|
||||
|
||||
m_view_as_icons_action = GUI::Action::create_checkable(
|
||||
"View as &Icons", { Mod_Ctrl, KeyCode::Key_1 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/icon-view.png"sv).release_value_but_fixme_should_propagate_errors(), [&](GUI::Action const&) {
|
||||
"View as &Icons", { Mod_Ctrl, KeyCode::Key_1 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/icon-view.png"sv).release_value_but_fixme_should_propagate_errors(), [&](GUI::Action const&) {
|
||||
set_view_mode(DirectoryView::ViewMode::Icon);
|
||||
Config::write_string("FileManager"sv, "DirectoryView"sv, "ViewMode"sv, "Icon"sv);
|
||||
},
|
||||
window());
|
||||
|
||||
m_view_as_table_action = GUI::Action::create_checkable(
|
||||
"View as &Table", { Mod_Ctrl, KeyCode::Key_2 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/table-view.png"sv).release_value_but_fixme_should_propagate_errors(), [&](GUI::Action const&) {
|
||||
"View as &Table", { Mod_Ctrl, KeyCode::Key_2 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/table-view.png"sv).release_value_but_fixme_should_propagate_errors(), [&](GUI::Action const&) {
|
||||
set_view_mode(DirectoryView::ViewMode::Table);
|
||||
Config::write_string("FileManager"sv, "DirectoryView"sv, "ViewMode"sv, "Table"sv);
|
||||
},
|
||||
window());
|
||||
|
||||
m_view_as_columns_action = GUI::Action::create_checkable(
|
||||
"View as &Columns", { Mod_Ctrl, KeyCode::Key_3 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/columns-view.png"sv).release_value_but_fixme_should_propagate_errors(), [&](GUI::Action const&) {
|
||||
"View as &Columns", { Mod_Ctrl, KeyCode::Key_3 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/columns-view.png"sv).release_value_but_fixme_should_propagate_errors(), [&](GUI::Action const&) {
|
||||
set_view_mode(DirectoryView::ViewMode::Columns);
|
||||
Config::write_string("FileManager"sv, "DirectoryView"sv, "ViewMode"sv, "Columns"sv);
|
||||
},
|
||||
|
|
|
@ -40,7 +40,7 @@ PropertiesWindow::PropertiesWindow(DeprecatedString const& path, bool disable_re
|
|||
set_rect({ 0, 0, 360, 420 });
|
||||
set_resizable(false);
|
||||
|
||||
set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/properties.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/properties.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
auto& tab_widget = main_widget->add<GUI::TabWidget>();
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ void do_set_wallpaper(DeprecatedString const& file_path, GUI::Window* window)
|
|||
GUI::MessageBox::show(window, DeprecatedString::formatted("Failed to set {} as wallpaper.", file_path), "Failed to set wallpaper"sv, GUI::MessageBox::Type::Error);
|
||||
};
|
||||
|
||||
auto bitmap_or_error = Gfx::Bitmap::try_load_from_file(file_path);
|
||||
auto bitmap_or_error = Gfx::Bitmap::load_from_file(file_path);
|
||||
if (bitmap_or_error.is_error()) {
|
||||
show_error();
|
||||
return;
|
||||
|
@ -379,7 +379,7 @@ ErrorOr<int> run_in_desktop_mode()
|
|||
auto create_archive_action
|
||||
= GUI::Action::create(
|
||||
"Create &Archive",
|
||||
TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-archive.png"sv)),
|
||||
TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-archive.png"sv)),
|
||||
[&](GUI::Action const&) {
|
||||
auto paths = directory_view->selected_file_paths();
|
||||
if (paths.is_empty())
|
||||
|
@ -404,7 +404,7 @@ ErrorOr<int> run_in_desktop_mode()
|
|||
auto set_wallpaper_action
|
||||
= GUI::Action::create(
|
||||
"Set as Desktop &Wallpaper",
|
||||
TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-display-settings.png"sv)),
|
||||
TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-settings.png"sv)),
|
||||
[&](GUI::Action const&) {
|
||||
auto paths = directory_view->selected_file_paths();
|
||||
if (paths.is_empty())
|
||||
|
@ -441,7 +441,7 @@ ErrorOr<int> run_in_desktop_mode()
|
|||
|
||||
auto desktop_view_context_menu = TRY(GUI::Menu::try_create("Directory View"));
|
||||
|
||||
auto file_manager_action = GUI::Action::create("Open in File &Manager", {}, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-file-manager.png"sv)), [&](auto&) {
|
||||
auto file_manager_action = GUI::Action::create("Open in File &Manager", {}, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-file-manager.png"sv)), [&](auto&) {
|
||||
auto paths = directory_view->selected_file_paths();
|
||||
if (paths.is_empty()) {
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme(directory_view->path()));
|
||||
|
@ -454,7 +454,7 @@ ErrorOr<int> run_in_desktop_mode()
|
|||
}
|
||||
});
|
||||
|
||||
auto open_terminal_action = GUI::Action::create("Open in &Terminal", {}, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-terminal.png"sv)), [&](auto&) {
|
||||
auto open_terminal_action = GUI::Action::create("Open in &Terminal", {}, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"sv)), [&](auto&) {
|
||||
auto paths = directory_view->selected_file_paths();
|
||||
if (paths.is_empty()) {
|
||||
spawn_terminal(directory_view->path());
|
||||
|
@ -468,7 +468,7 @@ ErrorOr<int> run_in_desktop_mode()
|
|||
}
|
||||
});
|
||||
|
||||
auto display_properties_action = GUI::Action::create("&Display Settings", {}, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-display-settings.png"sv)), [&](GUI::Action const&) {
|
||||
auto display_properties_action = GUI::Action::create("&Display Settings", {}, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-settings.png"sv)), [&](GUI::Action const&) {
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme("/bin/DisplaySettings"));
|
||||
});
|
||||
|
||||
|
@ -544,7 +544,7 @@ ErrorOr<int> run_in_desktop_mode()
|
|||
GUI::Desktop::the().set_wallpaper(nullptr, {});
|
||||
return;
|
||||
}
|
||||
auto wallpaper_bitmap_or_error = Gfx::Bitmap::try_load_from_file(value);
|
||||
auto wallpaper_bitmap_or_error = Gfx::Bitmap::load_from_file(value);
|
||||
if (wallpaper_bitmap_or_error.is_error())
|
||||
dbgln("Failed to load wallpaper bitmap from path: {}", wallpaper_bitmap_or_error.error());
|
||||
else
|
||||
|
@ -556,7 +556,7 @@ ErrorOr<int> run_in_desktop_mode()
|
|||
auto selected_wallpaper = Config::read_string("WindowManager"sv, "Background"sv, "Wallpaper"sv, ""sv);
|
||||
RefPtr<Gfx::Bitmap> wallpaper_bitmap {};
|
||||
if (!selected_wallpaper.is_empty()) {
|
||||
wallpaper_bitmap = TRY(Gfx::Bitmap::try_load_from_file(selected_wallpaper));
|
||||
wallpaper_bitmap = TRY(Gfx::Bitmap::load_from_file(selected_wallpaper));
|
||||
}
|
||||
// This sets the wallpaper at startup, even if there is no wallpaper, the
|
||||
// desktop should still show the background color. It's fine to pass a
|
||||
|
@ -670,7 +670,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
|
|||
auto directory_view_context_menu = TRY(GUI::Menu::try_create("Directory View"));
|
||||
auto tree_view_directory_context_menu = TRY(GUI::Menu::try_create("Tree View Directory"));
|
||||
|
||||
auto open_parent_directory_action = GUI::Action::create("Open &Parent Directory", { Mod_Alt, Key_Up }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open-parent-directory.png"sv)), [&](GUI::Action const&) {
|
||||
auto open_parent_directory_action = GUI::Action::create("Open &Parent Directory", { Mod_Alt, Key_Up }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/open-parent-directory.png"sv)), [&](GUI::Action const&) {
|
||||
directory_view->open_parent_directory();
|
||||
});
|
||||
|
||||
|
@ -798,7 +798,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
|
|||
= GUI::Action::create(
|
||||
"Open in New &Window",
|
||||
{},
|
||||
TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-file-manager.png"sv)),
|
||||
TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-file-manager.png"sv)),
|
||||
[&](GUI::Action const& action) {
|
||||
Vector<DeprecatedString> paths;
|
||||
if (action.activator() == tree_view_directory_context_menu)
|
||||
|
@ -817,7 +817,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
|
|||
= GUI::Action::create(
|
||||
"Open in &Terminal",
|
||||
{},
|
||||
TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-terminal.png"sv)),
|
||||
TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"sv)),
|
||||
[&](GUI::Action const& action) {
|
||||
Vector<DeprecatedString> paths;
|
||||
if (action.activator() == tree_view_directory_context_menu)
|
||||
|
@ -837,7 +837,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
|
|||
= GUI::Action::create(
|
||||
"Create Desktop &Shortcut",
|
||||
{},
|
||||
TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-symlink.png"sv)),
|
||||
TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-symlink.png"sv)),
|
||||
[&](GUI::Action const&) {
|
||||
auto paths = directory_view->selected_file_paths();
|
||||
if (paths.is_empty()) {
|
||||
|
@ -850,7 +850,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
|
|||
auto create_archive_action
|
||||
= GUI::Action::create(
|
||||
"Create &Archive",
|
||||
TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-archive.png"sv)),
|
||||
TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-archive.png"sv)),
|
||||
[&](GUI::Action const&) {
|
||||
auto paths = directory_view->selected_file_paths();
|
||||
if (paths.is_empty())
|
||||
|
@ -877,7 +877,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
|
|||
auto set_wallpaper_action
|
||||
= GUI::Action::create(
|
||||
"Set as Desktop &Wallpaper",
|
||||
TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-display-settings.png"sv)),
|
||||
TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-settings.png"sv)),
|
||||
[&](GUI::Action const&) {
|
||||
auto paths = directory_view->selected_file_paths();
|
||||
if (paths.is_empty())
|
||||
|
@ -971,12 +971,12 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
|
|||
});
|
||||
focus_dependent_delete_action->set_enabled(false);
|
||||
|
||||
auto mkdir_action = GUI::Action::create("&New Directory...", { Mod_Ctrl | Mod_Shift, Key_N }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/mkdir.png"sv)), [&](GUI::Action const&) {
|
||||
auto mkdir_action = GUI::Action::create("&New Directory...", { Mod_Ctrl | Mod_Shift, Key_N }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/mkdir.png"sv)), [&](GUI::Action const&) {
|
||||
directory_view->mkdir_action().activate();
|
||||
refresh_tree_view();
|
||||
});
|
||||
|
||||
auto touch_action = GUI::Action::create("New &File...", { Mod_Ctrl | Mod_Shift, Key_F }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new.png"sv)), [&](GUI::Action const&) {
|
||||
auto touch_action = GUI::Action::create("New &File...", { Mod_Ctrl | Mod_Shift, Key_F }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/new.png"sv)), [&](GUI::Action const&) {
|
||||
directory_view->touch_action().activate();
|
||||
refresh_tree_view();
|
||||
});
|
||||
|
@ -1031,7 +1031,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
|
|||
TRY(view_menu->try_add_separator());
|
||||
TRY(view_menu->try_add_action(show_dotfiles_action));
|
||||
|
||||
auto go_to_location_action = GUI::Action::create("Go to &Location...", { Mod_Ctrl, Key_L }, Key_F6, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-to.png"sv)), [&](auto&) {
|
||||
auto go_to_location_action = GUI::Action::create("Go to &Location...", { Mod_Ctrl, Key_L }, Key_F6, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv)), [&](auto&) {
|
||||
toolbar_container.set_visible(true);
|
||||
location_toolbar.set_visible(true);
|
||||
breadcrumb_toolbar.set_visible(false);
|
||||
|
@ -1181,7 +1181,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
|
|||
|| (!directory_view->current_view().selection().is_empty() && access(directory_view->path().characters(), W_OK) == 0));
|
||||
};
|
||||
|
||||
auto directory_open_action = GUI::Action::create("Open", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png"sv)), [&](auto&) {
|
||||
auto directory_open_action = GUI::Action::create("Open", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv)), [&](auto&) {
|
||||
directory_view->open(directory_view->selected_file_paths().first());
|
||||
});
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ ErrorOr<RefPtr<GUI::Window>> MainWidget::create_preview_window()
|
|||
|
||||
ErrorOr<void> MainWidget::create_actions()
|
||||
{
|
||||
m_new_action = GUI::Action::create("&New Font...", { Mod_Ctrl, Key_N }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-font.png"sv)), [&](auto&) {
|
||||
m_new_action = GUI::Action::create("&New Font...", { Mod_Ctrl, Key_N }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-font.png"sv)), [&](auto&) {
|
||||
if (!request_close())
|
||||
return;
|
||||
auto new_font_wizard = NewFontDialog::construct(window());
|
||||
|
@ -175,7 +175,7 @@ ErrorOr<void> MainWidget::create_actions()
|
|||
update_statusbar();
|
||||
});
|
||||
|
||||
m_open_preview_action = GUI::Action::create("&Preview Font", { Mod_Ctrl, Key_P }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find.png"sv)), [&](auto&) {
|
||||
m_open_preview_action = GUI::Action::create("&Preview Font", { Mod_Ctrl, Key_P }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv)), [&](auto&) {
|
||||
if (!m_font_preview_window) {
|
||||
if (auto maybe_window = create_preview_window(); maybe_window.is_error())
|
||||
show_error(maybe_window.error(), "Creating preview window failed"sv);
|
||||
|
@ -241,7 +241,7 @@ ErrorOr<void> MainWidget::create_actions()
|
|||
m_show_system_emoji_action->set_checked(show_system_emoji);
|
||||
m_show_system_emoji_action->set_status_tip("Show or hide system emoji");
|
||||
|
||||
m_go_to_glyph_action = GUI::Action::create("&Go to Glyph...", { Mod_Ctrl, Key_G }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-to.png"sv)), [&](auto&) {
|
||||
m_go_to_glyph_action = GUI::Action::create("&Go to Glyph...", { Mod_Ctrl, Key_G }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv)), [&](auto&) {
|
||||
DeprecatedString input;
|
||||
if (GUI::InputBox::show(window(), input, "Hexadecimal:"sv, "Go to glyph"sv) == GUI::InputBox::ExecResult::OK && !input.is_empty()) {
|
||||
auto maybe_code_point = AK::StringUtils::convert_to_uint_from_hex(input);
|
||||
|
@ -256,12 +256,12 @@ ErrorOr<void> MainWidget::create_actions()
|
|||
});
|
||||
m_go_to_glyph_action->set_status_tip("Go to the specified code point");
|
||||
|
||||
m_previous_glyph_action = GUI::Action::create("Pre&vious Glyph", { Mod_Alt, Key_Left }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png"sv)), [&](auto&) {
|
||||
m_previous_glyph_action = GUI::Action::create("Pre&vious Glyph", { Mod_Alt, Key_Left }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv)), [&](auto&) {
|
||||
m_glyph_map_widget->select_previous_existing_glyph();
|
||||
});
|
||||
m_previous_glyph_action->set_status_tip("Seek the previous visible glyph");
|
||||
|
||||
m_next_glyph_action = GUI::Action::create("&Next Glyph", { Mod_Alt, Key_Right }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv)), [&](auto&) {
|
||||
m_next_glyph_action = GUI::Action::create("&Next Glyph", { Mod_Alt, Key_Right }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv)), [&](auto&) {
|
||||
m_glyph_map_widget->select_next_existing_glyph();
|
||||
});
|
||||
m_next_glyph_action->set_status_tip("Seek the next visible glyph");
|
||||
|
@ -289,12 +289,12 @@ ErrorOr<void> MainWidget::create_actions()
|
|||
m_glyph_editor_scale_actions.add_action(*m_scale_fifteen_action);
|
||||
m_glyph_editor_scale_actions.set_exclusive(true);
|
||||
|
||||
m_paint_glyph_action = GUI::Action::create_checkable("Paint Glyph", { Mod_Ctrl, KeyCode::Key_J }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/pen.png"sv)), [&](auto&) {
|
||||
m_paint_glyph_action = GUI::Action::create_checkable("Paint Glyph", { Mod_Ctrl, KeyCode::Key_J }, TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/pen.png"sv)), [&](auto&) {
|
||||
m_glyph_editor_widget->set_mode(GlyphEditorWidget::Paint);
|
||||
});
|
||||
m_paint_glyph_action->set_checked(true);
|
||||
|
||||
m_move_glyph_action = GUI::Action::create_checkable("Move Glyph", { Mod_Ctrl, KeyCode::Key_K }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/selection-move.png"sv)), [&](auto&) {
|
||||
m_move_glyph_action = GUI::Action::create_checkable("Move Glyph", { Mod_Ctrl, KeyCode::Key_K }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/selection-move.png"sv)), [&](auto&) {
|
||||
m_glyph_editor_widget->set_mode(GlyphEditorWidget::Move);
|
||||
});
|
||||
|
||||
|
@ -310,15 +310,15 @@ ErrorOr<void> MainWidget::create_actions()
|
|||
m_glyph_editor_widget->rotate_90(Gfx::RotationDirection::Clockwise);
|
||||
});
|
||||
|
||||
m_flip_horizontal_action = GUI::Action::create("Flip Horizontally", { Mod_Ctrl | Mod_Shift, Key_Q }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-flip-horizontal.png"sv)), [&](auto&) {
|
||||
m_flip_horizontal_action = GUI::Action::create("Flip Horizontally", { Mod_Ctrl | Mod_Shift, Key_Q }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-flip-horizontal.png"sv)), [&](auto&) {
|
||||
m_glyph_editor_widget->flip(Gfx::Orientation::Horizontal);
|
||||
});
|
||||
|
||||
m_flip_vertical_action = GUI::Action::create("Flip Vertically", { Mod_Ctrl | Mod_Shift, Key_W }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-flip-vertical.png"sv)), [&](auto&) {
|
||||
m_flip_vertical_action = GUI::Action::create("Flip Vertically", { Mod_Ctrl | Mod_Shift, Key_W }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-flip-vertical.png"sv)), [&](auto&) {
|
||||
m_glyph_editor_widget->flip(Gfx::Orientation::Vertical);
|
||||
});
|
||||
|
||||
m_copy_text_action = GUI::Action::create("Copy as Te&xt", { Mod_Ctrl, Key_T }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png"sv)), [&](auto&) {
|
||||
m_copy_text_action = GUI::Action::create("Copy as Te&xt", { Mod_Ctrl, Key_T }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"sv)), [&](auto&) {
|
||||
StringBuilder builder;
|
||||
auto selection = m_glyph_map_widget->selection().normalized();
|
||||
for (auto code_point = selection.start(); code_point < selection.start() + selection.size(); ++code_point) {
|
||||
|
@ -709,7 +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)));
|
||||
scale_menu->set_icon(TRY(Gfx::Bitmap::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));
|
||||
|
|
|
@ -216,7 +216,7 @@ ErrorOr<void> MainWidget::initialize_fallibles(GUI::Window& window)
|
|||
auto help_menu = TRY(window.try_add_menu("&Help"));
|
||||
String help_page_path = TRY(TRY(try_make_ref_counted<Manual::PageNode>(Manual::sections[1 - 1], TRY(String::from_utf8("Help"sv))))->path());
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
|
||||
TRY(help_menu->try_add_action(GUI::Action::create("&Contents", { Key_F1 }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-unknown.png"sv)), [this, help_page_path = move(help_page_path)](auto&) {
|
||||
TRY(help_menu->try_add_action(GUI::Action::create("&Contents", { Key_F1 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-unknown.png"sv)), [this, help_page_path = move(help_page_path)](auto&) {
|
||||
open_page(help_page_path);
|
||||
})));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Help", TRY(GUI::Icon::try_create_default_icon("app-help"sv)), &window)));
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
ManualModel::ManualModel()
|
||||
{
|
||||
m_section_open_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/book-open.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_section_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/book.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_page_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-unknown.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_section_open_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/book-open.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_section_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/book.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_page_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-unknown.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
|
||||
Optional<GUI::ModelIndex> ManualModel::index_from_path(StringView path) const
|
||||
|
|
|
@ -98,7 +98,7 @@ HexEditorWidget::HexEditorWidget()
|
|||
m_editor->update();
|
||||
};
|
||||
|
||||
m_new_action = GUI::Action::create("New", { Mod_Ctrl, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new.png"sv).release_value_but_fixme_should_propagate_errors(), [this](const GUI::Action&) {
|
||||
m_new_action = GUI::Action::create("New", { Mod_Ctrl, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/new.png"sv).release_value_but_fixme_should_propagate_errors(), [this](const GUI::Action&) {
|
||||
DeprecatedString value;
|
||||
if (request_close() && GUI::InputBox::show(window(), value, "Enter new file size:"sv, "New file size"sv) == GUI::InputBox::ExecResult::OK && !value.is_empty()) {
|
||||
auto file_size = value.to_uint();
|
||||
|
@ -166,7 +166,7 @@ HexEditorWidget::HexEditorWidget()
|
|||
});
|
||||
m_redo_action->set_enabled(false);
|
||||
|
||||
m_find_action = GUI::Action::create("&Find", { Mod_Ctrl, Key_F }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
m_find_action = GUI::Action::create("&Find", { Mod_Ctrl, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
auto old_buffer = m_search_buffer;
|
||||
bool find_all = false;
|
||||
if (FindDialog::show(window(), m_search_text, m_search_buffer, find_all) == GUI::InputBox::ExecResult::OK) {
|
||||
|
@ -203,7 +203,7 @@ HexEditorWidget::HexEditorWidget()
|
|||
}
|
||||
});
|
||||
|
||||
m_goto_offset_action = GUI::Action::create("&Go to Offset ...", { Mod_Ctrl, Key_G }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [this](const GUI::Action&) {
|
||||
m_goto_offset_action = GUI::Action::create("&Go to Offset ...", { Mod_Ctrl, Key_G }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [this](const GUI::Action&) {
|
||||
int new_offset;
|
||||
auto result = GoToOffsetDialog::show(
|
||||
window(),
|
||||
|
@ -226,17 +226,17 @@ HexEditorWidget::HexEditorWidget()
|
|||
set_search_results_visible(action.is_checked());
|
||||
});
|
||||
|
||||
m_copy_hex_action = GUI::Action::create("Copy &Hex", { Mod_Ctrl, Key_C }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/hex.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
m_copy_hex_action = GUI::Action::create("Copy &Hex", { Mod_Ctrl, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/hex.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
m_editor->copy_selected_hex_to_clipboard();
|
||||
});
|
||||
m_copy_hex_action->set_enabled(false);
|
||||
|
||||
m_copy_text_action = GUI::Action::create("Copy &Text", { Mod_Ctrl | Mod_Shift, Key_C }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
m_copy_text_action = GUI::Action::create("Copy &Text", { Mod_Ctrl | Mod_Shift, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
m_editor->copy_selected_text_to_clipboard();
|
||||
});
|
||||
m_copy_text_action->set_enabled(false);
|
||||
|
||||
m_copy_as_c_code_action = GUI::Action::create("Copy as &C Code", { Mod_Alt | Mod_Shift, Key_C }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/c.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
m_copy_as_c_code_action = GUI::Action::create("Copy as &C Code", { Mod_Alt | Mod_Shift, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/c.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
m_editor->copy_selected_hex_to_clipboard_as_c_code();
|
||||
});
|
||||
m_copy_as_c_code_action->set_enabled(false);
|
||||
|
@ -412,7 +412,7 @@ void HexEditorWidget::initialize_menubar(GUI::Window& window)
|
|||
edit_menu.add_action(*m_copy_as_c_code_action);
|
||||
edit_menu.add_separator();
|
||||
edit_menu.add_action(*m_find_action);
|
||||
edit_menu.add_action(GUI::Action::create("Find &Next", { Mod_None, Key_F3 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find-next.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
edit_menu.add_action(GUI::Action::create("Find &Next", { Mod_None, Key_F3 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find-next.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
if (m_search_text.is_empty() || m_search_buffer.is_empty()) {
|
||||
GUI::MessageBox::show(&window, "Nothing to search for"sv, "Not found"sv, GUI::MessageBox::Type::Warning);
|
||||
return;
|
||||
|
@ -427,7 +427,7 @@ void HexEditorWidget::initialize_menubar(GUI::Window& window)
|
|||
m_last_found_index = result.value();
|
||||
}));
|
||||
|
||||
edit_menu.add_action(GUI::Action::create("Find All &Strings", { Mod_Ctrl | Mod_Shift, Key_F }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
edit_menu.add_action(GUI::Action::create("Find All &Strings", { Mod_Ctrl | Mod_Shift, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) {
|
||||
int min_length = 4;
|
||||
auto matches = m_editor->find_all_strings(min_length);
|
||||
m_search_results->set_model(*new SearchResultsModel(move(matches)));
|
||||
|
|
|
@ -157,17 +157,17 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
widget->rotate(Gfx::RotationDirection::Clockwise);
|
||||
});
|
||||
|
||||
auto vertical_flip_action = GUI::Action::create("Flip &Vertically", { Mod_None, Key_V }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-flip-vertical.png"sv)),
|
||||
auto vertical_flip_action = GUI::Action::create("Flip &Vertically", { Mod_None, Key_V }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-flip-vertical.png"sv)),
|
||||
[&](auto&) {
|
||||
widget->flip(Gfx::Orientation::Vertical);
|
||||
});
|
||||
|
||||
auto horizontal_flip_action = GUI::Action::create("Flip &Horizontally", { Mod_None, Key_H }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-flip-horizontal.png"sv)),
|
||||
auto horizontal_flip_action = GUI::Action::create("Flip &Horizontally", { Mod_None, Key_H }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-flip-horizontal.png"sv)),
|
||||
[&](auto&) {
|
||||
widget->flip(Gfx::Orientation::Horizontal);
|
||||
});
|
||||
|
||||
auto desktop_wallpaper_action = GUI::Action::create("Set as Desktop &Wallpaper", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-display-settings.png"sv)),
|
||||
auto desktop_wallpaper_action = GUI::Action::create("Set as Desktop &Wallpaper", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-settings.png"sv)),
|
||||
[&](auto&) {
|
||||
if (!GUI::Desktop::the().set_wallpaper(widget->bitmap(), widget->path())) {
|
||||
GUI::MessageBox::show(window,
|
||||
|
@ -177,22 +177,22 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
}
|
||||
});
|
||||
|
||||
auto go_first_action = GUI::Action::create("&Go to First", { Mod_None, Key_Home }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-first.png"sv)),
|
||||
auto go_first_action = GUI::Action::create("&Go to First", { Mod_None, Key_Home }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-first.png"sv)),
|
||||
[&](auto&) {
|
||||
widget->navigate(ViewWidget::Directions::First);
|
||||
});
|
||||
|
||||
auto go_back_action = GUI::Action::create("Go &Back", { Mod_None, Key_Left }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png"sv)),
|
||||
auto go_back_action = GUI::Action::create("Go &Back", { Mod_None, Key_Left }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv)),
|
||||
[&](auto&) {
|
||||
widget->navigate(ViewWidget::Directions::Back);
|
||||
});
|
||||
|
||||
auto go_forward_action = GUI::Action::create("Go &Forward", { Mod_None, Key_Right }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv)),
|
||||
auto go_forward_action = GUI::Action::create("Go &Forward", { Mod_None, Key_Right }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv)),
|
||||
[&](auto&) {
|
||||
widget->navigate(ViewWidget::Directions::Forward);
|
||||
});
|
||||
|
||||
auto go_last_action = GUI::Action::create("Go to &Last", { Mod_None, Key_End }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-last.png"sv)),
|
||||
auto go_last_action = GUI::Action::create("Go to &Last", { Mod_None, Key_End }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-last.png"sv)),
|
||||
[&](auto&) {
|
||||
widget->navigate(ViewWidget::Directions::Last);
|
||||
});
|
||||
|
@ -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", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/fit-image-to-view.png"sv)), [&](auto&) {
|
||||
"Fit Image To &View", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/fit-image-to-view.png"sv)), [&](auto&) {
|
||||
widget->fit_content_to_view();
|
||||
});
|
||||
|
||||
|
@ -314,7 +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)));
|
||||
scaling_mode_menu->set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/scale.png"sv)));
|
||||
|
||||
auto scaling_mode_group = make<GUI::ActionGroup>();
|
||||
scaling_mode_group->set_exclusive(true);
|
||||
|
|
|
@ -155,13 +155,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto timeline_menu = TRY(window->try_add_menu("&Timeline"));
|
||||
auto previous_frame_action = GUI::Action::create(
|
||||
"&Previous frame", { Key_Left }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png"sv)), [&](auto&) {
|
||||
"&Previous frame", { Key_Left }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv)), [&](auto&) {
|
||||
pause_action->set_checked(true);
|
||||
magnifier->pause_capture(true);
|
||||
magnifier->display_previous_frame();
|
||||
});
|
||||
auto next_frame_action = GUI::Action::create(
|
||||
"&Next frame", { Key_Right }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv)), [&](auto&) {
|
||||
"&Next frame", { Key_Right }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv)), [&](auto&) {
|
||||
pause_action->set_checked(true);
|
||||
magnifier->pause_capture(true);
|
||||
magnifier->display_next_frame();
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
MailboxTreeModel::MailboxTreeModel(AccountHolder const& account_holder)
|
||||
: m_account_holder(account_holder)
|
||||
{
|
||||
m_mail_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-mail.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_folder_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-folder.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_account_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/home-directory.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_mail_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-mail.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_folder_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-folder.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_account_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/home-directory.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
|
||||
GUI::ModelIndex MailboxTreeModel::index(int row, int column, GUI::ModelIndex const& parent) const
|
||||
|
|
|
@ -24,7 +24,7 @@ void DoubleClickArrowWidget::set_double_click_speed(int speed)
|
|||
|
||||
DoubleClickArrowWidget::DoubleClickArrowWidget()
|
||||
{
|
||||
m_arrow_bitmap = Gfx::Bitmap::try_load_from_file("/res/graphics/double-click-down-arrow.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_arrow_bitmap = Gfx::Bitmap::load_from_file("/res/graphics/double-click-down-arrow.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
void DoubleClickArrowWidget::paint_event(GUI::PaintEvent& event)
|
||||
|
|
|
@ -25,10 +25,10 @@ ErrorOr<void> HighlightPreviewWidget::reload_cursor()
|
|||
auto theme_path = DeprecatedString::formatted("/res/cursor-themes/{}/{}", cursor_theme, "Config.ini");
|
||||
auto cursor_theme_config = TRY(Core::ConfigFile::open(theme_path));
|
||||
auto load_bitmap = [](StringView path, StringView default_path) {
|
||||
auto maybe_bitmap = Gfx::Bitmap::try_load_from_file(path);
|
||||
auto maybe_bitmap = Gfx::Bitmap::load_from_file(path);
|
||||
if (!maybe_bitmap.is_error())
|
||||
return maybe_bitmap;
|
||||
return Gfx::Bitmap::try_load_from_file(default_path);
|
||||
return Gfx::Bitmap::load_from_file(default_path);
|
||||
};
|
||||
constexpr auto default_cursor_path = "/res/cursor-themes/Default/arrow.x2y2.png"sv;
|
||||
auto cursor_path = DeprecatedString::formatted("/res/cursor-themes/{}/{}",
|
||||
|
|
|
@ -64,7 +64,7 @@ void MouseCursorModel::invalidate()
|
|||
cursor.name = LexicalPath::basename(cursor.path);
|
||||
|
||||
// FIXME: Animated cursor bitmaps
|
||||
auto cursor_bitmap = Gfx::Bitmap::try_load_from_file(cursor.path).release_value_but_fixme_should_propagate_errors();
|
||||
auto cursor_bitmap = Gfx::Bitmap::load_from_file(cursor.path).release_value_but_fixme_should_propagate_errors();
|
||||
auto cursor_bitmap_rect = cursor_bitmap->rect();
|
||||
cursor.params = Gfx::CursorParams::parse_from_filename(cursor.name, cursor_bitmap_rect.center()).constrained(*cursor_bitmap);
|
||||
cursor.bitmap = cursor_bitmap->cropped(Gfx::IntRect(Gfx::FloatRect(cursor_bitmap_rect).scaled(1.0 / cursor.params.frames(), 1.0))).release_value_but_fixme_should_propagate_errors();
|
||||
|
|
|
@ -21,8 +21,8 @@ enum Columns {
|
|||
ErrorOr<NonnullRefPtr<OutlineModel>> OutlineModel::create(NonnullRefPtr<PDF::OutlineDict> const& outline)
|
||||
{
|
||||
auto outline_model = adopt_ref(*new OutlineModel(outline));
|
||||
outline_model->m_closed_item_icon.set_bitmap_for_size(16, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/book.png"sv)));
|
||||
outline_model->m_open_item_icon.set_bitmap_for_size(16, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/book-open.png"sv)));
|
||||
outline_model->m_closed_item_icon.set_bitmap_for_size(16, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/book.png"sv)));
|
||||
outline_model->m_open_item_icon.set_bitmap_for_size(16, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/book-open.png"sv)));
|
||||
return outline_model;
|
||||
}
|
||||
|
||||
|
|
|
@ -317,7 +317,7 @@ PDF::PDFErrorOr<NonnullRefPtr<Gfx::Bitmap>> PDFViewer::render_page(u32 page_inde
|
|||
{
|
||||
auto page = TRY(m_document->get_page(page_index));
|
||||
auto& page_size = m_page_dimension_cache.render_info[page_index].size;
|
||||
auto bitmap = TRY(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, page_size.to_type<int>()));
|
||||
auto bitmap = TRY(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, page_size.to_type<int>()));
|
||||
|
||||
auto maybe_errors = PDF::Renderer::render(*m_document, page, bitmap, m_rendering_preferences);
|
||||
if (maybe_errors.is_error()) {
|
||||
|
|
|
@ -239,7 +239,7 @@ void PDFViewerWidget::initialize_menubar(GUI::Window& window)
|
|||
void PDFViewerWidget::initialize_toolbar(GUI::Toolbar& toolbar)
|
||||
{
|
||||
auto open_outline_action = GUI::Action::create(
|
||||
"Toggle &Sidebar", { Mod_Ctrl, Key_S }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/sidebar.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
"Toggle &Sidebar", { Mod_Ctrl, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/sidebar.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_sidebar_open = !m_sidebar_open;
|
||||
m_sidebar->set_visible(m_sidebar_open);
|
||||
},
|
||||
|
@ -250,13 +250,13 @@ void PDFViewerWidget::initialize_toolbar(GUI::Toolbar& toolbar)
|
|||
toolbar.add_action(*open_outline_action);
|
||||
toolbar.add_separator();
|
||||
|
||||
m_go_to_prev_page_action = GUI::Action::create("Go to &Previous Page", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-up.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_go_to_prev_page_action = GUI::Action::create("Go to &Previous Page", Gfx::Bitmap::load_from_file("/res/icons/16x16/go-up.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
VERIFY(m_viewer->current_page() > 0);
|
||||
m_page_text_box->set_current_number(m_viewer->current_page());
|
||||
});
|
||||
m_go_to_prev_page_action->set_enabled(false);
|
||||
|
||||
m_go_to_next_page_action = GUI::Action::create("Go to &Next Page", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-down.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_go_to_next_page_action = GUI::Action::create("Go to &Next Page", Gfx::Bitmap::load_from_file("/res/icons/16x16/go-down.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
VERIFY(m_viewer->current_page() < m_viewer->document()->get_page_count() - 1);
|
||||
m_page_text_box->set_current_number(m_viewer->current_page() + 2);
|
||||
});
|
||||
|
|
|
@ -55,11 +55,11 @@ MainWidget::MainWidget(TrackManager& track_manager, AudioPlayerLoop& loop)
|
|||
|
||||
void MainWidget::add_track_actions(GUI::Menu& menu)
|
||||
{
|
||||
menu.add_action(GUI::Action::create("&Add Track", { Mod_Ctrl, Key_T }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/plus.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
menu.add_action(GUI::Action::create("&Add Track", { Mod_Ctrl, Key_T }, Gfx::Bitmap::load_from_file("/res/icons/16x16/plus.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_player_widget->add_track();
|
||||
}));
|
||||
|
||||
menu.add_action(GUI::Action::create("&Next Track", { Mod_Ctrl, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-last.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
menu.add_action(GUI::Action::create("&Next Track", { Mod_Ctrl, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-last.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
turn_off_pressed_keys();
|
||||
m_player_widget->next_track();
|
||||
turn_on_pressed_keys();
|
||||
|
|
|
@ -24,12 +24,12 @@ PlayerWidget::PlayerWidget(TrackManager& manager, AudioPlayerLoop& loop)
|
|||
set_fill_with_background_color(true);
|
||||
m_track_number_choices.append("1");
|
||||
|
||||
m_play_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/play.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_pause_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/pause.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_back_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png"sv).release_value_but_fixme_should_propagate_errors(); // Go back a note
|
||||
m_next_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors(); // Advance a note
|
||||
m_add_track_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/plus.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_next_track_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-last.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_play_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/play.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_pause_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/pause.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_back_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv).release_value_but_fixme_should_propagate_errors(); // Go back a note
|
||||
m_next_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors(); // Advance a note
|
||||
m_add_track_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/plus.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_next_track_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/go-last.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
RefPtr<GUI::Label> label = add<GUI::Label>("Track");
|
||||
label->set_max_width(75);
|
||||
|
|
|
@ -70,7 +70,7 @@ void RollWidget::paint_event(GUI::PaintEvent& event)
|
|||
|
||||
// Draw the background, if necessary.
|
||||
if (viewport_changed() || paint_area != m_background->height()) {
|
||||
m_background = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, Gfx::IntSize(m_roll_width, paint_area)).release_value_but_fixme_should_propagate_errors();
|
||||
m_background = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, Gfx::IntSize(m_roll_width, paint_area)).release_value_but_fixme_should_propagate_errors();
|
||||
Gfx::Painter background_painter(*m_background);
|
||||
|
||||
background_painter.translate(frame_thickness(), frame_thickness());
|
||||
|
|
|
@ -53,7 +53,7 @@ SamplerWidget::SamplerWidget(TrackManager& track_manager)
|
|||
m_open_button = m_open_button_and_recorded_sample_name_container->add<GUI::Button>();
|
||||
m_open_button->set_fixed_size(24, 24);
|
||||
m_open_button->set_focus_policy(GUI::FocusPolicy::TabFocus);
|
||||
m_open_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_open_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_open_button->on_click = [this](auto) {
|
||||
Optional<DeprecatedString> open_path = GUI::FilePicker::get_open_filepath(window());
|
||||
if (!open_path.has_value())
|
||||
|
|
|
@ -54,7 +54,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
main_widget_updater->start();
|
||||
|
||||
auto& file_menu = window->add_menu("&File");
|
||||
file_menu.add_action(GUI::Action::create("Export", { Mod_Ctrl, Key_E }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/file-export.png"sv)), [&](const GUI::Action&) {
|
||||
file_menu.add_action(GUI::Action::create("Export", { Mod_Ctrl, Key_E }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/file-export.png"sv)), [&](const GUI::Action&) {
|
||||
save_path = GUI::FilePicker::get_save_filepath(window, "Untitled", "wav");
|
||||
if (!save_path.has_value())
|
||||
return;
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace PixelPaint {
|
|||
ErrorOr<NonnullRefPtr<GUI::TreeViewModel>> create_filter_tree_model(ImageEditor* editor)
|
||||
{
|
||||
auto directory_icon = GUI::FileIconProvider::directory_icon();
|
||||
auto filter_icon = GUI::Icon(TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/filter.png"sv)));
|
||||
auto filter_icon = GUI::Icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/filter.png"sv)));
|
||||
|
||||
auto filter_tree_model = GUI::TreeViewModel::create();
|
||||
|
||||
|
|
|
@ -12,40 +12,40 @@ ErrorOr<IconBag> IconBag::try_create()
|
|||
{
|
||||
IconBag icon_bag;
|
||||
|
||||
icon_bag.filetype_pixelpaint = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-pixelpaint.png"sv));
|
||||
icon_bag.new_clipboard = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/new-clipboard.png"sv));
|
||||
icon_bag.file_export = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/file-export.png"sv));
|
||||
icon_bag.close_image = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/close-tab.png"sv));
|
||||
icon_bag.edit_copy = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png"sv));
|
||||
icon_bag.clear_selection = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/clear-selection.png"sv));
|
||||
icon_bag.invert_selection = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/invert-selection.png"sv));
|
||||
icon_bag.swap_colors = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/swap-colors.png"sv));
|
||||
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/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));
|
||||
icon_bag.edit_flip_horizontal = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-flip-horizontal.png"sv));
|
||||
icon_bag.resize_image = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/selection-move.png"sv));
|
||||
icon_bag.crop = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/crop.png"sv));
|
||||
icon_bag.new_layer = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new-layer.png"sv));
|
||||
icon_bag.previous_layer = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/previous-layer.png"sv));
|
||||
icon_bag.next_layer = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/next-layer.png"sv));
|
||||
icon_bag.top_layer = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/top-layer.png"sv));
|
||||
icon_bag.bottom_layer = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/bottom-layer.png"sv));
|
||||
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));
|
||||
icon_bag.filetype_pixelpaint = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-pixelpaint.png"sv));
|
||||
icon_bag.new_clipboard = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/new-clipboard.png"sv));
|
||||
icon_bag.file_export = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/file-export.png"sv));
|
||||
icon_bag.close_image = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/close-tab.png"sv));
|
||||
icon_bag.edit_copy = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"sv));
|
||||
icon_bag.clear_selection = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/clear-selection.png"sv));
|
||||
icon_bag.invert_selection = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/invert-selection.png"sv));
|
||||
icon_bag.swap_colors = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/swap-colors.png"sv));
|
||||
icon_bag.default_colors = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/default-colors.png"sv));
|
||||
icon_bag.load_color_palette = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/load-color-palette.png"sv));
|
||||
icon_bag.save_color_palette = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/save-color-palette.png"sv));
|
||||
icon_bag.fit_image_to_view = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/fit-image-to-view.png"sv));
|
||||
icon_bag.add_guide = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/add-guide.png"sv));
|
||||
icon_bag.clear_guides = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/clear-guides.png"sv));
|
||||
icon_bag.edit_flip_vertical = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-flip-vertical.png"sv));
|
||||
icon_bag.edit_flip_horizontal = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-flip-horizontal.png"sv));
|
||||
icon_bag.resize_image = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/selection-move.png"sv));
|
||||
icon_bag.crop = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/crop.png"sv));
|
||||
icon_bag.new_layer = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/new-layer.png"sv));
|
||||
icon_bag.previous_layer = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/previous-layer.png"sv));
|
||||
icon_bag.next_layer = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/next-layer.png"sv));
|
||||
icon_bag.top_layer = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/top-layer.png"sv));
|
||||
icon_bag.bottom_layer = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/bottom-layer.png"sv));
|
||||
icon_bag.active_layer_up = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/active-layer-up.png"sv));
|
||||
icon_bag.active_layer_down = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/active-layer-down.png"sv));
|
||||
icon_bag.delete_layer = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/delete.png"sv));
|
||||
icon_bag.flatten_image = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/flatten-image.png"sv));
|
||||
icon_bag.merge_visible = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/merge-visible.png"sv));
|
||||
icon_bag.merge_active_layer_up = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/merge-active-layer-up.png"sv));
|
||||
icon_bag.merge_active_layer_down = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/merge-active-layer-down.png"sv));
|
||||
icon_bag.filter = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/filter.png"sv));
|
||||
icon_bag.generic_5x5_convolution = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/generic-5x5-convolution.png"sv));
|
||||
icon_bag.levels = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/levels.png"sv));
|
||||
icon_bag.add_mask = TRY(Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/add-mask.png"sv));
|
||||
|
||||
return icon_bag;
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ ErrorOr<void> Image::serialize_as_json(JsonObjectSerializer<StringBuilder>& json
|
|||
|
||||
ErrorOr<NonnullRefPtr<Gfx::Bitmap>> Image::try_compose_bitmap(Gfx::BitmapFormat format) const
|
||||
{
|
||||
auto bitmap = TRY(Gfx::Bitmap::try_create(format, m_size));
|
||||
auto bitmap = TRY(Gfx::Bitmap::create(format, m_size));
|
||||
GUI::Painter painter(bitmap);
|
||||
paint_into(painter, { 0, 0, m_size.width(), m_size.height() });
|
||||
return bitmap;
|
||||
|
|
|
@ -23,7 +23,7 @@ ErrorOr<NonnullRefPtr<Layer>> Layer::try_create_with_size(Image& image, Gfx::Int
|
|||
if (size.width() > 16384 || size.height() > 16384)
|
||||
return Error::from_string_literal("Layer size too large");
|
||||
|
||||
auto bitmap = TRY(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, size));
|
||||
auto bitmap = TRY(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, size));
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) Layer(image, move(bitmap), move(name)));
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ RefPtr<Gfx::Bitmap> Layer::try_copy_bitmap(Selection const& selection) const
|
|||
}
|
||||
auto selection_rect = selection.bounding_rect();
|
||||
|
||||
auto bitmap_or_error = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, selection_rect.size());
|
||||
auto bitmap_or_error = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, selection_rect.size());
|
||||
if (bitmap_or_error.is_error())
|
||||
return nullptr;
|
||||
auto result = bitmap_or_error.release_value_but_fixme_should_propagate_errors();
|
||||
|
@ -238,7 +238,7 @@ ErrorOr<void> Layer::resize(Gfx::IntSize new_size, Gfx::IntPoint new_location, G
|
|||
auto src_rect = Gfx::IntRect(Gfx::IntPoint(0, 0), size());
|
||||
auto dst_rect = Gfx::IntRect(Gfx::IntPoint(0, 0), new_size);
|
||||
|
||||
auto resized_content_bitmap = TRY(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, new_size));
|
||||
auto resized_content_bitmap = TRY(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, new_size));
|
||||
{
|
||||
Gfx::Painter painter(resized_content_bitmap);
|
||||
|
||||
|
@ -250,7 +250,7 @@ ErrorOr<void> Layer::resize(Gfx::IntSize new_size, Gfx::IntPoint new_location, G
|
|||
}
|
||||
|
||||
if (m_mask_bitmap) {
|
||||
auto dst = TRY(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, new_size));
|
||||
auto dst = TRY(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, new_size));
|
||||
Gfx::Painter painter(dst);
|
||||
|
||||
if (scaling_mode == Gfx::Painter::ScalingMode::None) {
|
||||
|
@ -290,7 +290,7 @@ void Layer::update_cached_bitmap()
|
|||
}
|
||||
|
||||
if (m_cached_display_bitmap.ptr() == m_content_bitmap.ptr() || m_cached_display_bitmap->size() != size()) {
|
||||
m_cached_display_bitmap = MUST(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, size()));
|
||||
m_cached_display_bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, size()));
|
||||
}
|
||||
|
||||
// FIXME: This can probably be done nicer
|
||||
|
@ -307,7 +307,7 @@ void Layer::update_cached_bitmap()
|
|||
|
||||
void Layer::create_mask()
|
||||
{
|
||||
m_mask_bitmap = MUST(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, size()));
|
||||
m_mask_bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, size()));
|
||||
m_mask_bitmap->fill(Gfx::Color::White);
|
||||
update_cached_bitmap();
|
||||
}
|
||||
|
|
|
@ -611,7 +611,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
|
|||
}));
|
||||
m_image_menu->add_separator();
|
||||
|
||||
m_image_menu->add_action(GUI::Action::create("Rotate Image &Counterclockwise", { Mod_Ctrl | Mod_Shift, Key_LessThan }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-ccw.png"sv)),
|
||||
m_image_menu->add_action(GUI::Action::create("Rotate Image &Counterclockwise", { Mod_Ctrl | Mod_Shift, Key_LessThan }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-rotate-ccw.png"sv)),
|
||||
[&](auto&) {
|
||||
auto* editor = current_image_editor();
|
||||
VERIFY(editor);
|
||||
|
@ -623,7 +623,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
|
|||
editor->did_complete_action("Rotate Image Counterclockwise"sv);
|
||||
}));
|
||||
|
||||
m_image_menu->add_action(GUI::Action::create("Rotate Image Clock&wise", { Mod_Ctrl | Mod_Shift, Key_GreaterThan }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-cw.png"sv)),
|
||||
m_image_menu->add_action(GUI::Action::create("Rotate Image Clock&wise", { Mod_Ctrl | Mod_Shift, Key_GreaterThan }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-rotate-cw.png"sv)),
|
||||
[&](auto&) {
|
||||
auto* editor = current_image_editor();
|
||||
VERIFY(editor);
|
||||
|
@ -910,7 +910,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
|
|||
}));
|
||||
m_layer_menu->add_separator();
|
||||
|
||||
m_layer_menu->add_action(GUI::Action::create("Rotate Layer &Counterclockwise", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-ccw.png"sv)),
|
||||
m_layer_menu->add_action(GUI::Action::create("Rotate Layer &Counterclockwise", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-rotate-ccw.png"sv)),
|
||||
[&](auto&) {
|
||||
auto* editor = current_image_editor();
|
||||
VERIFY(editor);
|
||||
|
@ -925,7 +925,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
|
|||
editor->did_complete_action("Rotate Layer Counterclockwise"sv);
|
||||
}));
|
||||
|
||||
m_layer_menu->add_action(GUI::Action::create("Rotate Layer Clock&wise", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-cw.png"sv)),
|
||||
m_layer_menu->add_action(GUI::Action::create("Rotate Layer Clock&wise", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-rotate-cw.png"sv)),
|
||||
[&](auto&) {
|
||||
auto* editor = current_image_editor();
|
||||
VERIFY(editor);
|
||||
|
|
|
@ -55,7 +55,7 @@ ToolboxWidget::ToolboxWidget()
|
|||
void ToolboxWidget::setup_tools()
|
||||
{
|
||||
auto add_tool = [&](StringView icon_name, GUI::Shortcut const& shortcut, NonnullOwnPtr<Tool> tool, bool is_default_tool = false) {
|
||||
auto action = GUI::Action::create_checkable(tool->tool_name(), shortcut, Gfx::Bitmap::try_load_from_file(DeprecatedString::formatted("/res/icons/pixelpaint/{}.png", icon_name)).release_value_but_fixme_should_propagate_errors(),
|
||||
auto action = GUI::Action::create_checkable(tool->tool_name(), shortcut, Gfx::Bitmap::load_from_file(DeprecatedString::formatted("/res/icons/pixelpaint/{}.png", icon_name)).release_value_but_fixme_should_propagate_errors(),
|
||||
[this, tool = tool.ptr()](auto& action) {
|
||||
if (action.is_checked()) {
|
||||
on_tool_selection(tool);
|
||||
|
|
|
@ -189,7 +189,7 @@ NonnullRefPtr<Gfx::Bitmap> BrushTool::build_cursor()
|
|||
m_scale_last_created_cursor = m_editor ? m_editor->scale() : 1;
|
||||
auto scaled_size = size() * m_scale_last_created_cursor;
|
||||
auto containing_box_size = 2 * scaled_size;
|
||||
NonnullRefPtr<Gfx::Bitmap> new_cursor = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, Gfx::IntSize(containing_box_size, containing_box_size)).release_value_but_fixme_should_propagate_errors();
|
||||
NonnullRefPtr<Gfx::Bitmap> new_cursor = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, Gfx::IntSize(containing_box_size, containing_box_size)).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
Gfx::Painter painter { new_cursor };
|
||||
Gfx::AntiAliasingPainter aa_painter { painter };
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace PixelPaint {
|
|||
|
||||
BucketTool::BucketTool()
|
||||
{
|
||||
m_cursor = Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/bucket.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_cursor = Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/bucket.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
static void flood_fill(Gfx::Bitmap& bitmap, Gfx::IntPoint start_position, Color fill_color, int threshold)
|
||||
|
|
|
@ -144,7 +144,7 @@ NonnullRefPtr<Gfx::Bitmap> EraseTool::build_cursor()
|
|||
m_scale_last_created_cursor = m_editor ? m_editor->scale() : 1;
|
||||
int scaled_size = size() * m_scale_last_created_cursor;
|
||||
|
||||
NonnullRefPtr<Gfx::Bitmap> new_cursor = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, Gfx::IntSize(scaled_size, scaled_size)).release_value_but_fixme_should_propagate_errors();
|
||||
NonnullRefPtr<Gfx::Bitmap> new_cursor = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, Gfx::IntSize(scaled_size, scaled_size)).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
Gfx::IntRect rect { 0, 0, scaled_size, scaled_size };
|
||||
Gfx::Painter painter { new_cursor };
|
||||
|
|
|
@ -135,7 +135,7 @@ void GuideTool::on_context_menu(Layer*, GUI::ContextMenuEvent& event)
|
|||
if (!m_context_menu) {
|
||||
m_context_menu = GUI::Menu::construct();
|
||||
m_context_menu->add_action(GUI::Action::create(
|
||||
"Set &Offset", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/gear.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
"Set &Offset", Gfx::Bitmap::load_from_file("/res/icons/16x16/gear.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
if (!m_context_menu_guide)
|
||||
return;
|
||||
auto dialog = EditGuideDialog::construct(
|
||||
|
@ -153,7 +153,7 @@ void GuideTool::on_context_menu(Layer*, GUI::ContextMenuEvent& event)
|
|||
},
|
||||
editor()));
|
||||
m_context_menu->add_action(GUI::Action::create(
|
||||
"&Delete Guide", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/delete.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
"&Delete Guide", Gfx::Bitmap::load_from_file("/res/icons/16x16/delete.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
if (!m_context_menu_guide)
|
||||
return;
|
||||
editor()->remove_guide(*m_context_menu_guide);
|
||||
|
|
|
@ -28,7 +28,7 @@ void LassoSelectTool::on_mousedown(Layer* layer, MouseEvent& event)
|
|||
if (!layer->rect().contains(layer_event.position()))
|
||||
return;
|
||||
|
||||
auto selection_bitmap_result = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, layer->content_bitmap().size());
|
||||
auto selection_bitmap_result = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, layer->content_bitmap().size());
|
||||
if (selection_bitmap_result.is_error())
|
||||
return;
|
||||
|
||||
|
@ -99,7 +99,7 @@ void LassoSelectTool::on_mouseup(Layer*, MouseEvent&)
|
|||
auto cropped_selection = cropped_selection_result.release_value();
|
||||
|
||||
// We create a bitmap that is bigger by 1 pixel on each side
|
||||
auto lasso_bitmap_or_error = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { (m_bottom_right.x() - m_top_left.x()) + 2, (m_bottom_right.y() - m_top_left.y()) + 2 });
|
||||
auto lasso_bitmap_or_error = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, { (m_bottom_right.x() - m_top_left.x()) + 2, (m_bottom_right.y() - m_top_left.y()) + 2 });
|
||||
if (lasso_bitmap_or_error.is_error())
|
||||
return;
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ ErrorOr<void> MoveTool::update_cached_preview_bitmap(Layer const* layer)
|
|||
auto const& source_bitmap = layer->content_bitmap();
|
||||
auto preview_bitmap_size = editor_rect_size.contains(source_bitmap.size()) ? source_bitmap.size() : editor_rect_size;
|
||||
|
||||
m_cached_preview_bitmap = TRY(Gfx::Bitmap::try_create(source_bitmap.format(), preview_bitmap_size));
|
||||
m_cached_preview_bitmap = TRY(Gfx::Bitmap::create(source_bitmap.format(), preview_bitmap_size));
|
||||
GUI::Painter preview_painter(*m_cached_preview_bitmap);
|
||||
preview_painter.draw_scaled_bitmap(m_cached_preview_bitmap->rect(), source_bitmap, source_bitmap.rect(), 0.8f, Gfx::Painter::ScalingMode::BilinearBlend);
|
||||
Gfx::ContrastFilter preview_filter(0.5f);
|
||||
|
|
|
@ -57,7 +57,7 @@ void PolygonalSelectTool::process_polygon()
|
|||
|
||||
// We create a bitmap that is bigger by 1 pixel on each side (+2) and need to account for the 0 indexed
|
||||
// pixel positions (+1) so we make the bitmap size the delta of x/y min/max + 3.
|
||||
auto polygon_bitmap_or_error = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { (max_x_seen - min_x_seen) + 3, (max_y_seen - min_y_seen) + 3 });
|
||||
auto polygon_bitmap_or_error = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, { (max_x_seen - min_x_seen) + 3, (max_y_seen - min_y_seen) + 3 });
|
||||
if (polygon_bitmap_or_error.is_error())
|
||||
return;
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ void TextTool::on_second_paint(Layer const* layer, GUI::PaintEvent& event)
|
|||
// Since ImageEditor can be zoomed in/out, we need to be able to render the preview properly scaled
|
||||
// GUI::Painter doesn't have a way to draw a font scaled directly, so we draw the text to a bitmap
|
||||
// and then scale the bitmap and blit the result to the ImageEditor.
|
||||
auto text_bitmap_result = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { text_width, text_height });
|
||||
auto text_bitmap_result = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, { text_width, text_height });
|
||||
if (text_bitmap_result.is_error())
|
||||
return;
|
||||
auto text_bitmap = text_bitmap_result.release_value();
|
||||
|
|
|
@ -60,7 +60,7 @@ ErrorOr<void> VectorscopeWidget::rebuild_vectorscope_data()
|
|||
|
||||
void VectorscopeWidget::rebuild_vectorscope_image()
|
||||
{
|
||||
m_vectorscope_image = MUST(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, size()));
|
||||
m_vectorscope_image = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, size()));
|
||||
m_vectorscope_image->fill(Color::Transparent);
|
||||
|
||||
Gfx::Painter base_painter(*m_vectorscope_image);
|
||||
|
|
|
@ -69,24 +69,24 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
|
|||
})));
|
||||
|
||||
auto presentation_menu = TRY(window->try_add_menu("&Presentation"));
|
||||
m_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&) {
|
||||
m_next_slide_action = GUI::Action::create("&Next", { KeyCode::Key_Right }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv)), [this](auto&) {
|
||||
if (m_current_presentation) {
|
||||
m_current_presentation->next_frame();
|
||||
update_web_view();
|
||||
update_slides_actions();
|
||||
}
|
||||
});
|
||||
m_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&) {
|
||||
m_previous_slide_action = GUI::Action::create("&Previous", { KeyCode::Key_Left }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv)), [this](auto&) {
|
||||
if (m_current_presentation) {
|
||||
m_current_presentation->previous_frame();
|
||||
update_web_view();
|
||||
update_slides_actions();
|
||||
}
|
||||
});
|
||||
m_full_screen_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&) {
|
||||
m_full_screen_action = GUI::Action::create("&Full Screen", { KeyModifier::Mod_Shift, KeyCode::Key_F5 }, { KeyCode::Key_F11 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/fullscreen.png"sv)), [this](auto&) {
|
||||
this->window()->set_fullscreen(true);
|
||||
});
|
||||
m_present_from_first_slide_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&) {
|
||||
m_present_from_first_slide_action = GUI::Action::create("Present From First &Slide", { KeyCode::Key_F5 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/play.png"sv)), [this](auto&) {
|
||||
if (m_current_presentation) {
|
||||
m_current_presentation->go_to_first_slide();
|
||||
update_web_view();
|
||||
|
|
|
@ -36,7 +36,7 @@ void AlbumCoverVisualizationWidget::paint_event(GUI::PaintEvent& event)
|
|||
painter.draw_scaled_bitmap(fitted_rect, *cover, cover->rect(), 1.0f);
|
||||
} else {
|
||||
if (!m_serenity_bg)
|
||||
m_serenity_bg = Gfx::Bitmap::try_load_from_file("/res/wallpapers/sunset-retro.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_serenity_bg = Gfx::Bitmap::load_from_file("/res/wallpapers/sunset-retro.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
painter.draw_scaled_bitmap(frame_inner_rect(), *m_serenity_bg, m_serenity_bg->rect(), 1.0f);
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ ErrorOr<NonnullRefPtr<Gfx::Bitmap>> AlbumCoverVisualizationWidget::get_album_cov
|
|||
for (auto& it : possible_cover_filenames) {
|
||||
LexicalPath cover_path = LexicalPath::join(directory, it);
|
||||
if (Core::File::exists(cover_path.string()))
|
||||
return Gfx::Bitmap::try_load_from_file(cover_path.string());
|
||||
return Gfx::Bitmap::load_from_file(cover_path.string());
|
||||
}
|
||||
|
||||
return Error::from_string_literal("No cover file found");
|
||||
|
|
|
@ -42,11 +42,11 @@ SoundPlayerWidgetAdvancedView::SoundPlayerWidgetAdvancedView(GUI::Window& window
|
|||
|
||||
m_player_view->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
m_play_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/play.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_pause_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/pause.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_stop_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/stop.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_back_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_next_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_play_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/play.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_pause_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/pause.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_stop_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/stop.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_back_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_next_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
m_visualization = m_player_view->add<BarsVisualizationWidget>();
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
|
||||
help_menu.add_action(GUI::CommonActions::make_about_action(APP_NAME, app_icon, window));
|
||||
|
||||
auto open_icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png"sv));
|
||||
auto open_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv));
|
||||
// Configure the nodes context menu.
|
||||
auto open_folder_action = GUI::Action::create("Open Folder", { Mod_Ctrl, Key_O }, open_icon, [&](auto&) {
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme(get_absolute_path_to_selected_node(treemapwidget)));
|
||||
|
@ -199,7 +199,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
Desktop::Launcher::open(URL::create_with_file_scheme(path.dirname(), path.basename()));
|
||||
});
|
||||
|
||||
auto copy_icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png"sv));
|
||||
auto copy_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"sv));
|
||||
auto copy_path_action = GUI::Action::create("Copy Path to Clipboard", { Mod_Ctrl, Key_C }, copy_icon, [&](auto&) {
|
||||
GUI::Clipboard::the().set_plain_text(get_absolute_path_to_selected_node(treemapwidget));
|
||||
});
|
||||
|
|
|
@ -65,7 +65,7 @@ HelpWindow::HelpWindow(GUI::Window* parent)
|
|||
{
|
||||
resize(530, 365);
|
||||
set_title("Spreadsheet Functions Help");
|
||||
set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
auto widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
|
||||
widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
|
|
@ -45,7 +45,7 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, NonnullRefPtrVe
|
|||
current_cell_label.set_fixed_width(50);
|
||||
|
||||
auto& help_button = top_bar.add<GUI::Button>("");
|
||||
help_button.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
help_button.set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
help_button.set_tooltip("Functions Help");
|
||||
help_button.set_fixed_size(20, 20);
|
||||
help_button.on_click = [&](auto) {
|
||||
|
@ -108,7 +108,7 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, NonnullRefPtrVe
|
|||
}
|
||||
});
|
||||
m_tab_context_menu->add_action(*m_rename_action);
|
||||
m_tab_context_menu->add_action(GUI::Action::create("Add new sheet...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new-tab.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
m_tab_context_menu->add_action(GUI::Action::create("Add new sheet...", Gfx::Bitmap::load_from_file("/res/icons/16x16/new-tab.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
DeprecatedString name;
|
||||
if (GUI::InputBox::show(window(), name, "Name for new sheet"sv, "Create sheet"sv) == GUI::Dialog::ExecResult::OK) {
|
||||
NonnullRefPtrVector<Sheet> new_sheets;
|
||||
|
@ -119,7 +119,7 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, NonnullRefPtrVe
|
|||
|
||||
setup_tabs(m_workbook->sheets());
|
||||
|
||||
m_new_action = GUI::Action::create("Add New Sheet", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new-tab.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
m_new_action = GUI::Action::create("Add New Sheet", Gfx::Bitmap::load_from_file("/res/icons/16x16/new-tab.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
add_sheet();
|
||||
});
|
||||
|
||||
|
@ -252,13 +252,13 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, NonnullRefPtrVe
|
|||
m_redo_action->set_enabled(false);
|
||||
|
||||
m_change_background_color_action = GUI::Action::create(
|
||||
"&Change Background Color", { Mod_Ctrl, Key_B }, Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/bucket.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
"&Change Background Color", { Mod_Ctrl, Key_B }, Gfx::Bitmap::load_from_file("/res/icons/pixelpaint/bucket.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
change_cell_static_color_format(Spreadsheet::FormatType::Background);
|
||||
},
|
||||
window());
|
||||
|
||||
m_change_foreground_color_action = GUI::Action::create(
|
||||
"&Change Foreground Color", { Mod_Ctrl, Key_T }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/text-color.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
"&Change Foreground Color", { Mod_Ctrl, Key_T }, Gfx::Bitmap::load_from_file("/res/icons/16x16/text-color.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
change_cell_static_color_format(Spreadsheet::FormatType::Foreground);
|
||||
},
|
||||
window());
|
||||
|
@ -267,7 +267,7 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, NonnullRefPtrVe
|
|||
m_change_foreground_color_action->set_enabled(false);
|
||||
|
||||
m_functions_help_action = GUI::Action::create(
|
||||
"&Functions Help", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
"&Functions Help", Gfx::Bitmap::load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
|
||||
if (auto* worksheet_ptr = current_worksheet_if_available()) {
|
||||
auto docs = worksheet_ptr->gather_documentation();
|
||||
auto help_window = Spreadsheet::HelpWindow::the(window());
|
||||
|
|
|
@ -26,10 +26,10 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
|
|||
layout()->set_margins(4);
|
||||
set_fill_with_background_color(true);
|
||||
|
||||
m_network_connected_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/network-connected.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_network_disconnected_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/network-disconnected.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_network_connected_bitmap = Gfx::Bitmap::load_from_file("/res/icons/16x16/network-connected.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_network_disconnected_bitmap = Gfx::Bitmap::load_from_file("/res/icons/16x16/network-disconnected.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
m_network_link_down_bitmap = Gfx::Bitmap::try_create(m_network_connected_bitmap->format(), m_network_connected_bitmap->size()).release_value_but_fixme_should_propagate_errors();
|
||||
m_network_link_down_bitmap = Gfx::Bitmap::create(m_network_connected_bitmap->format(), m_network_connected_bitmap->size()).release_value_but_fixme_should_propagate_errors();
|
||||
{
|
||||
Gfx::Painter painter(*m_network_link_down_bitmap);
|
||||
painter.blit_filtered(Gfx::IntPoint {}, *m_network_connected_bitmap, m_network_connected_bitmap->rect(), [](Color color) {
|
||||
|
@ -75,7 +75,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
|
|||
m_adapter_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_adapter_model)));
|
||||
m_adapter_context_menu = MUST(GUI::Menu::try_create());
|
||||
m_adapter_context_menu->add_action(GUI::Action::create(
|
||||
"Open in Network Settings...", MUST(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/network.png"sv)), [this](GUI::Action&) {
|
||||
"Open in Network Settings...", MUST(Gfx::Bitmap::load_from_file("/res/icons/16x16/network.png"sv)), [this](GUI::Action&) {
|
||||
m_adapter_table_view->selection().for_each_index([this](GUI::ModelIndex const& index) {
|
||||
auto adapter_name = index.sibling_at_column(1).data().as_string();
|
||||
GUI::Process::spawn_or_show_error(window(), "/bin/Escalator"sv, Array { "/bin/NetworkSettings", adapter_name.characters() });
|
||||
|
|
|
@ -345,7 +345,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
};
|
||||
|
||||
auto kill_action = GUI::Action::create(
|
||||
"&Kill Process", { Mod_Ctrl, Key_K }, { Key_Delete }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/kill.png"sv)), [&](const GUI::Action&) {
|
||||
"&Kill Process", { Mod_Ctrl, Key_K }, { Key_Delete }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/kill.png"sv)), [&](const GUI::Action&) {
|
||||
pid_t pid = selected_id(ProcessModel::Column::PID);
|
||||
if (pid == -1)
|
||||
return;
|
||||
|
@ -356,7 +356,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
&process_table_view);
|
||||
|
||||
auto stop_action = GUI::Action::create(
|
||||
"&Stop Process", { Mod_Ctrl, Key_S }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/stop-hand.png"sv)), [&](const GUI::Action&) {
|
||||
"&Stop Process", { Mod_Ctrl, Key_S }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/stop-hand.png"sv)), [&](const GUI::Action&) {
|
||||
pid_t pid = selected_id(ProcessModel::Column::PID);
|
||||
if (pid == -1)
|
||||
return;
|
||||
|
@ -367,7 +367,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
&process_table_view);
|
||||
|
||||
auto continue_action = GUI::Action::create(
|
||||
"&Continue Process", { Mod_Ctrl, Key_C }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/continue.png"sv)), [&](const GUI::Action&) {
|
||||
"&Continue Process", { Mod_Ctrl, Key_C }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/continue.png"sv)), [&](const GUI::Action&) {
|
||||
pid_t pid = selected_id(ProcessModel::Column::PID);
|
||||
if (pid != -1)
|
||||
kill(pid, SIGCONT);
|
||||
|
@ -376,7 +376,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto profile_action = GUI::Action::create(
|
||||
"&Profile Process", { Mod_Ctrl, Key_P },
|
||||
TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-profiler.png"sv)), [&](auto&) {
|
||||
TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-profiler.png"sv)), [&](auto&) {
|
||||
pid_t pid = selected_id(ProcessModel::Column::PID);
|
||||
if (pid == -1)
|
||||
return;
|
||||
|
|
|
@ -190,10 +190,10 @@ static ErrorOr<NonnullRefPtr<GUI::Window>> create_find_window(VT::TerminalWidget
|
|||
find_textbox->set_text(terminal.selected_text().replace("\n"sv, " "sv, ReplaceMode::All));
|
||||
auto find_backwards = TRY(find->try_add<GUI::Button>());
|
||||
find_backwards->set_fixed_width(25);
|
||||
find_backwards->set_icon(TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/upward-triangle.png"sv)));
|
||||
find_backwards->set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/upward-triangle.png"sv)));
|
||||
auto find_forwards = TRY(find->try_add<GUI::Button>());
|
||||
find_forwards->set_fixed_width(25);
|
||||
find_forwards->set_icon(TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png"sv)));
|
||||
find_forwards->set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/downward-triangle.png"sv)));
|
||||
|
||||
find_textbox->on_return_pressed = [find_backwards] {
|
||||
find_backwards->click();
|
||||
|
@ -335,7 +335,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto show_scroll_bar = Config::read_bool("Terminal"sv, "Terminal"sv, "ShowScrollBar"sv, true);
|
||||
terminal->set_show_scrollbar(show_scroll_bar);
|
||||
|
||||
auto open_settings_action = GUI::Action::create("Terminal &Settings", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/settings.png"sv)),
|
||||
auto open_settings_action = GUI::Action::create("Terminal &Settings", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/settings.png"sv)),
|
||||
[&](auto&) {
|
||||
GUI::Process::spawn_or_show_error(window, "/bin/TerminalSettings"sv);
|
||||
});
|
||||
|
@ -344,7 +344,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(terminal->context_menu().try_add_action(open_settings_action));
|
||||
|
||||
auto file_menu = TRY(window->try_add_menu("&File"));
|
||||
TRY(file_menu->try_add_action(GUI::Action::create("Open New &Terminal", { Mod_Ctrl | Mod_Shift, Key_N }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-terminal.png"sv)), [&](auto&) {
|
||||
TRY(file_menu->try_add_action(GUI::Action::create("Open New &Terminal", { Mod_Ctrl | Mod_Shift, Key_N }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"sv)), [&](auto&) {
|
||||
GUI::Process::spawn_or_show_error(window, "/bin/Terminal"sv);
|
||||
})));
|
||||
|
||||
|
@ -394,7 +394,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(edit_menu->try_add_action(terminal->copy_action()));
|
||||
TRY(edit_menu->try_add_action(terminal->paste_action()));
|
||||
TRY(edit_menu->try_add_separator());
|
||||
TRY(edit_menu->try_add_action(GUI::Action::create("&Find...", { Mod_Ctrl | Mod_Shift, Key_F }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find.png"sv)),
|
||||
TRY(edit_menu->try_add_action(GUI::Action::create("&Find...", { Mod_Ctrl | Mod_Shift, Key_F }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv)),
|
||||
[&](auto&) {
|
||||
find_window->show();
|
||||
find_window->move_to_front();
|
||||
|
|
|
@ -105,11 +105,11 @@ MainWidget::MainWidget()
|
|||
};
|
||||
m_wrap_around_checkbox->set_checked(true);
|
||||
|
||||
m_find_next_action = GUI::Action::create("Find &Next", { Mod_Ctrl, Key_G }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find-next.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
m_find_next_action = GUI::Action::create("Find &Next", { Mod_Ctrl, Key_G }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find-next.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
find_text(GUI::TextEditor::SearchDirection::Forward, ShowMessageIfNoResults::Yes);
|
||||
});
|
||||
|
||||
m_find_previous_action = GUI::Action::create("Find Pr&evious", { Mod_Ctrl | Mod_Shift, Key_G }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find-previous.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
m_find_previous_action = GUI::Action::create("Find Pr&evious", { Mod_Ctrl | Mod_Shift, Key_G }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find-previous.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
find_text(GUI::TextEditor::SearchDirection::Backward, ShowMessageIfNoResults::Yes);
|
||||
});
|
||||
|
||||
|
@ -160,11 +160,11 @@ MainWidget::MainWidget()
|
|||
|
||||
m_find_previous_button = *find_descendant_of_type_named<GUI::Button>("find_previous_button");
|
||||
m_find_previous_button->set_action(*m_find_previous_action);
|
||||
m_find_previous_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find-previous.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_find_previous_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/find-previous.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
m_find_next_button = *find_descendant_of_type_named<GUI::Button>("find_next_button");
|
||||
m_find_next_button->set_action(*m_find_next_action);
|
||||
m_find_next_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find-next.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_find_next_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/find-next.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
m_find_textbox->on_return_pressed = [this] {
|
||||
m_find_next_button->click();
|
||||
|
@ -204,7 +204,7 @@ MainWidget::MainWidget()
|
|||
});
|
||||
m_vim_emulation_setting_action->set_checked(false);
|
||||
|
||||
m_find_replace_action = GUI::Action::create("&Find/Replace...", { Mod_Ctrl | Mod_Shift, Key_F }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
m_find_replace_action = GUI::Action::create("&Find/Replace...", { Mod_Ctrl | Mod_Shift, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
m_find_replace_widget->set_visible(true);
|
||||
m_find_widget->set_visible(true);
|
||||
m_replace_widget->set_visible(true);
|
||||
|
@ -249,7 +249,7 @@ MainWidget::MainWidget()
|
|||
m_editor->on_selection_change = [this] { update_statusbar(); };
|
||||
m_editor->on_highlighter_change = [this] { update_statusbar(); };
|
||||
|
||||
m_new_action = GUI::Action::create("&New", { Mod_Ctrl, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new.png"sv).release_value_but_fixme_should_propagate_errors(), [this](GUI::Action const&) {
|
||||
m_new_action = GUI::Action::create("&New", { Mod_Ctrl, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/new.png"sv).release_value_but_fixme_should_propagate_errors(), [this](GUI::Action const&) {
|
||||
if (editor().document().is_modified()) {
|
||||
auto save_document_first_result = GUI::MessageBox::ask_about_unsaved_changes(window(), m_path, editor().document().undo_stack().last_unmodified_timestamp());
|
||||
if (save_document_first_result == GUI::Dialog::ExecResult::Yes)
|
||||
|
@ -312,7 +312,7 @@ MainWidget::MainWidget()
|
|||
}
|
||||
});
|
||||
|
||||
auto file_manager_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-file-manager.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
auto file_manager_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/app-file-manager.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
m_open_folder_action = GUI::Action::create("Open Containing Folder", { Mod_Ctrl | Mod_Shift, Key_O }, file_manager_icon, [&](auto&) {
|
||||
auto lexical_path = LexicalPath(m_path);
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme(lexical_path.dirname(), lexical_path.basename()));
|
||||
|
@ -452,7 +452,7 @@ void MainWidget::initialize_menubar(GUI::Window& window)
|
|||
|
||||
view_menu.add_separator();
|
||||
|
||||
view_menu.add_action(GUI::Action::create("Editor &Font...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors(),
|
||||
view_menu.add_action(GUI::Action::create("Editor &Font...", Gfx::Bitmap::load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors(),
|
||||
[&](auto&) {
|
||||
auto picker = GUI::FontPicker::construct(&window, &m_editor->font(), false);
|
||||
if (picker->exec() == GUI::Dialog::ExecResult::OK) {
|
||||
|
|
|
@ -48,8 +48,8 @@ ErrorOr<void> VideoPlayerWidget::setup_interface()
|
|||
m_playback_manager->seek_to_timestamp(timestamp);
|
||||
};
|
||||
|
||||
m_play_icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/play.png"sv));
|
||||
m_pause_icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/pause.png"sv));
|
||||
m_play_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/play.png"sv));
|
||||
m_pause_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/pause.png"sv));
|
||||
|
||||
m_play_pause_action = GUI::Action::create("Play", { Key_Space }, m_play_icon, [&](auto&) {
|
||||
toggle_pause();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue