mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
LibGfx: Remove try_
prefix from bitmap creation functions
Those don't have any non-try counterpart, so we might as well just omit it.
This commit is contained in:
parent
1971bff314
commit
82a152b696
186 changed files with 598 additions and 598 deletions
|
@ -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);
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue