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:
Tim Schumacher 2023-01-20 20:06:05 +01:00 committed by Linus Groh
parent 1971bff314
commit 82a152b696
186 changed files with 598 additions and 598 deletions

View file

@ -22,7 +22,7 @@ static Optional<Web::Platform::DecodedImage> decode_image_with_qt(ReadonlyBytes
if (image.isNull())
return {};
image = image.convertToFormat(QImage::Format::Format_ARGB32);
auto bitmap = MUST(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, Gfx::IntSize(image.width(), image.height())));
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, Gfx::IntSize(image.width(), image.height())));
for (int y = 0; y < image.height(); ++y) {
memcpy(bitmap->scanline_u8(y), image.scanLine(y), image.width() * 4);
}

View file

@ -434,13 +434,13 @@ void WebContentView::handle_resize()
if (available_size.is_empty())
return;
if (auto new_bitmap_or_error = Gfx::Bitmap::try_create_shareable(Gfx::BitmapFormat::BGRx8888, available_size); !new_bitmap_or_error.is_error()) {
if (auto new_bitmap_or_error = Gfx::Bitmap::create_shareable(Gfx::BitmapFormat::BGRx8888, available_size); !new_bitmap_or_error.is_error()) {
m_client_state.front_bitmap.bitmap = new_bitmap_or_error.release_value();
m_client_state.front_bitmap.id = m_client_state.next_bitmap_id++;
client().async_add_backing_store(m_client_state.front_bitmap.id, m_client_state.front_bitmap.bitmap->to_shareable_bitmap());
}
if (auto new_bitmap_or_error = Gfx::Bitmap::try_create_shareable(Gfx::BitmapFormat::BGRx8888, available_size); !new_bitmap_or_error.is_error()) {
if (auto new_bitmap_or_error = Gfx::Bitmap::create_shareable(Gfx::BitmapFormat::BGRx8888, available_size); !new_bitmap_or_error.is_error()) {
m_client_state.back_bitmap.bitmap = new_bitmap_or_error.release_value();
m_client_state.back_bitmap.id = m_client_state.next_bitmap_id++;
client().async_add_backing_store(m_client_state.back_bitmap.id, m_client_state.back_bitmap.bitmap->to_shareable_bitmap());

View file

@ -1318,7 +1318,7 @@ index 0000000000000000000000000000000000000000..9c7d4f3f5cedf86ae885330aaf6fae7e
+
+static RefPtr<Gfx::Bitmap> create_bitmap_from_surface(SDL_Surface& icon)
+{
+ auto bitmap_or_error = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, {icon.w, icon.h});
+ auto bitmap_or_error = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, {icon.w, icon.h});
+ if (bitmap_or_error.is_error())
+ return {};
+ auto bitmap = bitmap_or_error.release_value();
@ -1372,7 +1372,7 @@ index 0000000000000000000000000000000000000000..9c7d4f3f5cedf86ae885330aaf6fae7e
+ dbgln("{}: Creating a new framebuffer of size {}x{}", __FUNCTION__, window->w, window->h);
+ auto win = SerenityPlatformWindow::from_sdl_window(window);
+ *format = SDL_PIXELFORMAT_RGB888;
+ auto bitmap_or_error = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, {window->w, window->h});
+ auto bitmap_or_error = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, {window->w, window->h});
+ if (bitmap_or_error.is_error())
+ return SDL_OutOfMemory();
+ win->widget()->m_buffer = bitmap_or_error.release_value();

View file

@ -10,7 +10,7 @@
static NonnullOwnPtr<GL::GLContext> create_testing_context()
{
auto bitmap = MUST(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, { 1, 1 }));
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { 1, 1 }));
auto context = MUST(GL::create_context(*bitmap));
GL::make_context_current(context);
return context;

View file

@ -23,7 +23,7 @@
static NonnullOwnPtr<GL::GLContext> create_testing_context(int width, int height)
{
auto bitmap = MUST(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, { width, height }));
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { width, height }));
auto context = MUST(GL::create_context(*bitmap));
GL::make_context_current(context);
return context;
@ -41,7 +41,7 @@ static void expect_bitmap_equals_reference(Gfx::Bitmap const& bitmap, StringView
}
auto reference_image_path = DeprecatedString::formatted(REFERENCE_IMAGE_DIR "/{}", reference_filename);
auto reference_bitmap = MUST(Gfx::Bitmap::try_load_from_file(reference_image_path));
auto reference_bitmap = MUST(Gfx::Bitmap::load_from_file(reference_image_path));
EXPECT_EQ(reference_bitmap->visually_equals(bitmap), true);
}

View file

@ -14,7 +14,7 @@
static NonnullOwnPtr<GL::GLContext> create_testing_context(int width, int height)
{
auto bitmap = MUST(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, { width, height }));
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { width, height }));
auto context = MUST(GL::create_context(*bitmap));
GL::make_context_current(context);

View file

@ -25,7 +25,7 @@ BENCHMARK_CASE(diagonal_lines)
int const run_count = 50;
int const bitmap_size = 2000;
auto bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, { bitmap_size, bitmap_size }).release_value_but_fixme_should_propagate_errors();
auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { bitmap_size, bitmap_size }).release_value_but_fixme_should_propagate_errors();
Gfx::Painter painter(bitmap);
for (int run = 0; run < run_count; run++) {
@ -41,7 +41,7 @@ BENCHMARK_CASE(fill)
int const run_count = 1000;
int const bitmap_size = 2000;
auto bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, { bitmap_size, bitmap_size }).release_value_but_fixme_should_propagate_errors();
auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { bitmap_size, bitmap_size }).release_value_but_fixme_should_propagate_errors();
Gfx::Painter painter(bitmap);
for (int run = 0; run < run_count; run++) {
@ -54,7 +54,7 @@ BENCHMARK_CASE(fill_with_gradient)
int const run_count = 50;
int const bitmap_size = 2000;
auto bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, { bitmap_size, bitmap_size }).release_value_but_fixme_should_propagate_errors();
auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { bitmap_size, bitmap_size }).release_value_but_fixme_should_propagate_errors();
Gfx::Painter painter(bitmap);
for (int run = 0; run < run_count; run++) {

View file

@ -37,11 +37,11 @@ public:
static ErrorOr<NonnullRefPtr<AudioWidget>> try_create()
{
Array<VolumeBitmapPair, 5> volume_level_bitmaps = {
{ { 66, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/audio-volume-high.png"sv)) },
{ 33, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/audio-volume-medium.png"sv)) },
{ 1, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/audio-volume-low.png"sv)) },
{ 0, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/audio-volume-zero.png"sv)) },
{ 0, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/audio-volume-muted.png"sv)) } }
{ { 66, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/audio-volume-high.png"sv)) },
{ 33, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/audio-volume-medium.png"sv)) },
{ 1, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/audio-volume-low.png"sv)) },
{ 0, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/audio-volume-zero.png"sv)) },
{ 0, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/audio-volume-muted.png"sv)) } }
};
auto audio_client = TRY(Audio::ConnectionToServer::try_create());
NonnullRefPtr<AudioWidget> audio_widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) AudioWidget(move(audio_client), move(volume_level_bitmaps))));

View file

@ -67,7 +67,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
});
});
auto clear_action = GUI::Action::create("Clear history", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/trash-can.png"sv)), [&](const GUI::Action&) {
auto clear_action = GUI::Action::create("Clear history", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/trash-can.png"sv)), [&](const GUI::Action&) {
model->clear();
GUI::Clipboard::the().clear();
});

View file

@ -48,7 +48,7 @@ ErrorOr<void> KeymapStatusWidget::refresh_menu()
m_context_menu->add_separator();
auto settings_icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/settings.png"sv));
auto settings_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/settings.png"sv));
m_context_menu->add_action(GUI::Action::create("Keyboard &Settings",
settings_icon,

View file

@ -24,8 +24,8 @@ class NetworkWidget final : public GUI::ImageWidget {
public:
static ErrorOr<NonnullRefPtr<NetworkWidget>> try_create(bool notifications)
{
NonnullRefPtr<Gfx::Bitmap> connected_icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/network.png"sv));
NonnullRefPtr<Gfx::Bitmap> disconnected_icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/network-disconnected.png"sv));
NonnullRefPtr<Gfx::Bitmap> connected_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/network.png"sv));
NonnullRefPtr<Gfx::Bitmap> disconnected_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/network-disconnected.png"sv));
return adopt_nonnull_ref_or_enomem(new (nothrow) NetworkWidget(notifications, move(connected_icon), move(disconnected_icon)));
}

View file

@ -109,7 +109,7 @@ public:
if (!m_context_menu) {
m_context_menu = GUI::Menu::construct();
auto settings_icon = MUST(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/settings.png"sv));
auto settings_icon = MUST(Gfx::Bitmap::load_from_file("/res/icons/16x16/settings.png"sv));
auto open_workspace_settings_action = GUI::Action::create("Workspace &Settings", *settings_icon, [](auto&) {
auto result = Core::Process::spawn("/bin/DisplaySettings"sv, Array { "--open-tab", "workspaces" }.span());
if (result.is_error()) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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/{}/{}",

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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) {

View file

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

View file

@ -49,7 +49,7 @@ ErrorOr<NonnullRefPtr<CatDog>> CatDog::create()
auto catdog = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) CatDog));
for (auto const& image_source : image_sources)
TRY(catdog->m_images.try_append({ image_source.state, *TRY(Gfx::Bitmap::try_load_from_file(image_source.path)) }));
TRY(catdog->m_images.try_append({ image_source.state, *TRY(Gfx::Bitmap::load_from_file(image_source.path)) }));
return catdog;
}

View file

@ -34,7 +34,7 @@ private:
Screensaver::Screensaver(int width, int height, int interval)
{
on_screensaver_exit = []() { GUI::Application::the()->quit(); };
m_bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, { width, height }).release_value_but_fixme_should_propagate_errors();
m_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { width, height }).release_value_but_fixme_should_propagate_errors();
srand(time(nullptr));
stop_timer();
start_timer(interval);

View file

@ -39,7 +39,7 @@ private:
Canvas::Canvas()
{
m_bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, { WIDTH, HEIGHT }).release_value_but_fixme_should_propagate_errors();
m_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { WIDTH, HEIGHT }).release_value_but_fixme_should_propagate_errors();
draw();
}
@ -107,7 +107,7 @@ void Canvas::draw()
painter.draw_line({ 740, 140 }, { 640, 240 }, Color::Red, 5, Gfx::Painter::LineStyle::Solid);
painter.draw_line({ 690, 140 }, { 640, 240 }, Color::Blue, 10, Gfx::Painter::LineStyle::Solid);
auto bg = Gfx::Bitmap::try_load_from_file("/res/html/misc/90s-bg.png"sv).release_value_but_fixme_should_propagate_errors();
auto bg = Gfx::Bitmap::load_from_file("/res/html/misc/90s-bg.png"sv).release_value_but_fixme_should_propagate_errors();
painter.draw_tiled_bitmap({ 20, 260, 480, 320 }, *bg);
painter.draw_line({ 40, 480 }, { 20, 260 }, Color::Red);
@ -128,7 +128,7 @@ void Canvas::draw()
path.close();
painter.fill_path(path, Color::Yellow, Gfx::Painter::WindingRule::EvenOdd);
auto buggie = Gfx::Bitmap::try_load_from_file("/res/graphics/buggie.png"sv).release_value_but_fixme_should_propagate_errors();
auto buggie = Gfx::Bitmap::load_from_file("/res/graphics/buggie.png"sv).release_value_but_fixme_should_propagate_errors();
painter.blit({ 280, 280 }, *buggie, buggie->rect(), 0.5);
painter.draw_scaled_bitmap({ 360, 280, buggie->rect().width() * 2, buggie->rect().height() * 2 }, *buggie, buggie->rect());

View file

@ -44,15 +44,15 @@ private:
Canvas::Canvas()
{
m_bitmap_1x = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { WIDTH, HEIGHT }, 1).release_value_but_fixme_should_propagate_errors();
m_bitmap_2x = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { WIDTH, HEIGHT }, 2).release_value_but_fixme_should_propagate_errors();
m_bitmap_1x = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, { WIDTH, HEIGHT }, 1).release_value_but_fixme_should_propagate_errors();
m_bitmap_2x = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, { WIDTH, HEIGHT }, 2).release_value_but_fixme_should_propagate_errors();
// m_bitmap_1x and m_bitmap_2x have the same logical size, so LibGfx will try to draw them at the same physical size:
// When drawing on a 2x backing store it'd scale m_bitmap_1x up 2x and paint m_bitmap_2x at its physical size.
// When drawing on a 1x backing store it'd draw m_bitmap_1x at its physical size, and it would have to scale down m_bitmap_2x to 0.5x its size.
// But the system can't current scale down, and we want to draw the 2x bitmap at twice the size of the 1x bitmap in this particular application,
// so make a 1x alias of the 2x bitmap to make LibGfx paint it without any scaling at paint time, mapping once pixel to one pixel.
m_bitmap_2x_as_1x = Gfx::Bitmap::try_create_wrapper(Gfx::BitmapFormat::BGRA8888, m_bitmap_2x->physical_size(), 1, m_bitmap_2x->pitch(), m_bitmap_2x->scanline(0)).release_value_but_fixme_should_propagate_errors();
m_bitmap_2x_as_1x = Gfx::Bitmap::create_wrapper(Gfx::BitmapFormat::BGRA8888, m_bitmap_2x->physical_size(), 1, m_bitmap_2x->pitch(), m_bitmap_2x->scanline(0)).release_value_but_fixme_should_propagate_errors();
Gfx::Painter painter_1x(*m_bitmap_1x);
draw(painter_1x);
@ -74,7 +74,7 @@ void Canvas::paint_event(GUI::PaintEvent& event)
void Canvas::draw(Gfx::Painter& painter)
{
auto active_window_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window.png"sv).release_value_but_fixme_should_propagate_errors();
auto active_window_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/window.png"sv).release_value_but_fixme_should_propagate_errors();
Gfx::WindowTheme::current().paint_normal_frame(painter, Gfx::WindowTheme::WindowState::Active, Gfx::WindowTheme::WindowMode::Other, { 4, 18, WIDTH - 8, HEIGHT - 29 }, "Well hello friends 🐞"sv, *active_window_icon, palette(), { WIDTH - 20, 6, 16, 16 }, 0, false);
@ -83,7 +83,7 @@ void Canvas::draw(Gfx::Painter& painter)
painter.draw_rect({ 24, 38, WIDTH - 48, HEIGHT - 53 }, palette().color(Gfx::ColorRole::Selection));
// buggie.png has an alpha channel.
auto buggie = Gfx::Bitmap::try_load_from_file("/res/graphics/buggie.png"sv).release_value_but_fixme_should_propagate_errors();
auto buggie = Gfx::Bitmap::load_from_file("/res/graphics/buggie.png"sv).release_value_but_fixme_should_propagate_errors();
painter.blit({ 25, 39 }, *buggie, { 2, 30, 62, 20 });
painter.draw_scaled_bitmap({ 88, 39, 62 * 2, 20 * 2 }, *buggie, Gfx::IntRect { 2, 30, 62, 20 });
painter.draw_scaled_bitmap({ 202, 39, 80, 40 }, *buggie, Gfx::IntRect { 2, 30, 62, 20 });
@ -93,7 +93,7 @@ void Canvas::draw(Gfx::Painter& painter)
painter.blit({ 25, 101 }, *buggie, { 2, 30, 3 * buggie->width(), 20 });
// grid does not have an alpha channel.
auto grid = Gfx::Bitmap::try_load_from_file("/res/wallpapers/grid.png"sv).release_value_but_fixme_should_propagate_errors();
auto grid = Gfx::Bitmap::load_from_file("/res/wallpapers/grid.png"sv).release_value_but_fixme_should_propagate_errors();
VERIFY(!grid->has_alpha_channel());
painter.fill_rect({ 25, 122, 62, 20 }, Color::Green);
painter.blit({ 25, 122 }, *grid, { (grid->width() - 62) / 2, (grid->height() - 20) / 2 + 40, 62, 20 }, 0.9);

View file

@ -39,7 +39,7 @@ public:
void resize(Gfx::IntSize size)
{
m_bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, size).release_value_but_fixme_should_propagate_errors();
m_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, size).release_value_but_fixme_should_propagate_errors();
correct_aspect();
calculate();
}
@ -444,7 +444,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::MessageBox::show_error(window, DeprecatedString::formatted("{}", result.error()));
})));
export_submenu.set_icon(TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save.png"sv)));
export_submenu.set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"sv)));
TRY(file_menu->try_add_separator());
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));

View file

@ -47,8 +47,8 @@ ErrorOr<void> GalleryWidget::load_basic_model_tab()
m_add_new_item = *tab->find_descendant_of_type_named<GUI::Button>("add_new_item");
m_remove_selected_item = *tab->find_descendant_of_type_named<GUI::Button>("remove_selected_item");
m_add_new_item->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/plus.png"sv).release_value_but_fixme_should_propagate_errors());
m_remove_selected_item->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/minus.png"sv).release_value_but_fixme_should_propagate_errors());
m_add_new_item->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/plus.png"sv).release_value_but_fixme_should_propagate_errors());
m_remove_selected_item->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/minus.png"sv).release_value_but_fixme_should_propagate_errors());
m_new_item_name->on_return_pressed = [&] { add_textbox_contents_to_basic_model(); };
m_add_new_item->on_click = [&](auto) { add_textbox_contents_to_basic_model(); };

View file

@ -63,7 +63,7 @@ Starfield::Starfield(int interval)
ErrorOr<void> Starfield::create_stars(int width, int height, int stars)
{
m_bitmap = TRY(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, { width, height }));
m_bitmap = TRY(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { width, height }));
m_stars.grow_capacity(stars);
for (int i = 0; i < stars; i++) {

View file

@ -124,7 +124,7 @@ void Tubes::choose_new_direction_for_tube(Tube& tube)
ErrorOr<void> Tubes::create_buffer(Gfx::IntSize size)
{
m_bitmap = TRY(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, size));
m_bitmap = TRY(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, size));
m_gl_context = TRY(GL::create_context(*m_bitmap));
return {};
}

View file

@ -73,7 +73,7 @@ public:
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);
@ -158,7 +158,7 @@ public:
if (!path.contains("filetype-"sv) && !path.contains("app-"sv))
continue;
IconSet icon_set;
icon_set.big_icon = Gfx::Bitmap::try_load_from_file(path).release_value_but_fixme_should_propagate_errors();
icon_set.big_icon = Gfx::Bitmap::load_from_file(path).release_value_but_fixme_should_propagate_errors();
icon_set.name = LexicalPath::basename(path);
m_icon_sets.append(move(icon_set));
}
@ -172,7 +172,7 @@ public:
if (!path.contains("filetype-"sv) && !path.contains("app-"sv))
continue;
IconSet icon_set;
icon_set.little_icon = Gfx::Bitmap::try_load_from_file(path).release_value_but_fixme_should_propagate_errors();
icon_set.little_icon = Gfx::Bitmap::load_from_file(path).release_value_but_fixme_should_propagate_errors();
icon_set.name = LexicalPath::basename(path);
for (size_t i = 0; i < big_icons_found; i++) {
if (icon_set.name == m_icon_sets[i].name) {

View file

@ -73,9 +73,9 @@ GalleryWidget::GalleryWidget()
m_label_frame->set_frame_thickness(value);
};
m_button_icons.append(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/book-open.png"sv).release_value_but_fixme_should_propagate_errors());
m_button_icons.append(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors());
m_button_icons.append(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/ladybug.png"sv).release_value_but_fixme_should_propagate_errors());
m_button_icons.append(Gfx::Bitmap::load_from_file("/res/icons/16x16/book-open.png"sv).release_value_but_fixme_should_propagate_errors());
m_button_icons.append(Gfx::Bitmap::load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors());
m_button_icons.append(Gfx::Bitmap::load_from_file("/res/icons/16x16/ladybug.png"sv).release_value_but_fixme_should_propagate_errors());
m_icon_button = basics_tab->find_descendant_of_type_named<GUI::Button>("icon_button");
m_icon_button->set_icon(*m_button_icons[2]);
@ -95,7 +95,7 @@ GalleryWidget::GalleryWidget()
m_text_editor = basics_tab->find_descendant_of_type_named<GUI::TextEditor>("text_editor");
m_font_button = basics_tab->find_descendant_of_type_named<GUI::Button>("font_button");
m_font_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors());
m_font_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors());
m_font_button->on_click = [&](auto) {
auto picker = GUI::FontPicker::try_create(window(), &m_text_editor->font(), false).release_value_but_fixme_should_propagate_errors();
@ -105,7 +105,7 @@ GalleryWidget::GalleryWidget()
};
m_file_button = basics_tab->find_descendant_of_type_named<GUI::Button>("file_button");
m_file_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors());
m_file_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors());
m_file_button->on_click = [&](auto) {
auto response = FileSystemAccessClient::Client::the().open_file(window());
@ -115,7 +115,7 @@ GalleryWidget::GalleryWidget()
};
m_input_button = basics_tab->find_descendant_of_type_named<GUI::Button>("input_button");
m_input_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/properties.png"sv).release_value_but_fixme_should_propagate_errors());
m_input_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/properties.png"sv).release_value_but_fixme_should_propagate_errors());
m_input_button->on_click = [&](auto) {
DeprecatedString value;
@ -133,7 +133,7 @@ GalleryWidget::GalleryWidget()
};
m_msgbox_button = basics_tab->find_descendant_of_type_named<GUI::Button>("msgbox_button");
m_msgbox_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-browser.png"sv).release_value_but_fixme_should_propagate_errors());
m_msgbox_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-browser.png"sv).release_value_but_fixme_should_propagate_errors());
m_msgbox_type = GUI::MessageBox::Type::None;
m_msgbox_input_type = GUI::MessageBox::InputType::OK;

View file

@ -215,7 +215,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(edit_menu->try_add_action(editor->go_to_line_action()));
TRY(edit_menu->try_add_separator());
auto format_gml_action = GUI::Action::create("&Format GML", { Mod_Ctrl | Mod_Shift, Key_I }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/reformat.png"sv)), [&](auto&) {
auto format_gml_action = GUI::Action::create("&Format GML", { Mod_Ctrl | Mod_Shift, Key_I }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reformat.png"sv)), [&](auto&) {
auto formatted_gml_or_error = GUI::GML::format_gml(editor->text());
if (!formatted_gml_or_error.is_error()) {
editor->replace_all_text_without_resetting_undo_stack(formatted_gml_or_error.release_value());

View file

@ -24,19 +24,19 @@ namespace HackStudio {
ErrorOr<void> DebugInfoWidget::init_toolbar()
{
m_continue_action = GUI::Action::create("Continue", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-continue.png"sv)), [](auto&) {
m_continue_action = GUI::Action::create("Continue", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-continue.png"sv)), [](auto&) {
Debugger::the().set_requested_debugger_action(Debugger::DebuggerAction::Continue);
});
m_singlestep_action = GUI::Action::create("Step Over", { Mod_None, Key_F10 }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-step-over.png"sv)), [](auto&) {
m_singlestep_action = GUI::Action::create("Step Over", { Mod_None, Key_F10 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-step-over.png"sv)), [](auto&) {
Debugger::the().set_requested_debugger_action(Debugger::DebuggerAction::SourceStepOver);
});
m_step_in_action = GUI::Action::create("Step In", { Mod_None, Key_F11 }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-step-in.png"sv)), [](auto&) {
m_step_in_action = GUI::Action::create("Step In", { Mod_None, Key_F11 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-step-in.png"sv)), [](auto&) {
Debugger::the().set_requested_debugger_action(Debugger::DebuggerAction::SourceSingleStep);
});
m_step_out_action = GUI::Action::create("Step Out", { Mod_Shift, Key_F11 }, TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-step-out.png"sv)), [](auto&) {
m_step_out_action = GUI::Action::create("Step Out", { Mod_Shift, Key_F11 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-step-out.png"sv)), [](auto&) {
Debugger::the().set_requested_debugger_action(Debugger::DebuggerAction::SourceStepOut);
});

View file

@ -33,7 +33,7 @@ private:
, m_regs(regs)
, m_inspector(inspector)
{
m_variable_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors());
m_variable_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors());
}
NonnullOwnPtrVector<Debug::DebugInfo::VariableInfo> m_variables;
PtraceRegisters m_regs;

View file

@ -470,13 +470,13 @@ void Editor::clear_execution_position()
Gfx::Bitmap const& Editor::breakpoint_icon_bitmap()
{
static auto bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/breakpoint.png"sv).release_value_but_fixme_should_propagate_errors();
static auto bitmap = Gfx::Bitmap::load_from_file("/res/icons/16x16/breakpoint.png"sv).release_value_but_fixme_should_propagate_errors();
return *bitmap;
}
Gfx::Bitmap const& Editor::current_position_icon_bitmap()
{
static auto bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors();
static auto bitmap = Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors();
return *bitmap;
}

View file

@ -32,7 +32,7 @@ GitWidget::GitWidget()
unstaged_header.set_layout<GUI::HorizontalBoxLayout>();
auto& refresh_button = unstaged_header.add<GUI::Button>();
refresh_button.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/reload.png"sv).release_value_but_fixme_should_propagate_errors());
refresh_button.set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv).release_value_but_fixme_should_propagate_errors());
refresh_button.set_fixed_size(16, 16);
refresh_button.set_tooltip("refresh");
refresh_button.on_click = [this](int) { refresh(); };
@ -43,7 +43,7 @@ GitWidget::GitWidget()
unstaged_header.set_fixed_height(20);
m_unstaged_files = unstaged.add<GitFilesView>(
[this](auto const& file) { stage_file(file); },
Gfx::Bitmap::try_load_from_file("/res/icons/16x16/plus.png"sv).release_value_but_fixme_should_propagate_errors());
Gfx::Bitmap::load_from_file("/res/icons/16x16/plus.png"sv).release_value_but_fixme_should_propagate_errors());
m_unstaged_files->on_selection_change = [this] {
const auto& index = m_unstaged_files->selection().first();
if (!index.is_valid())
@ -60,7 +60,7 @@ GitWidget::GitWidget()
staged_header.set_layout<GUI::HorizontalBoxLayout>();
auto& commit_button = staged_header.add<GUI::Button>();
commit_button.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/commit.png"sv).release_value_but_fixme_should_propagate_errors());
commit_button.set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/commit.png"sv).release_value_but_fixme_should_propagate_errors());
commit_button.set_fixed_size(16, 16);
commit_button.set_tooltip("commit");
commit_button.on_click = [this](int) { commit(); };
@ -71,7 +71,7 @@ GitWidget::GitWidget()
staged_header.set_fixed_height(20);
m_staged_files = staged.add<GitFilesView>(
[this](auto const& file) { unstage_file(file); },
Gfx::Bitmap::try_load_from_file("/res/icons/16x16/minus.png"sv).release_value_but_fixme_should_propagate_errors());
Gfx::Bitmap::load_from_file("/res/icons/16x16/minus.png"sv).release_value_but_fixme_should_propagate_errors());
}
bool GitWidget::initialize()

View file

@ -500,7 +500,7 @@ ErrorOr<NonnullRefPtr<GUI::Menu>> HackStudioWidget::create_project_tree_view_con
for (auto& new_file_action : m_new_file_actions) {
new_file_submenu.add_action(new_file_action);
}
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/new.png"sv));
new_file_submenu.set_icon(icon);
new_file_submenu.add_action(*m_new_plain_file_action);
new_file_submenu.add_separator();
@ -519,7 +519,7 @@ ErrorOr<NonnullRefPtr<GUI::Menu>> HackStudioWidget::create_project_tree_view_con
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_new_file_action(DeprecatedString const& label, DeprecatedString const& icon, DeprecatedString const& extension)
{
auto icon_no_shadow = TRY(Gfx::Bitmap::try_load_from_file(icon));
auto icon_no_shadow = TRY(Gfx::Bitmap::load_from_file(icon));
return GUI::Action::create(label, icon_no_shadow, [this, extension](const GUI::Action&) {
DeprecatedString filename;
if (GUI::InputBox::show(window(), filename, "Enter name of new file:"sv, "Add new file to project"sv) != GUI::InputBox::ExecResult::OK)
@ -561,7 +561,7 @@ ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_new_file_action(Dep
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_new_directory_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/mkdir.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/mkdir.png"sv));
return GUI::Action::create("&Directory...", { Mod_Ctrl | Mod_Shift, Key_N }, icon, [this](const GUI::Action&) {
DeprecatedString directory_name;
if (GUI::InputBox::show(window(), directory_name, "Enter name of new directory:"sv, "Add new folder to project"sv) != GUI::InputBox::ExecResult::OK)
@ -598,7 +598,7 @@ ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_open_selected_actio
for (auto& file : files)
open_file(file);
});
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv));
open_selected_action->set_icon(icon);
open_selected_action->set_enabled(true);
return open_selected_action;
@ -705,7 +705,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_delete_action()
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_new_project_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/hackstudio-project.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/hackstudio-project.png"sv));
return GUI::Action::create(
"&Project...", icon,
[this](const GUI::Action&) {
@ -856,7 +856,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_switch_to_previous_editor_ac
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_remove_current_editor_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/remove-editor.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/remove-editor.png"sv));
return GUI::Action::create("&Remove Current Editor", { Mod_Alt | Mod_Shift, Key_E }, icon, [this](auto&) {
if (m_all_editor_wrappers.size() <= 1)
return;
@ -870,7 +870,7 @@ ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_remove_current_edit
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_open_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv));
return GUI::Action::create("&Open Project...", { Mod_Ctrl | Mod_Shift, Key_O }, icon, [this](auto&) {
auto open_path = GUI::FilePicker::get_open_filepath(window(), "Open project", m_project->root_path(), true);
if (!open_path.has_value())
@ -937,7 +937,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_save_as_action()
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_remove_current_terminal_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/remove-terminal.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/remove-terminal.png"sv));
return GUI::Action::create("Remove &Current Terminal", { Mod_Alt | Mod_Shift, Key_T }, icon, [this](auto&) {
auto widget = m_action_tab_widget->active_widget();
if (!widget)
@ -963,7 +963,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_add_editor_tab_widget_action
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_add_editor_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/add-editor.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/add-editor.png"sv));
return GUI::Action::create("Add New &Editor", { Mod_Ctrl | Mod_Alt, Key_E },
icon,
[this](auto&) {
@ -974,7 +974,7 @@ ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_add_editor_action()
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_add_terminal_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/add-terminal.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/add-terminal.png"sv));
return GUI::Action::create("Add New &Terminal", { Mod_Ctrl | Mod_Alt, Key_T },
icon,
[this](auto&) {
@ -999,7 +999,7 @@ void HackStudioWidget::reveal_action_tab(GUI::Widget& widget)
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_debug_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-run.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-run.png"sv));
return GUI::Action::create("&Debug", icon, [this](auto&) {
if (!Core::File::exists(get_project_executable_path())) {
GUI::MessageBox::show(window(), DeprecatedString::formatted("Could not find file: {}. (did you build the project?)", get_project_executable_path()), "Error"sv, GUI::MessageBox::Type::Error);
@ -1298,7 +1298,7 @@ void HackStudioWidget::create_toolbar(GUI::Widget& parent)
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_build_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/build.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/build.png"sv));
return GUI::Action::create("&Build", { Mod_Ctrl, Key_B }, icon, [this](auto&) {
if (warn_unsaved_changes("There are unsaved changes, do you want to save before building?") == ContinueDecision::No)
return;
@ -1310,7 +1310,7 @@ ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_build_action()
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_run_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/program-run.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/program-run.png"sv));
return GUI::Action::create("&Run", { Mod_Ctrl, Key_R }, icon, [this](auto&) {
reveal_action_tab(*m_terminal_wrapper);
run();
@ -1415,7 +1415,7 @@ ErrorOr<void> HackStudioWidget::create_file_menu(GUI::Window& window)
}
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/new.png"sv));
new_submenu.set_icon(icon);
}
new_submenu.add_action(*m_new_plain_file_action);
@ -1425,7 +1425,7 @@ ErrorOr<void> HackStudioWidget::create_file_menu(GUI::Window& window)
file_menu.add_action(*m_open_action);
m_recent_projects_submenu = &file_menu.add_submenu("Open &Recent");
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open-recent.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/open-recent.png"sv));
m_recent_projects_submenu->set_icon(icon);
}
update_recent_projects_submenu();
@ -1441,7 +1441,7 @@ ErrorOr<void> HackStudioWidget::create_file_menu(GUI::Window& window)
ErrorOr<void> HackStudioWidget::create_edit_menu(GUI::Window& window)
{
auto& edit_menu = window.add_menu("&Edit");
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/find.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv));
edit_menu.add_action(GUI::Action::create("&Find in Files...", { Mod_Ctrl | Mod_Shift, Key_F }, icon, [this](auto&) {
reveal_action_tab(*m_find_in_files_widget);
m_find_in_files_widget->focus_textbox_and_select_all();
@ -1524,7 +1524,7 @@ ErrorOr<void> HackStudioWidget::create_view_menu(GUI::Window& window)
m_no_wrapping_action->set_checked(true);
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-font-editor.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-font-editor.png"sv));
m_editor_font_action = GUI::Action::create("Editor &Font...", icon,
[&](auto&) {
auto picker = GUI::FontPicker::construct(&window, m_editor_font, false);
@ -1564,7 +1564,7 @@ void HackStudioWidget::create_help_menu(GUI::Window& window)
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_stop_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/program-stop.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/program-stop.png"sv));
auto action = GUI::Action::create("&Stop", icon, [this](auto&) {
if (!Debugger::the().session()) {
if (auto result = m_terminal_wrapper->kill_running_command(); result.is_error())
@ -1734,7 +1734,7 @@ void HackStudioWidget::on_cursor_change()
ErrorOr<void> HackStudioWidget::create_location_history_actions()
{
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv));
m_locations_history_back_action = GUI::Action::create("Go Back", { Mod_Alt | Mod_Shift, Key_Left }, icon, [this](auto&) {
if (m_locations_history_end_index <= 1)
return;
@ -1751,7 +1751,7 @@ ErrorOr<void> HackStudioWidget::create_location_history_actions()
}
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv));
m_locations_history_forward_action = GUI::Action::create("Go Forward", { Mod_Alt | Mod_Shift, Key_Right }, icon, [this](auto&) {
if (m_locations_history_end_index == m_locations_history.size())
return;
@ -1772,7 +1772,7 @@ ErrorOr<void> HackStudioWidget::create_location_history_actions()
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_open_project_configuration_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/settings.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/settings.png"sv));
return GUI::Action::create("Project Configuration", icon, [&](auto&) {
auto parent_directory = LexicalPath::dirname(Project::config_file_path);
auto absolute_config_file_path = LexicalPath::absolute_path(m_project->root_path(), Project::config_file_path);
@ -1876,7 +1876,7 @@ void HackStudioWidget::for_each_open_file(Function<void(ProjectFile const&)> fun
ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_toggle_syntax_highlighting_mode_action()
{
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-cplusplus.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-cplusplus.png"sv));
auto action = GUI::Action::create_checkable("&Semantic Highlighting", icon, [this](auto& action) {
for (auto& editor_wrapper : m_all_editor_wrappers)
editor_wrapper.editor().set_semantic_syntax_highlighting(action.is_checked());

View file

@ -211,7 +211,7 @@ void ConnectionToServerWrapper::on_crash()
void ConnectionToServerWrapper::show_frequent_crashes_notification() const
{
auto notification = GUI::Notification::construct();
notification->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/app-hack-studio.png"sv).release_value_but_fixme_should_propagate_errors());
notification->set_icon(Gfx::Bitmap::load_from_file("/res/icons/32x32/app-hack-studio.png"sv).release_value_but_fixme_should_propagate_errors());
notification->set_title("LanguageServer Crashes too much!");
notification->set_text("LanguageServer aided features will not be available in this session");
notification->show();
@ -219,7 +219,7 @@ void ConnectionToServerWrapper::show_frequent_crashes_notification() const
void ConnectionToServerWrapper::show_crash_notification() const
{
auto notification = GUI::Notification::construct();
notification->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/app-hack-studio.png"sv).release_value_but_fixme_should_propagate_errors());
notification->set_icon(Gfx::Bitmap::load_from_file("/res/icons/32x32/app-hack-studio.png"sv).release_value_but_fixme_should_propagate_errors());
notification->set_title("Oops!");
notification->set_text(DeprecatedString::formatted("LanguageServer has crashed"));
notification->show();

View file

@ -20,13 +20,13 @@ void HackStudio::ProjectDeclarations::set_declared_symbols(DeprecatedString cons
Optional<GUI::Icon> HackStudio::ProjectDeclarations::get_icon_for(CodeComprehension::DeclarationType type)
{
static GUI::Icon struct_icon(Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/Struct.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon class_icon(Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/Class.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon function_icon(Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/Function.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon variable_icon(Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/Variable.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon preprocessor_icon(Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/Preprocessor.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon member_icon(Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/Member.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon namespace_icon(Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/Namespace.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon struct_icon(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/Struct.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon class_icon(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/Class.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon function_icon(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/Function.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon variable_icon(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/Variable.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon preprocessor_icon(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/Preprocessor.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon member_icon(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/Member.png"sv).release_value_but_fixme_should_propagate_errors());
static GUI::Icon namespace_icon(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/Namespace.png"sv).release_value_but_fixme_should_propagate_errors());
switch (type) {
case CodeComprehension::DeclarationType::Struct:
return struct_icon;

View file

@ -53,7 +53,7 @@ RefPtr<ProjectTemplate> ProjectTemplate::load_from_manifest(DeprecatedString con
auto bitmap_path_32 = DeprecatedString::formatted("/res/icons/hackstudio/templates-32x32/{}.png", config->read_entry("HackStudioTemplate", "IconName32x"));
if (Core::File::exists(bitmap_path_32)) {
auto bitmap_or_error = Gfx::Bitmap::try_load_from_file(bitmap_path_32);
auto bitmap_or_error = Gfx::Bitmap::load_from_file(bitmap_path_32);
if (!bitmap_or_error.is_error())
icon = GUI::Icon(bitmap_or_error.release_value());
}

View file

@ -44,7 +44,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = GUI::Window::construct();
window->resize(840, 600);
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-hack-studio.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-hack-studio.png"sv));
window->set_icon(icon);
update_path_environment_variable();
@ -115,7 +115,7 @@ static bool make_is_available()
static ErrorOr<void> notify_make_not_available()
{
auto notification = GUI::Notification::construct();
auto icon = TRY(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/app-hack-studio.png"sv));
auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/32x32/app-hack-studio.png"sv));
notification->set_icon(icon);
notification->set_title("'make' Not Available");
notification->set_text("You probably want to install the binutils, gcc, and make ports from the root of the Serenity repository");

View file

@ -17,10 +17,10 @@ namespace Inspector {
RemoteObjectGraphModel::RemoteObjectGraphModel(RemoteProcess& process)
: m_process(process)
{
m_object_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors());
m_window_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window.png"sv).release_value_but_fixme_should_propagate_errors());
m_layout_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/layout.png"sv).release_value_but_fixme_should_propagate_errors());
m_timer_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/timer.png"sv).release_value_but_fixme_should_propagate_errors());
m_object_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors());
m_window_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/window.png"sv).release_value_but_fixme_should_propagate_errors());
m_layout_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/layout.png"sv).release_value_but_fixme_should_propagate_errors());
m_timer_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/timer.png"sv).release_value_but_fixme_should_propagate_errors());
}
GUI::ModelIndex RemoteObjectGraphModel::index(int row, int column, const GUI::ModelIndex& parent) const

View file

@ -130,7 +130,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto properties_tree_view_context_menu = TRY(GUI::Menu::try_create("Properties Tree View"));
auto copy_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png"sv).release_value_but_fixme_should_propagate_errors();
auto copy_bitmap = Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"sv).release_value_but_fixme_should_propagate_errors();
auto copy_property_name_action = GUI::Action::create("Copy Property Name", copy_bitmap, [&](auto&) {
GUI::Clipboard::the().set_plain_text(properties_tree_view.selection().first().data().to_deprecated_string());
});

View file

@ -13,7 +13,7 @@ static Gfx::Bitmap const& heat_gradient()
{
static RefPtr<Gfx::Bitmap> bitmap;
if (!bitmap) {
bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, { 101, 1 }).release_value_but_fixme_should_propagate_errors();
bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { 101, 1 }).release_value_but_fixme_should_propagate_errors();
GUI::Painter painter(*bitmap);
painter.fill_rect_with_gradient(Orientation::Horizontal, bitmap->rect(), Color::from_rgb(0xffc080), Color::from_rgb(0xff3000));
}

View file

@ -16,8 +16,8 @@ namespace Profiler {
ProfileModel::ProfileModel(Profile& profile)
: m_profile(profile)
{
m_user_frame_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors());
m_kernel_frame_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object-red.png"sv).release_value_but_fixme_should_propagate_errors());
m_user_frame_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors());
m_kernel_frame_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/inspector-object-red.png"sv).release_value_but_fixme_should_propagate_errors());
}
GUI::ModelIndex ProfileModel::index(int row, int column, GUI::ModelIndex const& parent) const

View file

@ -14,8 +14,8 @@ namespace Profiler {
SamplesModel::SamplesModel(Profile& profile)
: m_profile(profile)
{
m_user_frame_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors());
m_kernel_frame_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object-red.png"sv).release_value_but_fixme_should_propagate_errors());
m_user_frame_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors());
m_kernel_frame_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/inspector-object-red.png"sv).release_value_but_fixme_should_propagate_errors());
}
int SamplesModel::row_count(GUI::ModelIndex const&) const

View file

@ -170,12 +170,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
update_source_model();
};
auto disassembly_action = GUI::Action::create_checkable("Show &Disassembly", { Mod_Ctrl, Key_D }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/x86.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto& action) {
auto disassembly_action = GUI::Action::create_checkable("Show &Disassembly", { Mod_Ctrl, Key_D }, Gfx::Bitmap::load_from_file("/res/icons/16x16/x86.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto& action) {
disassembly_view->set_visible(action.is_checked());
update_disassembly_model();
});
auto source_action = GUI::Action::create_checkable("Show &Source", { Mod_Ctrl, Key_S }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/x86.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto& action) {
auto source_action = GUI::Action::create_checkable("Show &Source", { Mod_Ctrl, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/x86.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto& action) {
source_view->set_visible(action.is_checked());
update_source_model();
});
@ -315,7 +315,7 @@ static bool prompt_to_stop_profiling(pid_t pid, DeprecatedString const& process_
auto window = GUI::Window::construct();
window->set_title(DeprecatedString::formatted("Profiling {}({})", process_name, pid));
window->resize(240, 100);
window->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-profiler.png"sv).release_value_but_fixme_should_propagate_errors());
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-profiler.png"sv).release_value_but_fixme_should_propagate_errors());
window->center_on_screen();
auto widget = window->set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
@ -344,7 +344,7 @@ static bool prompt_to_stop_profiling(pid_t pid, DeprecatedString const& process_
bool generate_profile(pid_t& pid)
{
if (!pid) {
auto process_chooser = GUI::ProcessChooser::construct("Profiler"sv, "Profile"sv, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-profiler.png"sv).release_value_but_fixme_should_propagate_errors());
auto process_chooser = GUI::ProcessChooser::construct("Profiler"sv, "Profile"sv, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-profiler.png"sv).release_value_but_fixme_should_propagate_errors());
if (process_chooser->exec() == GUI::Dialog::ExecResult::Cancel)
return false;
pid = process_chooser->pid();

View file

@ -63,7 +63,7 @@ MainWidget::MainWidget()
{
load_from_gml(sql_studio_gml).release_value_but_fixme_should_propagate_errors();
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](auto&) {
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](auto&) {
open_new_script();
});
@ -149,7 +149,7 @@ MainWidget::MainWidget()
update_editor_actions(editor);
});
m_connect_to_database_action = GUI::Action::create("Connect to Database"sv, { Mod_Alt, Key_C }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
m_connect_to_database_action = GUI::Action::create("Connect to Database"sv, { Mod_Alt, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
auto database_name = m_databases_combo_box->text().trim_whitespace();
if (database_name.is_empty())
return;
@ -171,7 +171,7 @@ MainWidget::MainWidget()
}
});
m_run_script_action = GUI::Action::create("Run script", { Mod_Alt, Key_F9 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/play.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
m_run_script_action = GUI::Action::create("Run script", { Mod_Alt, Key_F9 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/play.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
m_results.clear();
m_current_line_for_parsing = 0;
read_next_sql_statement_of_editor();

Some files were not shown because too many files have changed in this diff Show more