diff options
author | Tim Schumacher <timschumi@gmx.de> | 2023-01-20 20:06:05 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-01-26 20:24:37 +0000 |
commit | 82a152b69602de05a28034864185545207639a8c (patch) | |
tree | 308eb816ef76a6579934786822d39f186bad385b /Userland/Applications/PDFViewer | |
parent | 1971bff31455306b6976fe7e69db851c94a30794 (diff) | |
download | serenity-82a152b69602de05a28034864185545207639a8c.zip |
LibGfx: Remove `try_` prefix from bitmap creation functions
Those don't have any non-try counterpart, so we might as well just omit
it.
Diffstat (limited to 'Userland/Applications/PDFViewer')
-rw-r--r-- | Userland/Applications/PDFViewer/OutlineModel.cpp | 4 | ||||
-rw-r--r-- | Userland/Applications/PDFViewer/PDFViewer.cpp | 2 | ||||
-rw-r--r-- | Userland/Applications/PDFViewer/PDFViewerWidget.cpp | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Applications/PDFViewer/OutlineModel.cpp b/Userland/Applications/PDFViewer/OutlineModel.cpp index 27f5b99b30..2884aae681 100644 --- a/Userland/Applications/PDFViewer/OutlineModel.cpp +++ b/Userland/Applications/PDFViewer/OutlineModel.cpp @@ -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; } diff --git a/Userland/Applications/PDFViewer/PDFViewer.cpp b/Userland/Applications/PDFViewer/PDFViewer.cpp index 746442f386..ae3cc54b3e 100644 --- a/Userland/Applications/PDFViewer/PDFViewer.cpp +++ b/Userland/Applications/PDFViewer/PDFViewer.cpp @@ -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()) { diff --git a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp index d0e5063341..990995856e 100644 --- a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp +++ b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp @@ -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); }); |