mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +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
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
});
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue