mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 06:32:44 +00:00 
			
		
		
		
	Base+Userland: Apply Human Interface Guidelines to Object text
Corrects a slew of titles, buttons, labels, menu items and status bars for capitalization, ellipses and punctuation. Rewords a few actions and dialogs to use uniform language and punctuation.
This commit is contained in:
		
							parent
							
								
									024360e604
								
							
						
					
					
						commit
						02d94a303c
					
				
					 77 changed files with 195 additions and 188 deletions
				
			
		|  | @ -1,4 +1,4 @@ | ||||||
| [App] | [App] | ||||||
| Name=Game Of Life | Name=Game of Life | ||||||
| Executable=/bin/GameOfLife | Executable=/bin/GameOfLife | ||||||
| Category=Games | Category=Games | ||||||
|  |  | ||||||
|  | @ -73,13 +73,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     auto debug_dump_action = GUI::Action::create("Dump to debug console", [&](const GUI::Action&) { |     auto debug_dump_action = GUI::Action::create("Dump to Debug Console", [&](const GUI::Action&) { | ||||||
|         table_view->selection().for_each_index([&](GUI::ModelIndex& index) { |         table_view->selection().for_each_index([&](GUI::ModelIndex& index) { | ||||||
|             dbgln("{}", model->data(index, GUI::ModelRole::Display).as_string()); |             dbgln("{}", model->data(index, GUI::ModelRole::Display).as_string()); | ||||||
|         }); |         }); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     auto clear_action = GUI::Action::create("Clear history", TRY(Gfx::Bitmap::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(); |         model->clear(); | ||||||
|         GUI::Clipboard::the().clear(); |         GUI::Clipboard::the().clear(); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|  | @ -289,7 +289,7 @@ void BrowserWindow::build_menus() | ||||||
|     m_change_homepage_action = GUI::Action::create( |     m_change_homepage_action = GUI::Action::create( | ||||||
|         "Set Homepage URL...", g_icon_bag.go_home, [this](auto&) { |         "Set Homepage URL...", g_icon_bag.go_home, [this](auto&) { | ||||||
|             String homepage_url = String::from_deprecated_string(Config::read_string("Browser"sv, "Preferences"sv, "Home"sv, "about:blank"sv)).release_value_but_fixme_should_propagate_errors(); |             String homepage_url = String::from_deprecated_string(Config::read_string("Browser"sv, "Preferences"sv, "Home"sv, "about:blank"sv)).release_value_but_fixme_should_propagate_errors(); | ||||||
|             if (GUI::InputBox::show(this, homepage_url, "Enter URL"sv, "Change homepage URL"sv) == GUI::InputBox::ExecResult::OK) { |             if (GUI::InputBox::show(this, homepage_url, "Enter a URL:"sv, "Change Homepage"sv) == GUI::InputBox::ExecResult::OK) { | ||||||
|                 if (URL(homepage_url).is_valid()) { |                 if (URL(homepage_url).is_valid()) { | ||||||
|                     Config::write_string("Browser"sv, "Preferences"sv, "Home"sv, homepage_url); |                     Config::write_string("Browser"sv, "Preferences"sv, "Home"sv, homepage_url); | ||||||
|                     Browser::g_home_url = homepage_url.to_deprecated_string(); |                     Browser::g_home_url = homepage_url.to_deprecated_string(); | ||||||
|  | @ -326,7 +326,7 @@ void BrowserWindow::build_menus() | ||||||
|             m_color_scheme_actions.add_action(action); |             m_color_scheme_actions.add_action(action); | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         add_color_scheme_action("Follow system theme", Web::CSS::PreferredColorScheme::Auto); |         add_color_scheme_action("Follow System Theme", Web::CSS::PreferredColorScheme::Auto); | ||||||
|         add_color_scheme_action("Light", Web::CSS::PreferredColorScheme::Light); |         add_color_scheme_action("Light", Web::CSS::PreferredColorScheme::Light); | ||||||
|         add_color_scheme_action("Dark", Web::CSS::PreferredColorScheme::Dark); |         add_color_scheme_action("Dark", Web::CSS::PreferredColorScheme::Dark); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -850,7 +850,7 @@ void Tab::show_storage_inspector() | ||||||
|     if (!m_storage_widget) { |     if (!m_storage_widget) { | ||||||
|         auto storage_window = GUI::Window::construct(&window()); |         auto storage_window = GUI::Window::construct(&window()); | ||||||
|         storage_window->resize(500, 300); |         storage_window->resize(500, 300); | ||||||
|         storage_window->set_title("Storage inspector"); |         storage_window->set_title("Storage Inspector"); | ||||||
|         storage_window->set_icon(g_icon_bag.cookie); |         storage_window->set_icon(g_icon_bag.cookie); | ||||||
|         m_storage_widget = storage_window->set_main_widget<StorageWidget>().release_value_but_fixme_should_propagate_errors(); |         m_storage_widget = storage_window->set_main_widget<StorageWidget>().release_value_but_fixme_should_propagate_errors(); | ||||||
|         m_storage_widget->on_update_cookie = [this](Web::Cookie::Cookie cookie) { |         m_storage_widget->on_update_cookie = [this](Web::Cookie::Cookie cookie) { | ||||||
|  |  | ||||||
|  | @ -54,7 +54,7 @@ ErrorOr<NonnullRefPtr<AutoplaySettingsWidget>> AutoplaySettingsWidget::create() | ||||||
|     widget->m_add_website_button->on_click = [widget](unsigned) { |     widget->m_add_website_button->on_click = [widget](unsigned) { | ||||||
|         String text; |         String text; | ||||||
| 
 | 
 | ||||||
|         if (GUI::InputBox::show(widget->window(), text, "Website:"sv, "Add website to autoplay allowlist"sv, GUI::InputType::NonemptyText) == GUI::Dialog::ExecResult::OK) { |         if (GUI::InputBox::show(widget->window(), text, "Enter a website:"sv, "Add Autoplay Entry"sv, GUI::InputType::NonemptyText) == GUI::Dialog::ExecResult::OK) { | ||||||
|             widget->m_allowlist_model->add_domain(move(text)); |             widget->m_allowlist_model->add_domain(move(text)); | ||||||
|             widget->set_modified(true); |             widget->set_modified(true); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -10,7 +10,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Autoplay Allowlist" |         title: "Autoplay allowlist" | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [8] |             margins: [8] | ||||||
|         } |         } | ||||||
|  | @ -28,7 +28,7 @@ | ||||||
|             @GUI::Button { |             @GUI::Button { | ||||||
|                 name: "add_website_button" |                 name: "add_website_button" | ||||||
|                 fixed_width: 100 |                 fixed_width: 100 | ||||||
|                 text: "Add website..." |                 text: "Add Website..." | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -49,7 +49,7 @@ | ||||||
|                     } |                     } | ||||||
| 
 | 
 | ||||||
|                     @GUI::Label { |                     @GUI::Label { | ||||||
|                         text: "New Tab:" |                         text: "New tab:" | ||||||
|                         text_alignment: "CenterLeft" |                         text_alignment: "CenterLeft" | ||||||
|                         fixed_width: 45 |                         fixed_width: 45 | ||||||
|                     } |                     } | ||||||
|  |  | ||||||
|  | @ -142,7 +142,7 @@ ErrorOr<NonnullRefPtr<ContentFilterSettingsWidget>> ContentFilterSettingsWidget: | ||||||
|     widget->m_add_new_domain_button->on_click = [widget](unsigned) { |     widget->m_add_new_domain_button->on_click = [widget](unsigned) { | ||||||
|         String text; |         String text; | ||||||
| 
 | 
 | ||||||
|         if (GUI::InputBox::show(widget->window(), text, "Domain:"sv, "Add domain to Content Filter"sv, GUI::InputType::NonemptyText) == GUI::Dialog::ExecResult::OK) { |         if (GUI::InputBox::show(widget->window(), text, "Enter a domain:"sv, "Add Content Filter"sv, GUI::InputType::NonemptyText) == GUI::Dialog::ExecResult::OK) { | ||||||
|             widget->m_domain_list_model->add_domain(move(text)); |             widget->m_domain_list_model->add_domain(move(text)); | ||||||
|             widget->set_modified(true); |             widget->set_modified(true); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -10,7 +10,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Domain List" |         title: "Domain list" | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [8] |             margins: [8] | ||||||
|         } |         } | ||||||
|  | @ -28,7 +28,7 @@ | ||||||
|             @GUI::Button { |             @GUI::Button { | ||||||
|                 name: "add_new_domain_button" |                 name: "add_new_domain_button" | ||||||
|                 fixed_width: 100 |                 fixed_width: 100 | ||||||
|                 text: "Add domain..." |                 text: "Add Domain..." | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -78,7 +78,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     Optional<unsigned> last_rounding_mode = 1; |     Optional<unsigned> last_rounding_mode = 1; | ||||||
|     for (unsigned i {}; i < rounding_modes.size(); ++i) { |     for (unsigned i {}; i < rounding_modes.size(); ++i) { | ||||||
|         auto round_action = GUI::Action::create_checkable(DeprecatedString::formatted("To &{} digits", rounding_modes[i]), |         auto round_action = GUI::Action::create_checkable(DeprecatedString::formatted("To &{} Digits", rounding_modes[i]), | ||||||
|             [&widget, rounding_mode = rounding_modes[i], &last_rounding_mode, i](auto&) { |             [&widget, rounding_mode = rounding_modes[i], &last_rounding_mode, i](auto&) { | ||||||
|                 widget->set_rounding_length(rounding_mode); |                 widget->set_rounding_length(rounding_mode); | ||||||
|                 last_rounding_mode = i; |                 last_rounding_mode = i; | ||||||
|  | @ -88,10 +88,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|         round_menu.add_action(*round_action); |         round_menu.add_action(*round_action); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     constexpr auto format { "&Custom - {} ..."sv }; |     constexpr auto format { "&Custom - {}..."sv }; | ||||||
|     auto round_custom = GUI::Action::create_checkable(DeprecatedString::formatted(format, 0), [&](auto& action) { |     auto round_custom = GUI::Action::create_checkable(DeprecatedString::formatted(format, 0), [&](auto& action) { | ||||||
|         int custom_rounding_length = widget->rounding_length(); |         int custom_rounding_length = widget->rounding_length(); | ||||||
|         auto result = GUI::InputBox::show_numeric(window, custom_rounding_length, 0, 100, "Round to"sv); |         auto result = GUI::InputBox::show_numeric(window, custom_rounding_length, 0, 100, "Digits to Round"sv); | ||||||
|         if (!result.is_error() && result.value() == GUI::Dialog::ExecResult::OK) { |         if (!result.is_error() && result.value() == GUI::Dialog::ExecResult::OK) { | ||||||
|             action.set_text(DeprecatedString::formatted(format, custom_rounding_length)); |             action.set_text(DeprecatedString::formatted(format, custom_rounding_length)); | ||||||
|             widget->set_rounding_length(custom_rounding_length); |             widget->set_rounding_length(custom_rounding_length); | ||||||
|  | @ -105,7 +105,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     auto shrink_action = GUI::Action::create("&Shrink...", TRY(Gfx::Bitmap::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&) { | ||||||
|         int shrink_length = widget->rounding_length(); |         int shrink_length = widget->rounding_length(); | ||||||
|         auto result = GUI::InputBox::show_numeric(window, shrink_length, 0, 100, "Shrink to"sv); |         auto result = GUI::InputBox::show_numeric(window, shrink_length, 0, 100, "Digits to Shrink"sv); | ||||||
|         if (!result.is_error() && result.value() == GUI::Dialog::ExecResult::OK) { |         if (!result.is_error() && result.value() == GUI::Dialog::ExecResult::OK) { | ||||||
|             round_custom->set_checked(true); |             round_custom->set_checked(true); | ||||||
|             round_custom->set_text(DeprecatedString::formatted(format, shrink_length)); |             round_custom->set_text(DeprecatedString::formatted(format, shrink_length)); | ||||||
|  |  | ||||||
|  | @ -106,7 +106,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     if (default_view == "Year") |     if (default_view == "Year") | ||||||
|         view_year_action->set_checked(true); |         view_year_action->set_checked(true); | ||||||
| 
 | 
 | ||||||
|     auto open_settings_action = GUI::Action::create("&Settings", {}, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-settings.png"sv)), [&](GUI::Action const&) { |     auto open_settings_action = GUI::Action::create("Calendar &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); |         GUI::Process::spawn_or_show_error(window, "/bin/CalendarSettings"sv); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Preferred First Day of Week" |         title: "Preferred first day of week" | ||||||
|         fixed_height: 72 |         fixed_height: 72 | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|  | @ -37,7 +37,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Preferred Weekend Configuration" |         title: "Preferred weekend configuration" | ||||||
|         fixed_height: 72 |         fixed_height: 72 | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|  | @ -94,7 +94,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Default View" |         title: "Default view" | ||||||
|         fixed_height: 72 |         fixed_height: 72 | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|  |  | ||||||
|  | @ -92,7 +92,7 @@ ErrorOr<size_t> CertificateStoreModel::add(Vector<Certificate> const& certificat | ||||||
| 
 | 
 | ||||||
| ErrorOr<void> CertificateStoreWidget::import_pem() | ErrorOr<void> CertificateStoreWidget::import_pem() | ||||||
| { | { | ||||||
|     auto fsac_result = FileSystemAccessClient::Client::the().open_file(window(), "Choose PEM to import..."); |     auto fsac_result = FileSystemAccessClient::Client::the().open_file(window(), "Import"); | ||||||
|     if (fsac_result.is_error()) |     if (fsac_result.is_error()) | ||||||
|         return {}; |         return {}; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -37,7 +37,7 @@ CharacterMapWidget::CharacterMapWidget() | ||||||
|     m_statusbar = find_descendant_of_type_named<GUI::Statusbar>("statusbar"); |     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_unicode_block_listview = find_descendant_of_type_named<GUI::ListView>("unicode_block_listview"); | ||||||
| 
 | 
 | ||||||
|     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&) { |     m_choose_font_action = GUI::Action::create("Change &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); |         auto font_picker = GUI::FontPicker::construct(window(), &font(), false); | ||||||
|         if (font_picker->exec() == GUI::Dialog::ExecResult::OK) { |         if (font_picker->exec() == GUI::Dialog::ExecResult::OK) { | ||||||
|             auto& font = *font_picker->font(); |             auto& font = *font_picker->font(); | ||||||
|  | @ -58,7 +58,7 @@ CharacterMapWidget::CharacterMapWidget() | ||||||
|     }); |     }); | ||||||
|     m_copy_selection_action->set_status_tip("Copy the highlighted characters to the clipboard"); |     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::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 Glyph", { 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_glyph_map->select_previous_existing_glyph(); | ||||||
|     }); |     }); | ||||||
|     m_previous_glyph_action->set_status_tip("Seek the previous visible glyph"); |     m_previous_glyph_action->set_status_tip("Seek the previous visible glyph"); | ||||||
|  | @ -68,9 +68,9 @@ CharacterMapWidget::CharacterMapWidget() | ||||||
|     }); |     }); | ||||||
|     m_next_glyph_action->set_status_tip("Seek the next visible 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::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&) { | ||||||
|         String input; |         String input; | ||||||
|         if (GUI::InputBox::show(window(), input, "Hexadecimal:"sv, "Go to glyph"sv, GUI::InputType::NonemptyText) == GUI::InputBox::ExecResult::OK) { |         if (GUI::InputBox::show(window(), input, "Hexadecimal:"sv, "Go to Glyph"sv, GUI::InputType::NonemptyText) == GUI::InputBox::ExecResult::OK) { | ||||||
|             auto maybe_code_point = AK::StringUtils::convert_to_uint_from_hex(input); |             auto maybe_code_point = AK::StringUtils::convert_to_uint_from_hex(input); | ||||||
|             if (!maybe_code_point.has_value()) |             if (!maybe_code_point.has_value()) | ||||||
|                 return; |                 return; | ||||||
|  | @ -83,7 +83,7 @@ CharacterMapWidget::CharacterMapWidget() | ||||||
|     }); |     }); | ||||||
|     m_go_to_glyph_action->set_status_tip("Go to the specified code point"); |     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::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()) { |         if (m_find_window.is_null()) { | ||||||
|             m_find_window = GUI::Window::construct(window()); |             m_find_window = GUI::Window::construct(window()); | ||||||
|             auto search_widget = m_find_window->set_main_widget<CharacterSearchWidget>().release_value_but_fixme_should_propagate_errors(); |             auto search_widget = m_find_window->set_main_widget<CharacterSearchWidget>().release_value_but_fixme_should_propagate_errors(); | ||||||
|  | @ -92,7 +92,7 @@ CharacterMapWidget::CharacterMapWidget() | ||||||
|                 m_glyph_map->scroll_to_glyph(code_point); |                 m_glyph_map->scroll_to_glyph(code_point); | ||||||
|             }; |             }; | ||||||
|             m_find_window->set_icon(GUI::Icon::try_create_default_icon("find"sv).value().bitmap_for_size(16)); |             m_find_window->set_icon(GUI::Icon::try_create_default_icon("find"sv).value().bitmap_for_size(16)); | ||||||
|             m_find_window->set_title("Find a character"); |             m_find_window->set_title("Find a Character"); | ||||||
|             m_find_window->resize(300, 400); |             m_find_window->resize(300, 400); | ||||||
|             m_find_window->set_window_mode(GUI::WindowMode::Modeless); |             m_find_window->set_window_mode(GUI::WindowMode::Modeless); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Time Format" |         title: "Time format" | ||||||
|         shrink_to_fit: false |         shrink_to_fit: false | ||||||
|         fixed_height: 240 |         fixed_height: 240 | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Time Zone Settings" |         title: "Time zone settings" | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [16, 8, 8] |             margins: [16, 8, 8] | ||||||
|             spacing: 14 |             spacing: 14 | ||||||
|  | @ -23,7 +23,7 @@ | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             @GUI::Label { |             @GUI::Label { | ||||||
|                 text: "Time Zone:" |                 text: "Time zone:" | ||||||
|                 fixed_width: 80 |                 fixed_width: 80 | ||||||
|                 name: "time_zone_label" |                 name: "time_zone_label" | ||||||
|                 text_alignment: "CenterLeft" |                 text_alignment: "CenterLeft" | ||||||
|  |  | ||||||
|  | @ -101,7 +101,7 @@ ErrorOr<void> BackgroundSettingsWidget::create_frame() | ||||||
| 
 | 
 | ||||||
|     auto& button = *find_descendant_of_type_named<GUI::Button>("wallpaper_open_button"); |     auto& button = *find_descendant_of_type_named<GUI::Button>("wallpaper_open_button"); | ||||||
|     button.on_click = [this](auto) { |     button.on_click = [this](auto) { | ||||||
|         auto response = FileSystemAccessClient::Client::the().open_file(window(), "Select wallpaper"sv, "/res/wallpapers"sv, Core::File::OpenMode::Read, { { GUI::FileTypeFilter::image_files(), GUI::FileTypeFilter::all_files() } }); |         auto response = FileSystemAccessClient::Client::the().open_file(window(), "Select Wallpaper"sv, "/res/wallpapers"sv, Core::File::OpenMode::Read, { { GUI::FileTypeFilter::image_files(), GUI::FileTypeFilter::all_files() } }); | ||||||
|         if (response.is_error()) |         if (response.is_error()) | ||||||
|             return; |             return; | ||||||
|         m_wallpaper_view->selection().clear(); |         m_wallpaper_view->selection().clear(); | ||||||
|  | @ -123,7 +123,7 @@ ErrorOr<void> BackgroundSettingsWidget::create_frame() | ||||||
| 
 | 
 | ||||||
|     m_color_input = *find_descendant_of_type_named<GUI::ColorInput>("color_input"); |     m_color_input = *find_descendant_of_type_named<GUI::ColorInput>("color_input"); | ||||||
|     m_color_input->set_color_has_alpha_channel(false); |     m_color_input->set_color_has_alpha_channel(false); | ||||||
|     m_color_input->set_color_picker_title("Select color for desktop"); |     m_color_input->set_color_picker_title("Select Desktop Color"); | ||||||
|     bool first_color_change = true; |     bool first_color_change = true; | ||||||
|     m_color_input->on_change = [this, first_color_change]() mutable { |     m_color_input->on_change = [this, first_color_change]() mutable { | ||||||
|         m_monitor_widget->set_background_color(m_color_input->color()); |         m_monitor_widget->set_background_color(m_color_input->color()); | ||||||
|  |  | ||||||
|  | @ -130,9 +130,9 @@ ErrorOr<void> EffectsSettingsWidget::load_settings() | ||||||
|     m_system_effects = { effects, geometry, tile_window }; |     m_system_effects = { effects, geometry, tile_window }; | ||||||
| 
 | 
 | ||||||
|     static constexpr Array geometry_list = { |     static constexpr Array geometry_list = { | ||||||
|         "On Move and Resize"sv, |         "On move and resize"sv, | ||||||
|         "On Move only"sv, |         "On move only"sv, | ||||||
|         "On Resize only"sv, |         "On resize only"sv, | ||||||
|         "Never"sv |         "Never"sv | ||||||
|     }; |     }; | ||||||
|     for (size_t i = 0; i < geometry_list.size(); ++i) |     for (size_t i = 0; i < geometry_list.size(); ++i) | ||||||
|  |  | ||||||
|  | @ -35,7 +35,7 @@ | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [14, 14, 4] |             margins: [14, 14, 4] | ||||||
|         } |         } | ||||||
|         title: "Screen Settings" |         title: "Screen settings" | ||||||
| 
 | 
 | ||||||
|         @GUI::Widget { |         @GUI::Widget { | ||||||
|             preferred_height: "fit" |             preferred_height: "fit" | ||||||
|  |  | ||||||
|  | @ -251,7 +251,7 @@ void MonitorSettingsWidget::apply_settings() | ||||||
|             auto seconds_until_revert = 10; |             auto seconds_until_revert = 10; | ||||||
| 
 | 
 | ||||||
|             auto box_text = [this, &seconds_until_revert]() -> ErrorOr<String> { |             auto box_text = [this, &seconds_until_revert]() -> ErrorOr<String> { | ||||||
|                 auto output = String::formatted("Do you want to keep the new settings? They will be reverted after {} {}.", |                 auto output = String::formatted("Do you want to keep the new screen layout?\nReverting in {} {}.", | ||||||
|                     seconds_until_revert, seconds_until_revert == 1 ? "second" : "seconds"); |                     seconds_until_revert, seconds_until_revert == 1 ? "second" : "seconds"); | ||||||
|                 if (output.is_error()) { |                 if (output.is_error()) { | ||||||
|                     GUI::MessageBox::show_error(window(), "Unable to apply changes"sv); |                     GUI::MessageBox::show_error(window(), "Unable to apply changes"sv); | ||||||
|  | @ -265,7 +265,7 @@ void MonitorSettingsWidget::apply_settings() | ||||||
|                 return; |                 return; | ||||||
|             auto current_box_text = current_box_text_or_error.release_value(); |             auto current_box_text = current_box_text_or_error.release_value(); | ||||||
| 
 | 
 | ||||||
|             auto box = GUI::MessageBox::create(window(), current_box_text, "Apply new screen layout"sv, |             auto box = GUI::MessageBox::create(window(), current_box_text, "Confirm Settings"sv, | ||||||
|                 GUI::MessageBox::Type::Question, GUI::MessageBox::InputType::YesNo) |                 GUI::MessageBox::Type::Question, GUI::MessageBox::InputType::YesNo) | ||||||
|                            .release_value_but_fixme_should_propagate_errors(); |                            .release_value_but_fixme_should_propagate_errors(); | ||||||
|             box->set_icon(window()->icon()); |             box->set_icon(window()->icon()); | ||||||
|  |  | ||||||
|  | @ -8,7 +8,7 @@ | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [14, 14, 4] |             margins: [14, 14, 4] | ||||||
|         } |         } | ||||||
|         title: "Window Theme" |         title: "Window theme" | ||||||
|         fixed_height: 294 |         fixed_height: 294 | ||||||
| 
 | 
 | ||||||
|         @GUI::Frame { |         @GUI::Frame { | ||||||
|  | @ -39,7 +39,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Color Scheme" |         title: "Color scheme" | ||||||
|         preferred_height: "fit" |         preferred_height: "fit" | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [14, 14, 14] |             margins: [14, 14, 14] | ||||||
|  | @ -60,7 +60,7 @@ | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [14, 14, 4] |             margins: [14, 14, 4] | ||||||
|         } |         } | ||||||
|         title: "Cursor Theme" |         title: "Cursor theme" | ||||||
|         shrink_to_fit: true |         shrink_to_fit: true | ||||||
| 
 | 
 | ||||||
|         @GUI::Button { |         @GUI::Button { | ||||||
|  |  | ||||||
|  | @ -569,7 +569,7 @@ void DirectoryView::setup_actions() | ||||||
|     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&) { |     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&) { | ||||||
|         String value; |         String value; | ||||||
|         auto icon = Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-folder.png"sv).release_value_but_fixme_should_propagate_errors(); |         auto icon = Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-folder.png"sv).release_value_but_fixme_should_propagate_errors(); | ||||||
|         if (GUI::InputBox::show(window(), value, "Enter a name:"sv, "New directory"sv, GUI::InputType::NonemptyText, {}, move(icon)) == GUI::InputBox::ExecResult::OK) { |         if (GUI::InputBox::show(window(), value, "Enter a name:"sv, "New Directory"sv, GUI::InputType::NonemptyText, {}, move(icon)) == GUI::InputBox::ExecResult::OK) { | ||||||
|             auto new_dir_path = LexicalPath::canonicalized_path(DeprecatedString::formatted("{}/{}", path(), value)); |             auto new_dir_path = LexicalPath::canonicalized_path(DeprecatedString::formatted("{}/{}", path(), value)); | ||||||
|             int rc = mkdir(new_dir_path.characters(), 0777); |             int rc = mkdir(new_dir_path.characters(), 0777); | ||||||
|             if (rc < 0) { |             if (rc < 0) { | ||||||
|  | @ -582,7 +582,7 @@ void DirectoryView::setup_actions() | ||||||
|     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&) { |     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&) { | ||||||
|         String value; |         String value; | ||||||
|         auto icon = Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-unknown.png"sv).release_value_but_fixme_should_propagate_errors(); |         auto icon = Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-unknown.png"sv).release_value_but_fixme_should_propagate_errors(); | ||||||
|         if (GUI::InputBox::show(window(), value, "Enter a name:"sv, "New file"sv, GUI::InputType::NonemptyText, {}, move(icon)) == GUI::InputBox::ExecResult::OK) { |         if (GUI::InputBox::show(window(), value, "Enter a name:"sv, "New File"sv, GUI::InputType::NonemptyText, {}, move(icon)) == GUI::InputBox::ExecResult::OK) { | ||||||
|             auto new_file_path = LexicalPath::canonicalized_path(DeprecatedString::formatted("{}/{}", path(), value)); |             auto new_file_path = LexicalPath::canonicalized_path(DeprecatedString::formatted("{}/{}", path(), value)); | ||||||
|             struct stat st; |             struct stat st; | ||||||
|             int rc = stat(new_file_path.characters(), &st); |             int rc = stat(new_file_path.characters(), &st); | ||||||
|  |  | ||||||
|  | @ -23,7 +23,7 @@ void delete_paths(Vector<DeprecatedString> const& paths, bool should_confirm, GU | ||||||
| { | { | ||||||
|     DeprecatedString message; |     DeprecatedString message; | ||||||
|     if (paths.size() == 1) { |     if (paths.size() == 1) { | ||||||
|         message = DeprecatedString::formatted("Are you sure you want to delete {}?", LexicalPath::basename(paths[0])); |         message = DeprecatedString::formatted("Are you sure you want to delete \"{}\"?", LexicalPath::basename(paths[0])); | ||||||
|     } else { |     } else { | ||||||
|         message = DeprecatedString::formatted("Are you sure you want to delete {} files?", paths.size()); |         message = DeprecatedString::formatted("Are you sure you want to delete {} files?", paths.size()); | ||||||
|     } |     } | ||||||
|  | @ -31,7 +31,7 @@ void delete_paths(Vector<DeprecatedString> const& paths, bool should_confirm, GU | ||||||
|     if (should_confirm) { |     if (should_confirm) { | ||||||
|         auto result = GUI::MessageBox::show(parent_window, |         auto result = GUI::MessageBox::show(parent_window, | ||||||
|             message, |             message, | ||||||
|             "Confirm deletion"sv, |             "Confirm Deletion"sv, | ||||||
|             GUI::MessageBox::Type::Warning, |             GUI::MessageBox::Type::Warning, | ||||||
|             GUI::MessageBox::InputType::OKCancel); |             GUI::MessageBox::InputType::OKCancel); | ||||||
|         if (result == GUI::MessageBox::ExecResult::Cancel) |         if (result == GUI::MessageBox::ExecResult::Cancel) | ||||||
|  |  | ||||||
|  | @ -265,7 +265,7 @@ ErrorOr<void> MainWidget::create_actions() | ||||||
|         Config::write_bool("FontEditor"sv, "GlyphMap"sv, "HighlightModifications"sv, action.is_checked()); |         Config::write_bool("FontEditor"sv, "GlyphMap"sv, "HighlightModifications"sv, action.is_checked()); | ||||||
|     }); |     }); | ||||||
|     m_highlight_modifications_action->set_checked(highlight_modifications); |     m_highlight_modifications_action->set_checked(highlight_modifications); | ||||||
|     m_highlight_modifications_action->set_status_tip("Show or hide highlights on modified glyphs. (Green = New, Blue = Modified, Red = Deleted)"); |     m_highlight_modifications_action->set_status_tip("Show or hide highlights on modified glyphs"); | ||||||
| 
 | 
 | ||||||
|     bool show_system_emoji = Config::read_bool("FontEditor"sv, "GlyphMap"sv, "ShowSystemEmoji"sv, true); |     bool show_system_emoji = Config::read_bool("FontEditor"sv, "GlyphMap"sv, "ShowSystemEmoji"sv, true); | ||||||
|     m_glyph_map_widget->set_show_system_emoji(show_system_emoji); |     m_glyph_map_widget->set_show_system_emoji(show_system_emoji); | ||||||
|  | @ -278,7 +278,7 @@ ErrorOr<void> MainWidget::create_actions() | ||||||
| 
 | 
 | ||||||
|     m_go_to_glyph_action = GUI::Action::create("&Go to Glyph...", { Mod_Ctrl, Key_G }, g_resources.go_to_glyph, [this](auto&) { |     m_go_to_glyph_action = GUI::Action::create("&Go to Glyph...", { Mod_Ctrl, Key_G }, g_resources.go_to_glyph, [this](auto&) { | ||||||
|         String input; |         String input; | ||||||
|         auto result = GUI::InputBox::try_show(window(), input, {}, "Go to glyph"sv, GUI::InputType::NonemptyText, "Hexadecimal"sv); |         auto result = GUI::InputBox::try_show(window(), input, {}, "Go to Glyph"sv, GUI::InputType::NonemptyText, "Hexadecimal"sv); | ||||||
|         if (!result.is_error() && result.value() == GUI::InputBox::ExecResult::OK) { |         if (!result.is_error() && result.value() == GUI::InputBox::ExecResult::OK) { | ||||||
|             auto maybe_code_point = AK::StringUtils::convert_to_uint_from_hex(input); |             auto maybe_code_point = AK::StringUtils::convert_to_uint_from_hex(input); | ||||||
|             if (!maybe_code_point.has_value()) |             if (!maybe_code_point.has_value()) | ||||||
|  |  | ||||||
|  | @ -11,7 +11,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Background Color" |         title: "Background color" | ||||||
|         max_height: "shrink" |         max_height: "shrink" | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [8] |             margins: [8] | ||||||
|  | @ -24,7 +24,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Card Back" |         title: "Card back" | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [8] |             margins: [8] | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -23,7 +23,7 @@ | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             @GUI::Label { |             @GUI::Label { | ||||||
|                 text: "Piece Set:" |                 text: "Piece set:" | ||||||
|                 text_alignment: "CenterLeft" |                 text_alignment: "CenterLeft" | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|  | @ -39,7 +39,7 @@ | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             @GUI::Label { |             @GUI::Label { | ||||||
|                 text: "Board Theme:" |                 text: "Board theme:" | ||||||
|                 text_alignment: "CenterLeft" |                 text_alignment: "CenterLeft" | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -13,7 +13,7 @@ | ||||||
|         fixed_height: 22 |         fixed_height: 22 | ||||||
| 
 | 
 | ||||||
|         @GUI::Label { |         @GUI::Label { | ||||||
|             text: "Value to find" |             text: "Value to find:" | ||||||
|             fixed_width: 80 |             fixed_width: 80 | ||||||
|             text_alignment: "CenterLeft" |             text_alignment: "CenterLeft" | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -98,9 +98,9 @@ HexEditorWidget::HexEditorWidget() | ||||||
|         m_editor->update(); |         m_editor->update(); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     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&) { |     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&) { | ||||||
|         String value; |         String value; | ||||||
|         if (request_close() && GUI::InputBox::show(window(), value, "Enter new file size:"sv, "New file size"sv, GUI::InputType::NonemptyText) == GUI::InputBox::ExecResult::OK) { |         if (request_close() && GUI::InputBox::show(window(), value, "Enter a size:"sv, "New File"sv, GUI::InputType::NonemptyText) == GUI::InputBox::ExecResult::OK) { | ||||||
|             auto file_size = AK::StringUtils::convert_to_uint(value); |             auto file_size = AK::StringUtils::convert_to_uint(value); | ||||||
|             if (!file_size.has_value()) { |             if (!file_size.has_value()) { | ||||||
|                 GUI::MessageBox::show(window(), "Invalid file size entered."sv, "Error"sv, GUI::MessageBox::Type::Error); |                 GUI::MessageBox::show(window(), "Invalid file size entered."sv, "Error"sv, GUI::MessageBox::Type::Error); | ||||||
|  | @ -166,7 +166,7 @@ HexEditorWidget::HexEditorWidget() | ||||||
|     }); |     }); | ||||||
|     m_redo_action->set_enabled(false); |     m_redo_action->set_enabled(false); | ||||||
| 
 | 
 | ||||||
|     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&) { |     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; |         auto old_buffer = m_search_buffer; | ||||||
|         bool find_all = false; |         bool find_all = false; | ||||||
|         if (FindDialog::show(window(), m_search_text, m_search_buffer, find_all) == GUI::InputBox::ExecResult::OK) { |         if (FindDialog::show(window(), m_search_text, m_search_buffer, find_all) == GUI::InputBox::ExecResult::OK) { | ||||||
|  | @ -176,11 +176,11 @@ HexEditorWidget::HexEditorWidget() | ||||||
|                 m_search_results->update(); |                 m_search_results->update(); | ||||||
| 
 | 
 | ||||||
|                 if (matches.is_empty()) { |                 if (matches.is_empty()) { | ||||||
|                     GUI::MessageBox::show(window(), DeprecatedString::formatted("Pattern \"{}\" not found in this file", m_search_text), "Not found"sv, GUI::MessageBox::Type::Warning); |                     GUI::MessageBox::show(window(), DeprecatedString::formatted("Pattern \"{}\" not found in this file", m_search_text), "Not Found"sv, GUI::MessageBox::Type::Warning); | ||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 GUI::MessageBox::show(window(), DeprecatedString::formatted("Found {} matches for \"{}\" in this file", matches.size(), m_search_text), DeprecatedString::formatted("{} matches", matches.size()), GUI::MessageBox::Type::Warning); |                 GUI::MessageBox::show(window(), DeprecatedString::formatted("Found {} matches for \"{}\" in this file", matches.size(), m_search_text), DeprecatedString::formatted("{} Matches", matches.size()), GUI::MessageBox::Type::Warning); | ||||||
|                 set_search_results_visible(true); |                 set_search_results_visible(true); | ||||||
|             } else { |             } else { | ||||||
|                 bool same_buffers = false; |                 bool same_buffers = false; | ||||||
|  | @ -192,7 +192,7 @@ HexEditorWidget::HexEditorWidget() | ||||||
|                 auto result = m_editor->find_and_highlight(m_search_buffer, same_buffers ? last_found_index() : 0); |                 auto result = m_editor->find_and_highlight(m_search_buffer, same_buffers ? last_found_index() : 0); | ||||||
| 
 | 
 | ||||||
|                 if (!result.has_value()) { |                 if (!result.has_value()) { | ||||||
|                     GUI::MessageBox::show(window(), DeprecatedString::formatted("Pattern \"{}\" not found in this file", m_search_text), "Not found"sv, GUI::MessageBox::Type::Warning); |                     GUI::MessageBox::show(window(), DeprecatedString::formatted("Pattern \"{}\" not found in this file", m_search_text), "Not Found"sv, GUI::MessageBox::Type::Warning); | ||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|  | @ -203,7 +203,7 @@ HexEditorWidget::HexEditorWidget() | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     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&) { |     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; |         int new_offset; | ||||||
|         auto result = GoToOffsetDialog::show( |         auto result = GoToOffsetDialog::show( | ||||||
|             window(), |             window(), | ||||||
|  | @ -443,13 +443,13 @@ ErrorOr<void> HexEditorWidget::initialize_menubar(GUI::Window& window) | ||||||
|     TRY(edit_menu->try_add_action(*m_find_action)); |     TRY(edit_menu->try_add_action(*m_find_action)); | ||||||
|     TRY(edit_menu->try_add_action(GUI::Action::create("Find &Next", { Mod_None, Key_F3 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/find-next.png"sv)), [&](const GUI::Action&) { |     TRY(edit_menu->try_add_action(GUI::Action::create("Find &Next", { Mod_None, Key_F3 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/find-next.png"sv)), [&](const GUI::Action&) { | ||||||
|         if (m_search_text.is_empty() || m_search_buffer.is_empty()) { |         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); |             GUI::MessageBox::show(&window, "Nothing to search for"sv, "Not Found"sv, GUI::MessageBox::Type::Warning); | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         auto result = m_editor->find_and_highlight(m_search_buffer, last_found_index()); |         auto result = m_editor->find_and_highlight(m_search_buffer, last_found_index()); | ||||||
|         if (!result.has_value()) { |         if (!result.has_value()) { | ||||||
|             GUI::MessageBox::show(&window, DeprecatedString::formatted("No more matches for \"{}\" found in this file", m_search_text), "Not found"sv, GUI::MessageBox::Type::Warning); |             GUI::MessageBox::show(&window, DeprecatedString::formatted("No more matches for \"{}\" found in this file", m_search_text), "Not Found"sv, GUI::MessageBox::Type::Warning); | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|         m_editor->update(); |         m_editor->update(); | ||||||
|  | @ -463,7 +463,7 @@ ErrorOr<void> HexEditorWidget::initialize_menubar(GUI::Window& window) | ||||||
|         m_search_results->update(); |         m_search_results->update(); | ||||||
| 
 | 
 | ||||||
|         if (matches.is_empty()) { |         if (matches.is_empty()) { | ||||||
|             GUI::MessageBox::show(&window, "No strings found in this file"sv, "Not found"sv, GUI::MessageBox::Type::Warning); |             GUI::MessageBox::show(&window, "No strings found in this file"sv, "Not Found"sv, GUI::MessageBox::Type::Warning); | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -137,7 +137,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|             auto msgbox_result = GUI::MessageBox::show(window, |             auto msgbox_result = GUI::MessageBox::show(window, | ||||||
|                 DeprecatedString::formatted("Are you sure you want to delete {}?", path), |                 DeprecatedString::formatted("Are you sure you want to delete {}?", path), | ||||||
|                 "Confirm deletion"sv, |                 "Confirm Deletion"sv, | ||||||
|                 GUI::MessageBox::Type::Warning, |                 GUI::MessageBox::Type::Warning, | ||||||
|                 GUI::MessageBox::InputType::OKCancel); |                 GUI::MessageBox::InputType::OKCancel); | ||||||
| 
 | 
 | ||||||
|  | @ -148,7 +148,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|             if (unlinked_or_error.is_error()) { |             if (unlinked_or_error.is_error()) { | ||||||
|                 GUI::MessageBox::show(window, |                 GUI::MessageBox::show(window, | ||||||
|                     DeprecatedString::formatted("unlink({}) failed: {}", path, unlinked_or_error.error()), |                     DeprecatedString::formatted("unlink({}) failed: {}", path, unlinked_or_error.error()), | ||||||
|                     "Delete failed"sv, |                     "Delete Failed"sv, | ||||||
|                     GUI::MessageBox::Type::Error); |                     GUI::MessageBox::Type::Error); | ||||||
| 
 | 
 | ||||||
|                 return; |                 return; | ||||||
|  | @ -238,10 +238,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|         }, |         }, | ||||||
|         window); |         window); | ||||||
| 
 | 
 | ||||||
|     auto hide_show_toolbar_action = GUI::Action::create("Hide/Show &Toolbar", { Mod_Ctrl, Key_T }, |     auto hide_show_toolbar_action = GUI::Action::create_checkable("&Toolbar", { Mod_Ctrl, Key_T }, | ||||||
|         [&](auto&) { |         [&](auto& action) { | ||||||
|             toolbar_container->set_visible(!toolbar_container->is_visible()); |             toolbar_container->set_visible(action.is_checked()); | ||||||
|         }); |         }); | ||||||
|  |     hide_show_toolbar_action->set_checked(true); | ||||||
| 
 | 
 | ||||||
|     auto copy_action = GUI::CommonActions::make_copy_action([&](auto&) { |     auto copy_action = GUI::CommonActions::make_copy_action([&](auto&) { | ||||||
|         if (widget->bitmap()) |         if (widget->bitmap()) | ||||||
|  |  | ||||||
|  | @ -79,7 +79,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|             app->quit(); |             app->quit(); | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|     auto auto_modifier_action = GUI::Action::create("Auto Modifier", [&](auto& act) { |     auto auto_modifier_action = GUI::Action::create("Auto-Modifier", [&](auto& act) { | ||||||
|         keyboard_mapper_widget->set_automatic_modifier(act.is_checked()); |         keyboard_mapper_widget->set_automatic_modifier(act.is_checked()); | ||||||
|     }); |     }); | ||||||
|     auto_modifier_action->set_status_tip("Toggle automatic modifier"); |     auto_modifier_action->set_status_tip("Toggle automatic modifier"); | ||||||
|  |  | ||||||
|  | @ -40,18 +40,18 @@ | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|                     name: "activate_keymap_button" |                     name: "activate_keymap_button" | ||||||
|                     text: "Activate keymap" |                     text: "Activate Keymap" | ||||||
|                     enabled: false |                     enabled: false | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|                     name: "add_keymap_button" |                     name: "add_keymap_button" | ||||||
|                     text: "Add keymap" |                     text: "Add Keymap..." | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|                     name: "remove_keymap_button" |                     name: "remove_keymap_button" | ||||||
|                     text: "Remove keymap" |                     text: "Remove Keymap" | ||||||
|                     enabled: false |                     enabled: false | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  | @ -59,7 +59,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Test Input" |         title: "Test input" | ||||||
|         layout: @GUI::HorizontalBoxLayout { |         layout: @GUI::HorizontalBoxLayout { | ||||||
|             margins: [16, 8, 8] |             margins: [16, 8, 8] | ||||||
|             spacing: 16 |             spacing: 16 | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Server Settings" |         title: "Server settings" | ||||||
|         fixed_height: 170 |         fixed_height: 170 | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|  | @ -39,7 +39,7 @@ | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             @GUI::Label { |             @GUI::Label { | ||||||
|                 text: "Server Address:" |                 text: "Server address:" | ||||||
|                 fixed_width: 80 |                 fixed_width: 80 | ||||||
|                 name: "server_label" |                 name: "server_label" | ||||||
|                 text_alignment: "CenterLeft" |                 text_alignment: "CenterLeft" | ||||||
|  | @ -60,7 +60,7 @@ | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             @GUI::Label { |             @GUI::Label { | ||||||
|                 text: "Server Port:" |                 text: "Server port:" | ||||||
|                 fixed_width: 80 |                 fixed_width: 80 | ||||||
|                 name: "port_label" |                 name: "port_label" | ||||||
|                 text_alignment: "CenterLeft" |                 text_alignment: "CenterLeft" | ||||||
|  | @ -88,7 +88,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "User Settings" |         title: "User settings" | ||||||
|         fixed_height: 110 |         fixed_height: 110 | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|  | @ -123,7 +123,7 @@ | ||||||
| 
 | 
 | ||||||
|             @GUI::Label { |             @GUI::Label { | ||||||
|                 autosize: true |                 autosize: true | ||||||
|                 text: "Email Address:" |                 text: "Email address:" | ||||||
|                 fixed_width: 80 |                 fixed_width: 80 | ||||||
|                 text_alignment: "CenterLeft" |                 text_alignment: "CenterLeft" | ||||||
|             } |             } | ||||||
|  |  | ||||||
|  | @ -18,7 +18,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Highlight Color" |         title: "Highlight color" | ||||||
|         preferred_height: "opportunistic_grow" |         preferred_height: "opportunistic_grow" | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|  | @ -36,7 +36,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Highlight Opacity" |         title: "Highlight opacity" | ||||||
|         preferred_height: "opportunistic_grow" |         preferred_height: "opportunistic_grow" | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|  | @ -70,7 +70,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Highlight Size" |         title: "Highlight size" | ||||||
|         preferred_height: "opportunistic_grow" |         preferred_height: "opportunistic_grow" | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Cursor Speed" |         title: "Cursor speed" | ||||||
|         fixed_height: 106 |         fixed_height: 106 | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|  | @ -53,7 +53,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Scroll Wheel" |         title: "Scroll wheel" | ||||||
|         fixed_height: 106 |         fixed_height: 106 | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|  | @ -114,7 +114,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Double-click Speed" |         title: "Double-click speed" | ||||||
|         fixed_height: 106 |         fixed_height: 106 | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|  | @ -163,7 +163,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Button Configuration" |         title: "Button configuration" | ||||||
|         fixed_height: 68 |         fixed_height: 68 | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [16, 8, 8] |             margins: [16, 8, 8] | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::GroupBox { |     @GUI::GroupBox { | ||||||
|         title: "Available Cursor Themes" |         title: "Available cursor themes" | ||||||
|         layout: @GUI::VerticalBoxLayout { |         layout: @GUI::VerticalBoxLayout { | ||||||
|             margins: [6] |             margins: [6] | ||||||
|             spacing: 4 |             spacing: 4 | ||||||
|  |  | ||||||
|  | @ -51,7 +51,7 @@ | ||||||
|             preferred_height: 30 |             preferred_height: 30 | ||||||
| 
 | 
 | ||||||
|             @GUI::Label { |             @GUI::Label { | ||||||
|                 text: "IP Address:" |                 text: "IP address:" | ||||||
|                 fixed_width: 100 |                 fixed_width: 100 | ||||||
|                 text_alignment: "CenterLeft" |                 text_alignment: "CenterLeft" | ||||||
|             } |             } | ||||||
|  |  | ||||||
|  | @ -25,7 +25,7 @@ ErrorOr<void> ExportProgressWindow::initialize_fallibles() | ||||||
| 
 | 
 | ||||||
|     set_resizable(false); |     set_resizable(false); | ||||||
|     set_closeable(false); |     set_closeable(false); | ||||||
|     set_title("Rendering audio"); |     set_title("Rendering Audio"); | ||||||
|     set_icon(GUI::Icon::default_icon("app-piano"sv).bitmap_for_size(16)); |     set_icon(GUI::Icon::default_icon("app-piano"sv).bitmap_for_size(16)); | ||||||
| 
 | 
 | ||||||
|     m_progress_bar = *main_widget->find_descendant_of_type_named<GUI::HorizontalProgressbar>("progress_bar"); |     m_progress_bar = *main_widget->find_descendant_of_type_named<GUI::HorizontalProgressbar>("progress_bar"); | ||||||
|  |  | ||||||
|  | @ -59,7 +59,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     main_widget_updater->start(); |     main_widget_updater->start(); | ||||||
| 
 | 
 | ||||||
|     auto file_menu = TRY(window->try_add_menu("&File"_short_string)); |     auto file_menu = TRY(window->try_add_menu("&File"_short_string)); | ||||||
|     TRY(file_menu->try_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&) { |     TRY(file_menu->try_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"); |         save_path = GUI::FilePicker::get_save_filepath(window, "Untitled", "wav"); | ||||||
|         if (!save_path.has_value()) |         if (!save_path.has_value()) | ||||||
|             return; |             return; | ||||||
|  |  | ||||||
|  | @ -23,7 +23,7 @@ namespace PixelPaint { | ||||||
| CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window) | CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window) | ||||||
|     : Dialog(parent_window) |     : Dialog(parent_window) | ||||||
| { | { | ||||||
|     set_title("Create new image"); |     set_title("Create New Image"); | ||||||
|     set_icon(parent_window->icon()); |     set_icon(parent_window->icon()); | ||||||
|     resize(200, 220); |     resize(200, 220); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -18,7 +18,7 @@ EditGuideDialog::EditGuideDialog(GUI::Window* parent_window, DeprecatedString co | ||||||
|     , m_offset(offset) |     , m_offset(offset) | ||||||
|     , m_orientation(orientation) |     , m_orientation(orientation) | ||||||
| { | { | ||||||
|     set_title("Create new Guide"); |     set_title("Create New Guide"); | ||||||
|     set_icon(parent_window->icon()); |     set_icon(parent_window->icon()); | ||||||
|     resize(200, 130); |     resize(200, 130); | ||||||
|     set_resizable(false); |     set_resizable(false); | ||||||
|  |  | ||||||
|  | @ -224,7 +224,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window) | ||||||
| 
 | 
 | ||||||
|     TRY(m_export_submenu->try_add_action( |     TRY(m_export_submenu->try_add_action( | ||||||
|         GUI::Action::create( |         GUI::Action::create( | ||||||
|             "As &BMP", [&](auto&) { |             "As &BMP...", [&](auto&) { | ||||||
|                 auto* editor = current_image_editor(); |                 auto* editor = current_image_editor(); | ||||||
|                 VERIFY(editor); |                 VERIFY(editor); | ||||||
|                 auto response = FileSystemAccessClient::Client::the().save_file(&window, editor->title().to_deprecated_string(), "bmp"); |                 auto response = FileSystemAccessClient::Client::the().save_file(&window, editor->title().to_deprecated_string(), "bmp"); | ||||||
|  | @ -238,7 +238,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window) | ||||||
| 
 | 
 | ||||||
|     TRY(m_export_submenu->try_add_action( |     TRY(m_export_submenu->try_add_action( | ||||||
|         GUI::Action::create( |         GUI::Action::create( | ||||||
|             "As &PNG", [&](auto&) { |             "As &PNG...", [&](auto&) { | ||||||
|                 auto* editor = current_image_editor(); |                 auto* editor = current_image_editor(); | ||||||
|                 VERIFY(editor); |                 VERIFY(editor); | ||||||
|                 // TODO: fix bmp on line below?
 |                 // TODO: fix bmp on line below?
 | ||||||
|  | @ -253,7 +253,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window) | ||||||
| 
 | 
 | ||||||
|     TRY(m_export_submenu->try_add_action( |     TRY(m_export_submenu->try_add_action( | ||||||
|         GUI::Action::create( |         GUI::Action::create( | ||||||
|             "As &QOI", [&](auto&) { |             "As &QOI...", [&](auto&) { | ||||||
|                 auto* editor = current_image_editor(); |                 auto* editor = current_image_editor(); | ||||||
|                 VERIFY(editor); |                 VERIFY(editor); | ||||||
|                 auto response = FileSystemAccessClient::Client::the().save_file(&window, editor->title().to_deprecated_string(), "qoi"); |                 auto response = FileSystemAccessClient::Client::the().save_file(&window, editor->title().to_deprecated_string(), "qoi"); | ||||||
|  | @ -454,7 +454,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window) | ||||||
|             editor->set_secondary_color(Color::White); |             editor->set_secondary_color(Color::White); | ||||||
|         }))); |         }))); | ||||||
|     TRY(m_edit_menu->try_add_action(GUI::Action::create( |     TRY(m_edit_menu->try_add_action(GUI::Action::create( | ||||||
|         "&Load Color Palette", g_icon_bag.load_color_palette, [&](auto&) { |         "&Load Color Palette...", g_icon_bag.load_color_palette, [&](auto&) { | ||||||
|             auto response = FileSystemAccessClient::Client::the().open_file(&window, "Load Color Palette"); |             auto response = FileSystemAccessClient::Client::the().open_file(&window, "Load Color Palette"); | ||||||
|             if (response.is_error()) |             if (response.is_error()) | ||||||
|                 return; |                 return; | ||||||
|  | @ -468,7 +468,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window) | ||||||
|             m_palette_widget->display_color_list(result.value()); |             m_palette_widget->display_color_list(result.value()); | ||||||
|         }))); |         }))); | ||||||
|     TRY(m_edit_menu->try_add_action(GUI::Action::create( |     TRY(m_edit_menu->try_add_action(GUI::Action::create( | ||||||
|         "Sa&ve Color Palette", g_icon_bag.save_color_palette, [&](auto&) { |         "Sa&ve Color Palette...", g_icon_bag.save_color_palette, [&](auto&) { | ||||||
|             auto response = FileSystemAccessClient::Client::the().save_file(&window, "untitled", "palette"); |             auto response = FileSystemAccessClient::Client::the().save_file(&window, "untitled", "palette"); | ||||||
|             if (response.is_error()) |             if (response.is_error()) | ||||||
|                 return; |                 return; | ||||||
|  | @ -501,7 +501,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window) | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|     m_add_guide_action = GUI::Action::create( |     m_add_guide_action = GUI::Action::create( | ||||||
|         "&Add Guide", g_icon_bag.add_guide, [&](auto&) { |         "&Add Guide...", g_icon_bag.add_guide, [&](auto&) { | ||||||
|             auto dialog = PixelPaint::EditGuideDialog::construct(&window); |             auto dialog = PixelPaint::EditGuideDialog::construct(&window); | ||||||
|             if (dialog->exec() != GUI::Dialog::ExecResult::OK) |             if (dialog->exec() != GUI::Dialog::ExecResult::OK) | ||||||
|                 return; |                 return; | ||||||
|  |  | ||||||
|  | @ -83,7 +83,7 @@ ErrorOr<void> PresenterWidget::initialize_menubar() | ||||||
|             update_slides_actions(); |             update_slides_actions(); | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
|     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&) { |     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) { |         if (m_current_presentation) { | ||||||
|             m_current_presentation->go_to_first_slide(); |             m_current_presentation->go_to_first_slide(); | ||||||
|             update_web_view(); |             update_web_view(); | ||||||
|  |  | ||||||
|  | @ -92,12 +92,12 @@ BarsVisualizationWidget::BarsVisualizationWidget() | ||||||
|     , m_logarithmic_spectrum(true) |     , m_logarithmic_spectrum(true) | ||||||
| { | { | ||||||
|     m_context_menu = GUI::Menu::construct(); |     m_context_menu = GUI::Menu::construct(); | ||||||
|     auto frequency_energy_action = GUI::Action::create_checkable("Adjust frequency energy (for aesthetics)", [&](GUI::Action& action) { |     auto frequency_energy_action = GUI::Action::create_checkable("Adjust Frequency Energy", [&](GUI::Action& action) { | ||||||
|         m_adjust_frequencies = action.is_checked(); |         m_adjust_frequencies = action.is_checked(); | ||||||
|     }); |     }); | ||||||
|     frequency_energy_action->set_checked(true); |     frequency_energy_action->set_checked(true); | ||||||
|     m_context_menu->add_action(frequency_energy_action); |     m_context_menu->add_action(frequency_energy_action); | ||||||
|     auto logarithmic_spectrum_action = GUI::Action::create_checkable("Scale spectrum logarithmically", [&](GUI::Action& action) { |     auto logarithmic_spectrum_action = GUI::Action::create_checkable("Scale Spectrum Logarithmically", [&](GUI::Action& action) { | ||||||
|         m_logarithmic_spectrum = action.is_checked(); |         m_logarithmic_spectrum = action.is_checked(); | ||||||
|     }); |     }); | ||||||
|     logarithmic_spectrum_action->set_checked(true); |     logarithmic_spectrum_action->set_checked(true); | ||||||
|  |  | ||||||
|  | @ -62,7 +62,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     auto file_menu = TRY(window->try_add_menu("&File"_short_string)); |     auto file_menu = TRY(window->try_add_menu("&File"_short_string)); | ||||||
|     TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) { |     TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) { | ||||||
|         Optional<DeprecatedString> path = GUI::FilePicker::get_open_filepath(window, "Open sound file..."); |         Optional<DeprecatedString> path = GUI::FilePicker::get_open_filepath(window); | ||||||
|         if (path.has_value()) { |         if (path.has_value()) { | ||||||
|             player->play_file_path(path.value()); |             player->play_file_path(path.value()); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -388,7 +388,7 @@ SpreadsheetView::SpreadsheetView(Sheet& sheet) | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     m_cell_range_context_menu = GUI::Menu::construct(); |     m_cell_range_context_menu = GUI::Menu::construct(); | ||||||
|     m_cell_range_context_menu->add_action(GUI::Action::create("Type and Formatting...", [this](auto&) { |     m_cell_range_context_menu->add_action(GUI::Action::create("Format...", [this](auto&) { | ||||||
|         Vector<Position> positions; |         Vector<Position> positions; | ||||||
|         for (auto& index : m_table_view->selection().indices()) { |         for (auto& index : m_table_view->selection().indices()) { | ||||||
|             Position position { (size_t)index.column(), (size_t)index.row() }; |             Position position { (size_t)index.column(), (size_t)index.row() }; | ||||||
|  |  | ||||||
|  | @ -101,14 +101,14 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, Vector<NonnullR | ||||||
|         VERIFY(sheet_ptr); // How did we get here without a sheet?
 |         VERIFY(sheet_ptr); // How did we get here without a sheet?
 | ||||||
|         auto& sheet = *sheet_ptr; |         auto& sheet = *sheet_ptr; | ||||||
|         String new_name = String::from_deprecated_string(sheet.name()).release_value_but_fixme_should_propagate_errors(); |         String new_name = String::from_deprecated_string(sheet.name()).release_value_but_fixme_should_propagate_errors(); | ||||||
|         if (GUI::InputBox::show(window(), new_name, {}, "Rename sheet"sv, GUI::InputType::NonemptyText, "Name"sv) == GUI::Dialog::ExecResult::OK) { |         if (GUI::InputBox::show(window(), new_name, {}, "Rename Sheet"sv, GUI::InputType::NonemptyText, "Name"sv) == GUI::Dialog::ExecResult::OK) { | ||||||
|             sheet.set_name(new_name); |             sheet.set_name(new_name); | ||||||
|             sheet.update(); |             sheet.update(); | ||||||
|             m_tab_widget->set_tab_title(static_cast<GUI::Widget&>(*m_tab_context_menu_sheet_view), new_name); |             m_tab_widget->set_tab_title(static_cast<GUI::Widget&>(*m_tab_context_menu_sheet_view), new_name); | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
|     m_tab_context_menu->add_action(*m_rename_action); |     m_tab_context_menu->add_action(*m_rename_action); | ||||||
|     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&) { |     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&) { | ||||||
|         String name; |         String name; | ||||||
|         auto icon = Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-spreadsheet.png"sv).release_value_but_fixme_should_propagate_errors(); |         auto icon = Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-spreadsheet.png"sv).release_value_but_fixme_should_propagate_errors(); | ||||||
|         if (GUI::InputBox::show(window(), name, "Enter a name:"sv, "New sheet"sv, GUI::InputType::NonemptyText, {}, move(icon)) == GUI::Dialog::ExecResult::OK) { |         if (GUI::InputBox::show(window(), name, "Enter a name:"sv, "New sheet"sv, GUI::InputType::NonemptyText, {}, move(icon)) == GUI::Dialog::ExecResult::OK) { | ||||||
|  | @ -134,7 +134,7 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, Vector<NonnullR | ||||||
|         load_file(response.value().filename(), response.value().stream()); |         load_file(response.value().filename(), response.value().stream()); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     m_import_action = GUI::Action::create("Import sheets...", [&](auto&) { |     m_import_action = GUI::Action::create("Import Sheets...", [&](auto&) { | ||||||
|         auto response = FileSystemAccessClient::Client::the().open_file(window()); |         auto response = FileSystemAccessClient::Client::the().open_file(window()); | ||||||
|         if (response.is_error()) |         if (response.is_error()) | ||||||
|             return; |             return; | ||||||
|  |  | ||||||
|  | @ -368,17 +368,20 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|         if (!should_confirm_close) |         if (!should_confirm_close) | ||||||
|             return GUI::MessageBox::ExecResult::OK; |             return GUI::MessageBox::ExecResult::OK; | ||||||
|         Optional<DeprecatedString> close_message; |         Optional<DeprecatedString> close_message; | ||||||
|  |         auto title = "Running Process"sv; | ||||||
|         if (tty_has_foreground_process()) { |         if (tty_has_foreground_process()) { | ||||||
|             close_message = "There is still a process running in this terminal. Closing the terminal will kill it."; |             close_message = "Close Terminal and kill its foreground process?"; | ||||||
|         } else { |         } else { | ||||||
|             auto child_process_count = shell_child_process_count(); |             auto child_process_count = shell_child_process_count(); | ||||||
|             if (child_process_count > 1) |             if (child_process_count > 1) { | ||||||
|                 close_message = DeprecatedString::formatted("There are {} background processes running in this terminal. Closing the terminal may kill them.", child_process_count); |                 title = "Running Processes"sv; | ||||||
|             else if (child_process_count == 1) |                 close_message = DeprecatedString::formatted("Close Terminal and kill its {} background processes?", child_process_count); | ||||||
|                 close_message = "There is a background process running in this terminal. Closing the terminal may kill it."; |             } else if (child_process_count == 1) { | ||||||
|  |                 close_message = "Close Terminal and kill its background process?"; | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|         if (close_message.has_value()) |         if (close_message.has_value()) | ||||||
|             return GUI::MessageBox::show(window, *close_message, "Close this terminal?"sv, GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel); |             return GUI::MessageBox::show(window, *close_message, title, GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel); | ||||||
|         return GUI::MessageBox::ExecResult::OK; |         return GUI::MessageBox::ExecResult::OK; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -473,7 +473,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window) | ||||||
| 
 | 
 | ||||||
|     TRY(view_menu->try_add_separator()); |     TRY(view_menu->try_add_separator()); | ||||||
| 
 | 
 | ||||||
|     TRY(view_menu->try_add_action(GUI::Action::create("Editor &Font...", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-font-editor.png"sv)), |     TRY(view_menu->try_add_action(GUI::Action::create("Change &Font...", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-font-editor.png"sv)), | ||||||
|         [&](auto&) { |         [&](auto&) { | ||||||
|             auto picker = GUI::FontPicker::construct(&window, &m_editor->font(), false); |             auto picker = GUI::FontPicker::construct(&window, &m_editor->font(), false); | ||||||
|             if (picker->exec() == GUI::Dialog::ExecResult::OK) { |             if (picker->exec() == GUI::Dialog::ExecResult::OK) { | ||||||
|  |  | ||||||
|  | @ -242,7 +242,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window) | ||||||
|     TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) { |     TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) { | ||||||
|         if (request_close() == GUI::Window::CloseRequestDecision::StayOpen) |         if (request_close() == GUI::Window::CloseRequestDecision::StayOpen) | ||||||
|             return; |             return; | ||||||
|         auto response = FileSystemAccessClient::Client::the().open_file(&window, "Select theme file", "/res/themes"sv); |         auto response = FileSystemAccessClient::Client::the().open_file(&window, "Select Theme", "/res/themes"sv); | ||||||
|         if (response.is_error()) |         if (response.is_error()) | ||||||
|             return; |             return; | ||||||
|         auto load_from_file_result = load_from_file(response.value().filename(), response.value().release_stream()); |         auto load_from_file_result = load_from_file(response.value().filename(), response.value().release_stream()); | ||||||
|  |  | ||||||
|  | @ -384,7 +384,7 @@ ErrorOr<void> VideoPlayerWidget::initialize_menubar(GUI::Window& window) | ||||||
|     // File menu
 |     // File menu
 | ||||||
|     auto file_menu = TRY(window.try_add_menu("&File"_short_string)); |     auto file_menu = TRY(window.try_add_menu("&File"_short_string)); | ||||||
|     TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) { |     TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) { | ||||||
|         auto response = FileSystemAccessClient::Client::the().open_file(&window, "Open video file..."); |         auto response = FileSystemAccessClient::Client::the().open_file(&window); | ||||||
|         if (response.is_error()) |         if (response.is_error()) | ||||||
|             return; |             return; | ||||||
| 
 | 
 | ||||||
|  | @ -408,7 +408,7 @@ ErrorOr<void> VideoPlayerWidget::initialize_menubar(GUI::Window& window) | ||||||
|     auto view_menu = TRY(window.try_add_menu("&View"_short_string)); |     auto view_menu = TRY(window.try_add_menu("&View"_short_string)); | ||||||
|     TRY(view_menu->try_add_action(*m_toggle_fullscreen_action)); |     TRY(view_menu->try_add_action(*m_toggle_fullscreen_action)); | ||||||
| 
 | 
 | ||||||
|     auto sizing_mode_menu = TRY(view_menu->try_add_submenu(TRY("&Sizing mode"_string))); |     auto sizing_mode_menu = TRY(view_menu->try_add_submenu(TRY("&Sizing Mode"_string))); | ||||||
|     sizing_mode_menu->set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/fit-image-to-view.png"sv))); |     sizing_mode_menu->set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/fit-image-to-view.png"sv))); | ||||||
| 
 | 
 | ||||||
|     m_sizing_mode_group = make<GUI::ActionGroup>(); |     m_sizing_mode_group = make<GUI::ActionGroup>(); | ||||||
|  |  | ||||||
|  | @ -417,7 +417,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     auto& export_submenu = file_menu->add_submenu("&Export"_short_string); |     auto& export_submenu = file_menu->add_submenu("&Export"_short_string); | ||||||
| 
 | 
 | ||||||
|     TRY(export_submenu.try_add_action(GUI::Action::create("As &BMP", |     TRY(export_submenu.try_add_action(GUI::Action::create("As &BMP...", | ||||||
|         [&](GUI::Action&) { |         [&](GUI::Action&) { | ||||||
|             Optional<DeprecatedString> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "bmp"); |             Optional<DeprecatedString> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "bmp"); | ||||||
|             if (!export_path.has_value()) |             if (!export_path.has_value()) | ||||||
|  | @ -425,7 +425,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|             if (auto result = mandelbrot->export_image(export_path.value(), ImageType::BMP); result.is_error()) |             if (auto result = mandelbrot->export_image(export_path.value(), ImageType::BMP); result.is_error()) | ||||||
|                 GUI::MessageBox::show_error(window, DeprecatedString::formatted("{}", result.error())); |                 GUI::MessageBox::show_error(window, DeprecatedString::formatted("{}", result.error())); | ||||||
|         }))); |         }))); | ||||||
|     TRY(export_submenu.try_add_action(GUI::Action::create("As &PNG", { Mod_Ctrl | Mod_Shift, Key_S }, |     TRY(export_submenu.try_add_action(GUI::Action::create("As &PNG...", { Mod_Ctrl | Mod_Shift, Key_S }, | ||||||
|         [&](GUI::Action&) { |         [&](GUI::Action&) { | ||||||
|             Optional<DeprecatedString> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "png"); |             Optional<DeprecatedString> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "png"); | ||||||
|             if (!export_path.has_value()) |             if (!export_path.has_value()) | ||||||
|  | @ -433,7 +433,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|             if (auto result = mandelbrot->export_image(export_path.value(), ImageType::PNG); result.is_error()) |             if (auto result = mandelbrot->export_image(export_path.value(), ImageType::PNG); result.is_error()) | ||||||
|                 GUI::MessageBox::show_error(window, DeprecatedString::formatted("{}", result.error())); |                 GUI::MessageBox::show_error(window, DeprecatedString::formatted("{}", result.error())); | ||||||
|         }))); |         }))); | ||||||
|     TRY(export_submenu.try_add_action(GUI::Action::create("As &QOI", |     TRY(export_submenu.try_add_action(GUI::Action::create("As &QOI...", | ||||||
|         [&](GUI::Action&) { |         [&](GUI::Action&) { | ||||||
|             Optional<DeprecatedString> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "qoi"); |             Optional<DeprecatedString> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "qoi"); | ||||||
|             if (!export_path.has_value()) |             if (!export_path.has_value()) | ||||||
|  |  | ||||||
|  | @ -113,7 +113,7 @@ | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|                     name: "enabled_coolbar_button" |                     name: "enabled_coolbar_button" | ||||||
|                     text: "Coolbar button" |                     text: "Coolbar Button" | ||||||
|                     button_style: "Coolbar" |                     button_style: "Coolbar" | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|  | @ -190,7 +190,7 @@ | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|                     name: "icon_button" |                     name: "icon_button" | ||||||
|                     text: "Icon button" |                     text: "Icon Button" | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|  | @ -265,7 +265,7 @@ | ||||||
| 
 | 
 | ||||||
|                     @GUI::ColorInput { |                     @GUI::ColorInput { | ||||||
|                         name: "font_colorinput" |                         name: "font_colorinput" | ||||||
|                         placeholder: "Color dialog" |                         placeholder: "Color Picker" | ||||||
|                     } |                     } | ||||||
| 
 | 
 | ||||||
|                     @GUI::ColorInput { |                     @GUI::ColorInput { | ||||||
|  | @ -278,17 +278,17 @@ | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|                     name: "font_button" |                     name: "font_button" | ||||||
|                     text: "Font picker dialog..." |                     text: "Font Picker" | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|                     name: "file_button" |                     name: "file_button" | ||||||
|                     text: "File picker dialog..." |                     text: "File Picker" | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|                     name: "input_button" |                     name: "input_button" | ||||||
|                     text: "Input dialog..." |                     text: "Input Box" | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 @GUI::Layout::Spacer {} |                 @GUI::Layout::Spacer {} | ||||||
|  | @ -322,7 +322,7 @@ | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|                     name: "msgbox_button" |                     name: "msgbox_button" | ||||||
|                     text: "Message box dialog..." |                     text: "Message Box" | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -11,7 +11,7 @@ | ||||||
| 
 | 
 | ||||||
|         @GUI::Button { |         @GUI::Button { | ||||||
|             name: "wizard_button" |             name: "wizard_button" | ||||||
|             text: "Start wizard" |             text: "Start Wizard" | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         @GUI::HorizontalSeparator {} |         @GUI::HorizontalSeparator {} | ||||||
|  |  | ||||||
|  | @ -47,7 +47,7 @@ NewProjectDialog::NewProjectDialog(GUI::Window* parent) | ||||||
|     resize(500, 385); |     resize(500, 385); | ||||||
|     center_on_screen(); |     center_on_screen(); | ||||||
|     set_resizable(false); |     set_resizable(false); | ||||||
|     set_title("New project"); |     set_title("New Project"); | ||||||
| 
 | 
 | ||||||
|     auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); |     auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); | ||||||
|     main_widget->load_from_gml(new_project_dialog_gml).release_value_but_fixme_should_propagate_errors(); |     main_widget->load_from_gml(new_project_dialog_gml).release_value_but_fixme_should_propagate_errors(); | ||||||
|  | @ -189,13 +189,13 @@ void NewProjectDialog::do_create_project() | ||||||
| 
 | 
 | ||||||
|     auto create_in = m_create_in_input->text(); |     auto create_in = m_create_in_input->text(); | ||||||
|     if (!FileSystem::exists(create_in) || !FileSystem::is_directory(create_in)) { |     if (!FileSystem::exists(create_in) || !FileSystem::is_directory(create_in)) { | ||||||
|         auto result = GUI::MessageBox::show(this, DeprecatedString::formatted("The directory {} does not exist yet, would you like to create it?", create_in), "New project"sv, GUI::MessageBox::Type::Question, GUI::MessageBox::InputType::YesNo); |         auto result = GUI::MessageBox::show(this, DeprecatedString::formatted("The directory \"{}\" does not exist yet, would you like to create it?", create_in), "New Project"sv, GUI::MessageBox::Type::Question, GUI::MessageBox::InputType::YesNo); | ||||||
|         if (result != GUI::MessageBox::ExecResult::Yes) |         if (result != GUI::MessageBox::ExecResult::Yes) | ||||||
|             return; |             return; | ||||||
| 
 | 
 | ||||||
|         auto created = Core::Directory::create(maybe_project_full_path.value(), Core::Directory::CreateDirectories::Yes); |         auto created = Core::Directory::create(maybe_project_full_path.value(), Core::Directory::CreateDirectories::Yes); | ||||||
|         if (created.is_error()) { |         if (created.is_error()) { | ||||||
|             GUI::MessageBox::show_error(this, DeprecatedString::formatted("Could not create directory {}", create_in)); |             GUI::MessageBox::show_error(this, DeprecatedString::formatted("Could not create directory \"{}\"", create_in)); | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -68,7 +68,7 @@ Editor::Editor() | ||||||
|     create_tokens_info_timer(); |     create_tokens_info_timer(); | ||||||
| 
 | 
 | ||||||
|     set_document(CodeDocument::create()); |     set_document(CodeDocument::create()); | ||||||
|     m_move_execution_to_line_action = GUI::Action::create("Set execution point to line", [this](auto&) { |     m_move_execution_to_line_action = GUI::Action::create("Set Execution Point to Cursor Line", [this](auto&) { | ||||||
|         VERIFY(is_program_running()); |         VERIFY(is_program_running()); | ||||||
|         auto success = Debugger::the().set_execution_position(currently_open_file(), cursor().line()); |         auto success = Debugger::the().set_execution_position(currently_open_file(), cursor().line()); | ||||||
|         if (success) { |         if (success) { | ||||||
|  |  | ||||||
|  | @ -122,8 +122,8 @@ FindInFilesWidget::FindInFilesWidget() | ||||||
| 
 | 
 | ||||||
|     m_textbox = top_container.add<GUI::TextBox>(); |     m_textbox = top_container.add<GUI::TextBox>(); | ||||||
| 
 | 
 | ||||||
|     m_button = top_container.add<GUI::Button>("Find in files"_string.release_value_but_fixme_should_propagate_errors()); |     m_button = top_container.add<GUI::Button>("Find"_string.release_value_but_fixme_should_propagate_errors()); | ||||||
|     m_button->set_fixed_width(100); |     m_button->set_fixed_width(50); | ||||||
| 
 | 
 | ||||||
|     m_result_view = add<GUI::TableView>(); |     m_result_view = add<GUI::TableView>(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -522,7 +522,7 @@ ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_new_file_action(Dep | ||||||
|     auto icon_no_shadow = TRY(Gfx::Bitmap::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&) { |     return GUI::Action::create(label, icon_no_shadow, [this, extension](const GUI::Action&) { | ||||||
|         String filename; |         String filename; | ||||||
|         if (GUI::InputBox::show(window(), filename, "Enter name of new file:"sv, "Add new file to project"sv) != GUI::InputBox::ExecResult::OK) |         if (GUI::InputBox::show(window(), filename, "Enter a name:"sv, "New File"sv) != GUI::InputBox::ExecResult::OK) | ||||||
|             return; |             return; | ||||||
| 
 | 
 | ||||||
|         if (!extension.is_empty() && !AK::StringUtils::ends_with(filename, DeprecatedString::formatted(".{}", extension), CaseSensitivity::CaseSensitive)) { |         if (!extension.is_empty() && !AK::StringUtils::ends_with(filename, DeprecatedString::formatted(".{}", extension), CaseSensitivity::CaseSensitive)) { | ||||||
|  | @ -564,7 +564,7 @@ ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_new_directory_actio | ||||||
|     auto icon = TRY(Gfx::Bitmap::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&) { |     return GUI::Action::create("&Directory...", { Mod_Ctrl | Mod_Shift, Key_N }, icon, [this](const GUI::Action&) { | ||||||
|         String directory_name; |         String 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) |         if (GUI::InputBox::show(window(), directory_name, "Enter a name:"sv, "New Directory"sv) != GUI::InputBox::ExecResult::OK) | ||||||
|             return; |             return; | ||||||
| 
 | 
 | ||||||
|         auto path_to_selected = selected_file_paths(); |         auto path_to_selected = selected_file_paths(); | ||||||
|  | @ -658,14 +658,14 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_delete_action() | ||||||
|         DeprecatedString message; |         DeprecatedString message; | ||||||
|         if (files.size() == 1) { |         if (files.size() == 1) { | ||||||
|             LexicalPath file(files[0]); |             LexicalPath file(files[0]); | ||||||
|             message = DeprecatedString::formatted("Really remove {} from disk?", file.basename()); |             message = DeprecatedString::formatted("Really remove \"{}\" from disk?", file.basename()); | ||||||
|         } else { |         } else { | ||||||
|             message = DeprecatedString::formatted("Really remove {} files from disk?", files.size()); |             message = DeprecatedString::formatted("Really remove \"{}\" files from disk?", files.size()); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         auto result = GUI::MessageBox::show(window(), |         auto result = GUI::MessageBox::show(window(), | ||||||
|             message, |             message, | ||||||
|             "Confirm deletion"sv, |             "Confirm Deletion"sv, | ||||||
|             GUI::MessageBox::Type::Warning, |             GUI::MessageBox::Type::Warning, | ||||||
|             GUI::MessageBox::InputType::OKCancel); |             GUI::MessageBox::InputType::OKCancel); | ||||||
|         if (result == GUI::MessageBox::ExecResult::Cancel) |         if (result == GUI::MessageBox::ExecResult::Cancel) | ||||||
|  | @ -676,7 +676,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_delete_action() | ||||||
|             if (lstat(file.characters(), &st) < 0) { |             if (lstat(file.characters(), &st) < 0) { | ||||||
|                 GUI::MessageBox::show(window(), |                 GUI::MessageBox::show(window(), | ||||||
|                     DeprecatedString::formatted("lstat ({}) failed: {}", file, strerror(errno)), |                     DeprecatedString::formatted("lstat ({}) failed: {}", file, strerror(errno)), | ||||||
|                     "Removal failed"sv, |                     "Removal Failed"sv, | ||||||
|                     GUI::MessageBox::Type::Error); |                     GUI::MessageBox::Type::Error); | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|  | @ -686,13 +686,13 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_delete_action() | ||||||
|                 auto& error = result.error(); |                 auto& error = result.error(); | ||||||
|                 if (is_directory) { |                 if (is_directory) { | ||||||
|                     GUI::MessageBox::show(window(), |                     GUI::MessageBox::show(window(), | ||||||
|                         DeprecatedString::formatted("Removing directory {} from the project failed: {}", file, error), |                         DeprecatedString::formatted("Removing directory \"{}\" from the project failed: {}", file, error), | ||||||
|                         "Removal failed"sv, |                         "Removal Failed"sv, | ||||||
|                         GUI::MessageBox::Type::Error); |                         GUI::MessageBox::Type::Error); | ||||||
|                 } else { |                 } else { | ||||||
|                     GUI::MessageBox::show(window(), |                     GUI::MessageBox::show(window(), | ||||||
|                         DeprecatedString::formatted("Removing file {} from the project failed: {}", file, error), |                         DeprecatedString::formatted("Removing file \"{}\" from the project failed: {}", file, error), | ||||||
|                         "Removal failed"sv, |                         "Removal Failed"sv, | ||||||
|                         GUI::MessageBox::Type::Error); |                         GUI::MessageBox::Type::Error); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  | @ -873,7 +873,7 @@ ErrorOr<NonnullRefPtr<GUI::Action>> HackStudioWidget::create_open_action() | ||||||
| { | { | ||||||
|     auto icon = TRY(Gfx::Bitmap::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&) { |     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); |         auto open_path = GUI::FilePicker::get_open_filepath(window(), "Open Project", m_project->root_path(), true); | ||||||
|         if (!open_path.has_value()) |         if (!open_path.has_value()) | ||||||
|             return; |             return; | ||||||
|         open_project(open_path.value()); |         open_project(open_path.value()); | ||||||
|  | @ -1147,7 +1147,7 @@ void HackStudioWidget::build() | ||||||
| { | { | ||||||
|     auto result = m_project_builder->build(active_file()); |     auto result = m_project_builder->build(active_file()); | ||||||
|     if (result.is_error()) { |     if (result.is_error()) { | ||||||
|         GUI::MessageBox::show(window(), DeprecatedString::formatted("{}", result.error()), "Build failed"sv, GUI::MessageBox::Type::Error); |         GUI::MessageBox::show(window(), DeprecatedString::formatted("{}", result.error()), "Build Failed"sv, GUI::MessageBox::Type::Error); | ||||||
|         m_build_action->set_enabled(true); |         m_build_action->set_enabled(true); | ||||||
|         m_stop_action->set_enabled(false); |         m_stop_action->set_enabled(false); | ||||||
|     } else { |     } else { | ||||||
|  | @ -1159,7 +1159,7 @@ void HackStudioWidget::run() | ||||||
| { | { | ||||||
|     auto result = m_project_builder->run(active_file()); |     auto result = m_project_builder->run(active_file()); | ||||||
|     if (result.is_error()) { |     if (result.is_error()) { | ||||||
|         GUI::MessageBox::show(window(), DeprecatedString::formatted("{}", result.error()), "Run failed"sv, GUI::MessageBox::Type::Error); |         GUI::MessageBox::show(window(), DeprecatedString::formatted("{}", result.error()), "Run Failed"sv, GUI::MessageBox::Type::Error); | ||||||
|         m_run_action->set_enabled(true); |         m_run_action->set_enabled(true); | ||||||
|         m_stop_action->set_enabled(false); |         m_stop_action->set_enabled(false); | ||||||
|     } else { |     } else { | ||||||
|  | @ -1337,7 +1337,7 @@ ErrorOr<void> HackStudioWidget::create_action_tab(GUI::Widget& parent) | ||||||
|         first_time = false; |         first_time = false; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     m_find_in_files_widget = m_action_tab_widget->add_tab<FindInFilesWidget>(TRY("Find in files"_string)); |     m_find_in_files_widget = m_action_tab_widget->add_tab<FindInFilesWidget>(TRY("Find"_string)); | ||||||
|     m_todo_entries_widget = m_action_tab_widget->add_tab<ToDoEntriesWidget>("TODO"_short_string); |     m_todo_entries_widget = m_action_tab_widget->add_tab<ToDoEntriesWidget>("TODO"_short_string); | ||||||
|     m_terminal_wrapper = m_action_tab_widget->add_tab<TerminalWrapper>("Console"_short_string, false); |     m_terminal_wrapper = m_action_tab_widget->add_tab<TerminalWrapper>("Console"_short_string, false); | ||||||
|     auto debug_info_widget = TRY(DebugInfoWidget::create()); |     auto debug_info_widget = TRY(DebugInfoWidget::create()); | ||||||
|  | @ -1393,7 +1393,7 @@ void HackStudioWidget::update_recent_projects_submenu() | ||||||
|     auto recent_projects = read_recent_projects(); |     auto recent_projects = read_recent_projects(); | ||||||
| 
 | 
 | ||||||
|     if (recent_projects.size() <= 1) { |     if (recent_projects.size() <= 1) { | ||||||
|         auto empty_action = GUI::Action::create("Empty...", [](auto&) {}); |         auto empty_action = GUI::Action::create("(No recently open files)", [](auto&) {}); | ||||||
|         empty_action->set_enabled(false); |         empty_action->set_enabled(false); | ||||||
|         m_recent_projects_submenu->add_action(empty_action); |         m_recent_projects_submenu->add_action(empty_action); | ||||||
|         return; |         return; | ||||||
|  | @ -1542,7 +1542,7 @@ ErrorOr<void> HackStudioWidget::create_view_menu(GUI::Window& window) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     auto icon = TRY(Gfx::Bitmap::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, |     m_editor_font_action = GUI::Action::create("Change &Font...", icon, | ||||||
|         [&](auto&) { |         [&](auto&) { | ||||||
|             auto picker = GUI::FontPicker::construct(&window, m_editor_font, false); |             auto picker = GUI::FontPicker::construct(&window, m_editor_font, false); | ||||||
|             if (picker->exec() == GUI::Dialog::ExecResult::OK) { |             if (picker->exec() == GUI::Dialog::ExecResult::OK) { | ||||||
|  | @ -1663,7 +1663,7 @@ HackStudioWidget::ContinueDecision HackStudioWidget::warn_unsaved_changes(Deprec | ||||||
|     if (!any_document_is_dirty()) |     if (!any_document_is_dirty()) | ||||||
|         return ContinueDecision::Yes; |         return ContinueDecision::Yes; | ||||||
| 
 | 
 | ||||||
|     auto result = GUI::MessageBox::show(window(), prompt, "Unsaved changes"sv, GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNoCancel); |     auto result = GUI::MessageBox::show(window(), prompt, "Unsaved Changes"sv, GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNoCancel); | ||||||
| 
 | 
 | ||||||
|     if (result == GUI::MessageBox::ExecResult::Cancel) |     if (result == GUI::MessageBox::ExecResult::Cancel) | ||||||
|         return ContinueDecision::No; |         return ContinueDecision::No; | ||||||
|  |  | ||||||
|  | @ -180,7 +180,7 @@ ErrorOr<void> MainWidget::setup() | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     m_run_script_action = GUI::Action::create("Run script", { Mod_Alt, Key_F9 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/play.png"sv)), [&](auto&) { |     m_run_script_action = GUI::Action::create("Run Script", { Mod_Alt, Key_F9 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/play.png"sv)), [&](auto&) { | ||||||
|         m_results.clear(); |         m_results.clear(); | ||||||
|         m_current_line_for_parsing = 0; |         m_current_line_for_parsing = 0; | ||||||
|         read_next_sql_statement_of_editor(); |         read_next_sql_statement_of_editor(); | ||||||
|  |  | ||||||
|  | @ -10,7 +10,7 @@ | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         @GUI::Label { |         @GUI::Label { | ||||||
|             text: "Board size" |             text: "Board size:" | ||||||
|             text_alignment: "CenterLeft" |             text_alignment: "CenterLeft" | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | @ -27,7 +27,7 @@ | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         @GUI::Label { |         @GUI::Label { | ||||||
|             text: "Target tile" |             text: "Target tile:" | ||||||
|             text_alignment: "CenterLeft" |             text_alignment: "CenterLeft" | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -10,7 +10,7 @@ | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         @GUI::Label { |         @GUI::Label { | ||||||
|             text: "Board rows" |             text: "Board rows:" | ||||||
|             text_alignment: "CenterLeft" |             text_alignment: "CenterLeft" | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | @ -27,7 +27,7 @@ | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         @GUI::Label { |         @GUI::Label { | ||||||
|             text: "Board columns" |             text: "Board columns:" | ||||||
|             text_alignment: "CenterLeft" |             text_alignment: "CenterLeft" | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -34,7 +34,7 @@ | ||||||
|             @GUI::VerticalSeparator {} |             @GUI::VerticalSeparator {} | ||||||
| 
 | 
 | ||||||
|             @GUI::Label { |             @GUI::Label { | ||||||
|                 text: "Update Speed: " |                 text: "Speed: " | ||||||
|                 autosize: true |                 autosize: true | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -50,7 +50,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     size_t board_rows = 35; |     size_t board_rows = 35; | ||||||
| 
 | 
 | ||||||
|     window->set_double_buffering_enabled(false); |     window->set_double_buffering_enabled(false); | ||||||
|     window->set_title("Game Of Life"); |     window->set_title("Game of Life"); | ||||||
| 
 | 
 | ||||||
|     auto main_widget = TRY(window->set_main_widget<GUI::Widget>()); |     auto main_widget = TRY(window->set_main_widget<GUI::Widget>()); | ||||||
|     TRY(main_widget->load_from_gml(game_of_life_gml)); |     TRY(main_widget->load_from_gml(game_of_life_gml)); | ||||||
|  | @ -143,7 +143,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) { |     TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) { | ||||||
|         Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/GameOfLife.md"), "/bin/Help"); |         Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/GameOfLife.md"), "/bin/Help"); | ||||||
|     }))); |     }))); | ||||||
|     TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Game Of Life", app_icon, window))); |     TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Game of Life", app_icon, window))); | ||||||
| 
 | 
 | ||||||
|     board_widget->on_running_state_change = [&]() { |     board_widget->on_running_state_change = [&]() { | ||||||
|         if (board_widget->is_running()) { |         if (board_widget->is_running()) { | ||||||
|  |  | ||||||
|  | @ -95,7 +95,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     }))); |     }))); | ||||||
|     TRY(game_menu->try_add_separator()); |     TRY(game_menu->try_add_separator()); | ||||||
|     TRY(game_menu->try_add_action(TRY(Cards::make_cards_settings_action(window)))); |     TRY(game_menu->try_add_action(TRY(Cards::make_cards_settings_action(window)))); | ||||||
|     TRY(game_menu->try_add_action(GUI::Action::create("Hearts &Settings", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/settings.png"sv)), [&](auto&) { |     TRY(game_menu->try_add_action(GUI::Action::create("&Settings", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/settings.png"sv)), [&](auto&) { | ||||||
|         change_settings(); |         change_settings(); | ||||||
|     }))); |     }))); | ||||||
|     TRY(game_menu->try_add_separator()); |     TRY(game_menu->try_add_separator()); | ||||||
|  |  | ||||||
|  | @ -75,7 +75,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     TRY(settings_menu->try_add_action(GUI::Action::create("Set &Word Length...", [&](auto&) { |     TRY(settings_menu->try_add_action(GUI::Action::create("Set &Word Length...", [&](auto&) { | ||||||
|         auto word_length = Config::read_i32("MasterWord"sv, ""sv, "word_length"sv, 5); |         auto word_length = Config::read_i32("MasterWord"sv, ""sv, "word_length"sv, 5); | ||||||
|         auto result = GUI::InputBox::show_numeric(window, word_length, shortest_word, longest_word, "Word length"sv); |         auto result = GUI::InputBox::show_numeric(window, word_length, shortest_word, longest_word, "Word Length"sv); | ||||||
|         if (!result.is_error() && result.value() == GUI::InputBox::ExecResult::OK) { |         if (!result.is_error() && result.value() == GUI::InputBox::ExecResult::OK) { | ||||||
|             Config::write_i32("MasterWord"sv, ""sv, "word_length"sv, word_length); |             Config::write_i32("MasterWord"sv, ""sv, "word_length"sv, word_length); | ||||||
|             game.set_word_length(word_length); |             game.set_word_length(word_length); | ||||||
|  | @ -83,14 +83,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     }))); |     }))); | ||||||
|     TRY(settings_menu->try_add_action(GUI::Action::create("Set &Number of Guesses...", [&](auto&) { |     TRY(settings_menu->try_add_action(GUI::Action::create("Set &Number of Guesses...", [&](auto&) { | ||||||
|         auto max_guesses = Config::read_i32("MasterWord"sv, ""sv, "max_guesses"sv, 5); |         auto max_guesses = Config::read_i32("MasterWord"sv, ""sv, "max_guesses"sv, 5); | ||||||
|         auto result = GUI::InputBox::show_numeric(window, max_guesses, 1, 20, "Number of guesses"sv); |         auto result = GUI::InputBox::show_numeric(window, max_guesses, 1, 20, "Number of Guesses"sv); | ||||||
|         if (!result.is_error() && result.value() == GUI::InputBox::ExecResult::OK) { |         if (!result.is_error() && result.value() == GUI::InputBox::ExecResult::OK) { | ||||||
|             Config::write_i32("MasterWord"sv, ""sv, "max_guesses"sv, max_guesses); |             Config::write_i32("MasterWord"sv, ""sv, "max_guesses"sv, max_guesses); | ||||||
|             game.set_max_guesses(max_guesses); |             game.set_max_guesses(max_guesses); | ||||||
|         } |         } | ||||||
|     }))); |     }))); | ||||||
| 
 | 
 | ||||||
|     auto toggle_check_guesses = GUI::Action::create_checkable("Check &Guesses in dictionary", [&](auto& action) { |     auto toggle_check_guesses = GUI::Action::create_checkable("Check &Guesses in Dictionary", [&](auto& action) { | ||||||
|         auto checked = action.is_checked(); |         auto checked = action.is_checked(); | ||||||
|         game.set_check_guesses_in_dictionary(checked); |         game.set_check_guesses_in_dictionary(checked); | ||||||
|         Config::write_bool("MasterWord"sv, ""sv, "check_guesses_in_dictionary"sv, checked); |         Config::write_bool("MasterWord"sv, ""sv, "check_guesses_in_dictionary"sv, checked); | ||||||
|  |  | ||||||
|  | @ -43,7 +43,7 @@ CustomGameDialog::CustomGameDialog(Window* parent_window) | ||||||
| { | { | ||||||
|     resize(300, 82); |     resize(300, 82); | ||||||
|     set_resizable(false); |     set_resizable(false); | ||||||
|     set_title("Custom game"); |     set_title("Custom Game"); | ||||||
| 
 | 
 | ||||||
|     auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); |     auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); | ||||||
|     main_widget->load_from_gml(minesweeper_custom_game_window_gml).release_value_but_fixme_should_propagate_errors(); |     main_widget->load_from_gml(minesweeper_custom_game_window_gml).release_value_but_fixme_should_propagate_errors(); | ||||||
|  |  | ||||||
|  | @ -66,7 +66,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     TRY(game_menu->try_add_separator()); |     TRY(game_menu->try_add_separator()); | ||||||
| 
 | 
 | ||||||
|     auto chord_toggler_action = GUI::Action::create_checkable("Single-click chording", [&](auto& action) { |     auto chord_toggler_action = GUI::Action::create_checkable("&Single-click Chording", [&](auto& action) { | ||||||
|         field->set_single_chording(action.is_checked()); |         field->set_single_chording(action.is_checked()); | ||||||
|     }); |     }); | ||||||
|     chord_toggler_action->set_checked(field->is_single_chording()); |     chord_toggler_action->set_checked(field->is_single_chording()); | ||||||
|  | @ -111,7 +111,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     difficulty_actions.add_action(action); |     difficulty_actions.add_action(action); | ||||||
| 
 | 
 | ||||||
|     TRY(difficulty_menu->try_add_separator()); |     TRY(difficulty_menu->try_add_separator()); | ||||||
|     action = GUI::Action::create_checkable("&Custom game...", { Mod_Ctrl, Key_C }, [&](auto&) { |     action = GUI::Action::create_checkable("&Custom Game...", { Mod_Ctrl, Key_C }, [&](auto&) { | ||||||
|         CustomGameDialog::show(window, field); |         CustomGameDialog::show(window, field); | ||||||
|     }); |     }); | ||||||
|     action->set_checked(field->difficulty() == Field::Difficulty::Custom); |     action->set_checked(field->difficulty() == Field::Difficulty::Custom); | ||||||
|  |  | ||||||
|  | @ -98,7 +98,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|         } |         } | ||||||
|     }))); |     }))); | ||||||
| 
 | 
 | ||||||
|     auto change_snake_color = GUI::Action::create("&Change snake color", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/color-chooser.png"sv)), [&](auto&) { |     auto change_snake_color = GUI::Action::create("&Change Snake Color", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/color-chooser.png"sv)), [&](auto&) { | ||||||
|         auto was_paused = game.is_paused(); |         auto was_paused = game.is_paused(); | ||||||
|         if (!was_paused) |         if (!was_paused) | ||||||
|             game.pause(); |             game.pause(); | ||||||
|  |  | ||||||
|  | @ -42,7 +42,7 @@ private: | ||||||
|     void set_color_internal(Color, AllowCallback, bool change_text); |     void set_color_internal(Color, AllowCallback, bool change_text); | ||||||
| 
 | 
 | ||||||
|     Color m_color; |     Color m_color; | ||||||
|     DeprecatedString m_color_picker_title { "Select color" }; |     DeprecatedString m_color_picker_title { "Color Picker" }; | ||||||
|     bool m_color_has_alpha_channel { true }; |     bool m_color_has_alpha_channel { true }; | ||||||
|     bool m_may_be_color_rect_click { false }; |     bool m_may_be_color_rect_click { false }; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -407,7 +407,7 @@ void ColorPicker::build_ui_custom(Widget& root_container) | ||||||
|     make_spinbox(Blue, m_color.blue()); |     make_spinbox(Blue, m_color.blue()); | ||||||
|     make_spinbox(Alpha, m_color.alpha()); |     make_spinbox(Alpha, m_color.alpha()); | ||||||
| 
 | 
 | ||||||
|     m_selector_button = vertical_container.add<GUI::Button>("Select on screen"_string.release_value_but_fixme_should_propagate_errors()); |     m_selector_button = vertical_container.add<GUI::Button>("Select on Screen"_string.release_value_but_fixme_should_propagate_errors()); | ||||||
|     m_selector_button->on_click = [this](auto) { |     m_selector_button->on_click = [this](auto) { | ||||||
|         auto selector = ColorSelectOverlay::construct(); |         auto selector = ColorSelectOverlay::construct(); | ||||||
|         auto original_color = m_color; |         auto original_color = m_color; | ||||||
|  |  | ||||||
|  | @ -28,7 +28,7 @@ public: | ||||||
|     Color color() const { return m_color; } |     Color color() const { return m_color; } | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     explicit ColorPicker(Color, Window* parent_window = nullptr, DeprecatedString title = "Edit Color"); |     explicit ColorPicker(Color, Window* parent_window = nullptr, DeprecatedString title = "Color Picker"); | ||||||
| 
 | 
 | ||||||
|     void build_ui(); |     void build_ui(); | ||||||
|     void build_ui_custom(Widget& root_container); |     void build_ui_custom(Widget& root_container); | ||||||
|  |  | ||||||
|  | @ -170,7 +170,7 @@ NonnullRefPtr<Action> make_select_all_action(Function<void(Action&)> callback, C | ||||||
| 
 | 
 | ||||||
| NonnullRefPtr<Action> make_rename_action(Function<void(Action&)> callback, Core::Object* parent) | NonnullRefPtr<Action> make_rename_action(Function<void(Action&)> callback, Core::Object* parent) | ||||||
| { | { | ||||||
|     return Action::create("Re&name", Key_F2, Gfx::Bitmap::load_from_file("/res/icons/16x16/rename.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); |     return Action::create("Re&name...", Key_F2, Gfx::Bitmap::load_from_file("/res/icons/16x16/rename.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| NonnullRefPtr<Action> make_properties_action(Function<void(Action&)> callback, Core::Object* parent) | NonnullRefPtr<Action> make_properties_action(Function<void(Action&)> callback, Core::Object* parent) | ||||||
|  | @ -205,7 +205,7 @@ NonnullRefPtr<Action> make_rotate_counterclockwise_action(Function<void(Action&) | ||||||
| 
 | 
 | ||||||
| NonnullRefPtr<Action> make_command_palette_action(Window* window) | NonnullRefPtr<Action> make_command_palette_action(Window* window) | ||||||
| { | { | ||||||
|     auto action = Action::create("&Commands...", { Mod_Ctrl | Mod_Shift, Key_A }, MUST(Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv)), [=](auto&) { |     auto action = Action::create("Find &Command...", { Mod_Ctrl | Mod_Shift, Key_A }, MUST(Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv)), [=](auto&) { | ||||||
|         auto command_palette = CommandPalette::construct(*window); |         auto command_palette = CommandPalette::construct(*window); | ||||||
|         if (command_palette->exec() != GUI::Dialog::ExecResult::OK) |         if (command_palette->exec() != GUI::Dialog::ExecResult::OK) | ||||||
|             return; |             return; | ||||||
|  |  | ||||||
|  | @ -104,7 +104,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St | ||||||
|         set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors()); |         set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors()); | ||||||
|         break; |         break; | ||||||
|     case Mode::Save: |     case Mode::Save: | ||||||
|         set_title("Save as"); |         set_title("Save As"); | ||||||
|         set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/save-as.png"sv).release_value_but_fixme_should_propagate_errors()); |         set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/save-as.png"sv).release_value_but_fixme_should_propagate_errors()); | ||||||
|         break; |         break; | ||||||
|     } |     } | ||||||
|  | @ -170,7 +170,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     auto open_parent_directory_action = Action::create( |     auto open_parent_directory_action = Action::create( | ||||||
|         "Open parent directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::load_from_file("/res/icons/16x16/open-parent-directory.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) { |         "Open Parent Directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::load_from_file("/res/icons/16x16/open-parent-directory.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) { | ||||||
|             set_path(DeprecatedString::formatted("{}/..", m_model->root_path())); |             set_path(DeprecatedString::formatted("{}/..", m_model->root_path())); | ||||||
|         }, |         }, | ||||||
|         this); |         this); | ||||||
|  | @ -184,13 +184,13 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St | ||||||
|     toolbar.add_separator(); |     toolbar.add_separator(); | ||||||
| 
 | 
 | ||||||
|     auto mkdir_action = Action::create( |     auto mkdir_action = 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(), [this](Action const&) { |         "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(), [this](Action const&) { | ||||||
|             String value; |             String value; | ||||||
|             if (InputBox::show(this, value, "Enter name:"sv, "New directory"sv, GUI::InputType::NonemptyText) == InputBox::ExecResult::OK) { |             if (InputBox::show(this, value, "Enter a name:"sv, "New Directory"sv, GUI::InputType::NonemptyText) == InputBox::ExecResult::OK) { | ||||||
|                 auto new_dir_path = LexicalPath::canonicalized_path(DeprecatedString::formatted("{}/{}", m_model->root_path(), value)); |                 auto new_dir_path = LexicalPath::canonicalized_path(DeprecatedString::formatted("{}/{}", m_model->root_path(), value)); | ||||||
|                 int rc = mkdir(new_dir_path.characters(), 0777); |                 int rc = mkdir(new_dir_path.characters(), 0777); | ||||||
|                 if (rc < 0) { |                 if (rc < 0) { | ||||||
|                     MessageBox::show(this, DeprecatedString::formatted("mkdir(\"{}\") failed: {}", new_dir_path, strerror(errno)), "Error"sv, MessageBox::Type::Error); |                     (void)MessageBox::try_show_error(this, DeprecatedString::formatted("Making new directory \"{}\" failed: {}", new_dir_path, Error::from_errno(errno))); | ||||||
|                 } else { |                 } else { | ||||||
|                     m_model->invalidate(); |                     m_model->invalidate(); | ||||||
|                 } |                 } | ||||||
|  | @ -228,7 +228,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St | ||||||
|     m_context_menu->add_separator(); |     m_context_menu->add_separator(); | ||||||
| 
 | 
 | ||||||
|     auto show_dotfiles = GUI::Action::create_checkable( |     auto show_dotfiles = GUI::Action::create_checkable( | ||||||
|         "Show dotfiles", { Mod_Ctrl, Key_H }, [&](auto& action) { |         "Show Dotfiles", { Mod_Ctrl, Key_H }, [&](auto& action) { | ||||||
|             m_model->set_should_show_dotfiles(action.is_checked()); |             m_model->set_should_show_dotfiles(action.is_checked()); | ||||||
|             m_model->invalidate(); |             m_model->invalidate(); | ||||||
|         }, |         }, | ||||||
|  | @ -296,7 +296,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     m_model->on_directory_change_error = [&](int, char const* error_string) { |     m_model->on_directory_change_error = [&](int, char const* error_string) { | ||||||
|         m_error_label->set_text(String::formatted("Could not open {}:\n{}", m_model->root_path(), error_string).release_value_but_fixme_should_propagate_errors()); |         m_error_label->set_text(String::formatted("Opening \"{}\" failed: {}", m_model->root_path(), error_string).release_value_but_fixme_should_propagate_errors()); | ||||||
|         m_view->set_active_widget(m_error_label); |         m_view->set_active_widget(m_error_label); | ||||||
| 
 | 
 | ||||||
|         m_view->view_as_icons_action().set_enabled(false); |         m_view->view_as_icons_action().set_enabled(false); | ||||||
|  | @ -347,12 +347,15 @@ void FilePicker::on_file_return() | ||||||
|     bool file_exists = FileSystem::exists(path); |     bool file_exists = FileSystem::exists(path); | ||||||
| 
 | 
 | ||||||
|     if (!file_exists && (m_mode == Mode::Open || m_mode == Mode::OpenFolder)) { |     if (!file_exists && (m_mode == Mode::Open || m_mode == Mode::OpenFolder)) { | ||||||
|         MessageBox::show(this, DeprecatedString::formatted("No such file or directory: {}", m_filename_textbox->text()), "File not found"sv, MessageBox::Type::Error, MessageBox::InputType::OK); |         (void)MessageBox::try_show_error(this, DeprecatedString::formatted("Opening \"{}\" failed: {}", m_filename_textbox->text(), Error::from_errno(ENOENT))); | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (file_exists && m_mode == Mode::Save) { |     if (file_exists && m_mode == Mode::Save) { | ||||||
|         auto result = MessageBox::show(this, "File already exists. Overwrite?"sv, "Existing File"sv, MessageBox::Type::Warning, MessageBox::InputType::OKCancel); |         auto text = String::formatted("Are you sure you want to overwrite \"{}\"?", m_filename_textbox->text()); | ||||||
|  |         if (text.is_error()) | ||||||
|  |             return; | ||||||
|  |         auto result = MessageBox::show(this, text.release_value(), "Confirm Overwrite"sv, MessageBox::Type::Warning, MessageBox::InputType::OKCancel); | ||||||
|         if (result == MessageBox::ExecResult::Cancel) |         if (result == MessageBox::ExecResult::Cancel) | ||||||
|             return; |             return; | ||||||
|     } |     } | ||||||
|  | @ -364,7 +367,7 @@ void FilePicker::on_file_return() | ||||||
| void FilePicker::set_path(DeprecatedString const& path) | void FilePicker::set_path(DeprecatedString const& path) | ||||||
| { | { | ||||||
|     if (access(path.characters(), R_OK | X_OK) == -1) { |     if (access(path.characters(), R_OK | X_OK) == -1) { | ||||||
|         GUI::MessageBox::show(this, DeprecatedString::formatted("Could not open '{}':\n{}", path, strerror(errno)), "Error"sv, GUI::MessageBox::Type::Error); |         (void)GUI::MessageBox::try_show_error(this, DeprecatedString::formatted("Opening \"{}\" failed: {}", path, Error::from_errno(errno))); | ||||||
|         auto& common_locations_tray = *find_descendant_of_type_named<GUI::Tray>("common_locations_tray"); |         auto& common_locations_tray = *find_descendant_of_type_named<GUI::Tray>("common_locations_tray"); | ||||||
|         for (auto& location_button : m_common_location_buttons) |         for (auto& location_button : m_common_location_buttons) | ||||||
|             common_locations_tray.set_item_checked(location_button.tray_item_index, m_model->root_path() == location_button.path); |             common_locations_tray.set_item_checked(location_button.tray_item_index, m_model->root_path() == location_button.path); | ||||||
|  |  | ||||||
|  | @ -22,7 +22,7 @@ FontPicker::FontPicker(Window* parent_window, Gfx::Font const* current_font, boo | ||||||
|     : Dialog(parent_window) |     : Dialog(parent_window) | ||||||
|     , m_fixed_width_only(fixed_width_only) |     , m_fixed_width_only(fixed_width_only) | ||||||
| { | { | ||||||
|     set_title("Font picker"); |     set_title("Font Picker"); | ||||||
|     resize(430, 280); |     resize(430, 280); | ||||||
|     set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors()); |     set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors()); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -84,7 +84,7 @@ ErrorOr<Dialog::ExecResult> MessageBox::try_ask_about_unsaved_changes(Window* pa | ||||||
|         TRY(builder.try_appendff("\nLast saved {} ago.", readable_time)); |         TRY(builder.try_appendff("\nLast saved {} ago.", readable_time)); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     auto box = TRY(MessageBox::create(parent_window, builder.string_view(), "Unsaved changes"sv, Type::Warning, InputType::YesNoCancel)); |     auto box = TRY(MessageBox::create(parent_window, builder.string_view(), "Unsaved Changes"sv, Type::Warning, InputType::YesNoCancel)); | ||||||
|     if (parent_window) |     if (parent_window) | ||||||
|         box->set_icon(parent_window->icon()); |         box->set_icon(parent_window->icon()); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -101,19 +101,19 @@ void MultiView::set_column_visible(int column_index, bool visible) | ||||||
| void MultiView::build_actions() | void MultiView::build_actions() | ||||||
| { | { | ||||||
|     m_view_as_icons_action = Action::create_checkable( |     m_view_as_icons_action = Action::create_checkable( | ||||||
|         "Icon view", { Mod_Ctrl, KeyCode::Key_1 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/icon-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { |         "Icon View", { Mod_Ctrl, KeyCode::Key_1 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/icon-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { | ||||||
|             set_view_mode(ViewMode::Icon); |             set_view_mode(ViewMode::Icon); | ||||||
|         }, |         }, | ||||||
|         this); |         this); | ||||||
| 
 | 
 | ||||||
|     m_view_as_table_action = Action::create_checkable( |     m_view_as_table_action = Action::create_checkable( | ||||||
|         "Table view", { Mod_Ctrl, KeyCode::Key_2 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/table-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { |         "Table View", { Mod_Ctrl, KeyCode::Key_2 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/table-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { | ||||||
|             set_view_mode(ViewMode::Table); |             set_view_mode(ViewMode::Table); | ||||||
|         }, |         }, | ||||||
|         this); |         this); | ||||||
| 
 | 
 | ||||||
|     m_view_as_columns_action = Action::create_checkable( |     m_view_as_columns_action = Action::create_checkable( | ||||||
|         "Columns view", { Mod_Ctrl, KeyCode::Key_3 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/columns-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { |         "Columns View", { Mod_Ctrl, KeyCode::Key_3 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/columns-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { | ||||||
|             set_view_mode(ViewMode::Columns); |             set_view_mode(ViewMode::Columns); | ||||||
|         }, |         }, | ||||||
|         this); |         this); | ||||||
|  |  | ||||||
|  | @ -73,7 +73,7 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(DeprecatedString t | ||||||
|         if (!window->is_modified()) |         if (!window->is_modified()) | ||||||
|             return Window::CloseRequestDecision::Close; |             return Window::CloseRequestDecision::Close; | ||||||
| 
 | 
 | ||||||
|         auto result = MessageBox::show(window, "Apply these settings before closing?"sv, "Unsaved changes"sv, MessageBox::Type::Warning, MessageBox::InputType::YesNoCancel); |         auto result = MessageBox::show(window, "Apply these settings before closing?"sv, "Unsaved Changes"sv, MessageBox::Type::Warning, MessageBox::InputType::YesNoCancel); | ||||||
|         switch (result) { |         switch (result) { | ||||||
|         case MessageBox::ExecResult::Yes: |         case MessageBox::ExecResult::Yes: | ||||||
|             window->apply_settings(); |             window->apply_settings(); | ||||||
|  |  | ||||||
|  | @ -96,9 +96,9 @@ void TextEditor::create_actions() | ||||||
|     m_paste_action->set_enabled(is_editable() && Clipboard::the().fetch_mime_type().starts_with("text/"sv)); |     m_paste_action->set_enabled(is_editable() && Clipboard::the().fetch_mime_type().starts_with("text/"sv)); | ||||||
|     if (is_multi_line()) { |     if (is_multi_line()) { | ||||||
|         m_go_to_line_action = Action::create( |         m_go_to_line_action = Action::create( | ||||||
|             "Go to line...", { Mod_Ctrl, Key_L }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { |             "Go to Line...", { Mod_Ctrl, Key_L }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { | ||||||
|                 String value; |                 String value; | ||||||
|                 if (InputBox::show(window(), value, "Line:"sv, "Go to line"sv) == InputBox::ExecResult::OK) { |                 if (InputBox::show(window(), value, "Line:"sv, "Go to Line"sv) == InputBox::ExecResult::OK) { | ||||||
|                     auto line_target = AK::StringUtils::convert_to_uint(value.bytes_as_string_view()); |                     auto line_target = AK::StringUtils::convert_to_uint(value.bytes_as_string_view()); | ||||||
|                     if (line_target.has_value()) { |                     if (line_target.has_value()) { | ||||||
|                         set_cursor_and_focus_line(line_target.value() - 1, 0); |                         set_cursor_and_focus_line(line_target.value() - 1, 0); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 thankyouverycool
						thankyouverycool