Userland: Prefer _string over _short_string

As `_string` can't fail anymore (since 3434412), there are no real
benefits to use the short variant in most cases.
This commit is contained in:
Lucas CHOLLET 2023-08-07 22:26:17 -04:00 committed by Andreas Kling
parent a5edc9cdfc
commit 3f35ffb648
Notes: sideshowbarker 2024-07-17 06:00:02 +09:00
198 changed files with 684 additions and 684 deletions

View file

@ -58,7 +58,7 @@ public:
#ifdef KERNEL
return Kernel::KString::try_create("::"sv);
#else
return "::"_short_string;
return "::"_string;
#endif
}

View file

@ -1496,7 +1496,7 @@ static LanguageMapping const* resolve_likely_subtag(LanguageID const& language_i
if (!language_id.script.has_value())
continue;
search_key.language = "und"_short_string;
search_key.language = "und"_string;
search_key.script = *language_id.script;
break;

View file

@ -1071,12 +1071,12 @@ static constexpr Array<@mapping_type@, @size@> s_@name@_mappings { {
auto optional_code_point_to_string = [](auto const& code_point) -> ErrorOr<String> {
if (!code_point.has_value())
return "-1"_short_string;
return "-1"_string;
return String::number(*code_point);
};
auto first_index_to_string = [](auto const& list) -> ErrorOr<String> {
if (list.is_empty())
return "0"_short_string;
return "0"_string;
return String::number(list.first());
};

View file

@ -65,13 +65,13 @@ enum class ValueID;
// Find the smallest possible type to use.
auto member_max_value = members.size() - 1;
if (NumericLimits<u8>::max() >= member_max_value) {
TRY(enum_generator.set("enum_type", "u8"_short_string));
TRY(enum_generator.set("enum_type", "u8"_string));
} else if (NumericLimits<u16>::max() >= member_max_value) {
TRY(enum_generator.set("enum_type", "u16"_short_string));
TRY(enum_generator.set("enum_type", "u16"_string));
} else if (NumericLimits<u32>::max() >= member_max_value) {
TRY(enum_generator.set("enum_type", "u32"_short_string));
TRY(enum_generator.set("enum_type", "u32"_string));
} else {
TRY(enum_generator.set("enum_type", "u64"_short_string));
TRY(enum_generator.set("enum_type", "u64"_string));
}
TRY(enum_generator.try_appendln("enum class @name:titlecase@ : @enum_type@ {"));

View file

@ -249,7 +249,7 @@ ErrorOr<OwnPtr<CalculationNode>> Parser::parse_math_function(PropertyID property
if (auto default_value = parameter.get_deprecated_string("default"sv); default_value.has_value()) {
TRY(parameter_generator.set("parameter_default", TRY(String::formatted(" = RoundingStrategy::{}", TRY(title_casify(default_value.value()))))));
} else {
TRY(parameter_generator.set("parameter_default", ""_short_string));
TRY(parameter_generator.set("parameter_default", ""_string));
}
} else {
// NOTE: This assumes everything not handled above is a calculation node of some kind.
@ -264,7 +264,7 @@ ErrorOr<OwnPtr<CalculationNode>> Parser::parse_math_function(PropertyID property
if (auto default_value = parameter.get_deprecated_string("default"sv); default_value.has_value()) {
TRY(parameter_generator.set("parameter_default", TRY(String::formatted(" = TRY(ConstantCalculationNode::create(CalculationNode::constant_type_from_string(\"{}\"sv).value()))", TRY(String::from_deprecated_string(default_value.value()))))));
} else {
TRY(parameter_generator.set("parameter_default", ""_short_string));
TRY(parameter_generator.set("parameter_default", ""_string));
}
}
@ -351,7 +351,7 @@ ErrorOr<OwnPtr<CalculationNode>> Parser::parse_math_function(PropertyID property
TRY(parameter_generator.set("parameter_index"sv, TRY(String::number(parameter_index))));
if (parameter_type_string == "<rounding-strategy>"sv) {
TRY(parameter_generator.set("release_value"sv, ""_short_string));
TRY(parameter_generator.set("release_value"sv, ""_string));
} else {
// NOTE: This assumes everything not handled above is a calculation node of some kind.
TRY(parameter_generator.set("release_value"sv, ".release_nonnull()"_string));

View file

@ -145,7 +145,7 @@ bool media_feature_type_is_range(MediaFeatureID media_feature_id)
VERIFY(feature.has("type"sv));
auto feature_type = feature.get_deprecated_string("type"sv);
VERIFY(feature_type.has_value());
TRY(member_generator.set("is_range", feature_type.value() == "range" ? "true"_short_string : "false"_short_string));
TRY(member_generator.set("is_range", feature_type.value() == "range" ? "true"_string : "false"_string));
TRY(member_generator.try_append(R"~~~(
case MediaFeatureID::@name:titlecase@:
return @is_range@;)~~~"));

View file

@ -227,11 +227,11 @@ TEST_CASE(take)
EXPECT(!map.take("foo"sv).has_value());
EXPECT(!map.take("bar"sv).has_value());
EXPECT(!map.take("baz"_short_string).has_value());
EXPECT(!map.take("baz"_string).has_value());
map.set("foo"_short_string, 1);
map.set("bar"_short_string, 2);
map.set("baz"_short_string, 3);
map.set("foo"_string, 1);
map.set("bar"_string, 2);
map.set("baz"_string, 3);
auto foo = map.take("foo"sv);
EXPECT_EQ(foo, 1);
@ -245,10 +245,10 @@ TEST_CASE(take)
bar = map.take("bar"sv);
EXPECT(!bar.has_value());
auto baz = map.take("baz"_short_string);
auto baz = map.take("baz"_string);
EXPECT_EQ(baz, 3);
baz = map.take("baz"_short_string);
baz = map.take("baz"_string);
EXPECT(!baz.has_value());
}

View file

@ -638,7 +638,7 @@ TEST_CASE(join)
auto string5 = MUST(String::join(',', Array { 1, 2, 3 }, "[{}]"sv));
EXPECT_EQ(string5, "[1],[2],[3]"sv);
auto string6 = MUST(String::join("!!!"_short_string, Array { "foo"sv, "bar"sv, "baz"sv }));
auto string6 = MUST(String::join("!!!"_string, Array { "foo"sv, "bar"sv, "baz"sv }));
EXPECT_EQ(string6, "foo!!!bar!!!baz"sv);
auto string7 = MUST(String::join(" - "sv, Array { 1, 16, 256, 4096 }, "[{:#04x}]"sv));
@ -763,28 +763,28 @@ TEST_CASE(contains)
EXPECT(!String {}.contains(" "sv));
EXPECT(!String {}.contains(0));
EXPECT("a"_short_string.contains("a"sv));
EXPECT(!"a"_short_string.contains({}));
EXPECT(!"a"_short_string.contains("b"sv));
EXPECT(!"a"_short_string.contains("ab"sv));
EXPECT("a"_string.contains("a"sv));
EXPECT(!"a"_string.contains({}));
EXPECT(!"a"_string.contains("b"sv));
EXPECT(!"a"_string.contains("ab"sv));
EXPECT("a"_short_string.contains(0x0061));
EXPECT(!"a"_short_string.contains(0x0062));
EXPECT("a"_string.contains(0x0061));
EXPECT(!"a"_string.contains(0x0062));
EXPECT("abc"_short_string.contains("a"sv));
EXPECT("abc"_short_string.contains("b"sv));
EXPECT("abc"_short_string.contains("c"sv));
EXPECT("abc"_short_string.contains("ab"sv));
EXPECT("abc"_short_string.contains("bc"sv));
EXPECT("abc"_short_string.contains("abc"sv));
EXPECT(!"abc"_short_string.contains({}));
EXPECT(!"abc"_short_string.contains("ac"sv));
EXPECT(!"abc"_short_string.contains("abcd"sv));
EXPECT("abc"_string.contains("a"sv));
EXPECT("abc"_string.contains("b"sv));
EXPECT("abc"_string.contains("c"sv));
EXPECT("abc"_string.contains("ab"sv));
EXPECT("abc"_string.contains("bc"sv));
EXPECT("abc"_string.contains("abc"sv));
EXPECT(!"abc"_string.contains({}));
EXPECT(!"abc"_string.contains("ac"sv));
EXPECT(!"abc"_string.contains("abcd"sv));
EXPECT("abc"_short_string.contains(0x0061));
EXPECT("abc"_short_string.contains(0x0062));
EXPECT("abc"_short_string.contains(0x0063));
EXPECT(!"abc"_short_string.contains(0x0064));
EXPECT("abc"_string.contains(0x0061));
EXPECT("abc"_string.contains(0x0062));
EXPECT("abc"_string.contains(0x0063));
EXPECT(!"abc"_string.contains(0x0064));
auto emoji = "😀"_string;
EXPECT(emoji.contains("\xF0"sv));
@ -809,24 +809,24 @@ TEST_CASE(starts_with)
EXPECT(!String {}.starts_with_bytes(" "sv));
EXPECT(!String {}.starts_with(0));
EXPECT("a"_short_string.starts_with_bytes({}));
EXPECT("a"_short_string.starts_with_bytes("a"sv));
EXPECT(!"a"_short_string.starts_with_bytes("b"sv));
EXPECT(!"a"_short_string.starts_with_bytes("ab"sv));
EXPECT("a"_string.starts_with_bytes({}));
EXPECT("a"_string.starts_with_bytes("a"sv));
EXPECT(!"a"_string.starts_with_bytes("b"sv));
EXPECT(!"a"_string.starts_with_bytes("ab"sv));
EXPECT("a"_short_string.starts_with(0x0061));
EXPECT(!"a"_short_string.starts_with(0x0062));
EXPECT("a"_string.starts_with(0x0061));
EXPECT(!"a"_string.starts_with(0x0062));
EXPECT("abc"_short_string.starts_with_bytes({}));
EXPECT("abc"_short_string.starts_with_bytes("a"sv));
EXPECT("abc"_short_string.starts_with_bytes("ab"sv));
EXPECT("abc"_short_string.starts_with_bytes("abc"sv));
EXPECT(!"abc"_short_string.starts_with_bytes("b"sv));
EXPECT(!"abc"_short_string.starts_with_bytes("bc"sv));
EXPECT("abc"_string.starts_with_bytes({}));
EXPECT("abc"_string.starts_with_bytes("a"sv));
EXPECT("abc"_string.starts_with_bytes("ab"sv));
EXPECT("abc"_string.starts_with_bytes("abc"sv));
EXPECT(!"abc"_string.starts_with_bytes("b"sv));
EXPECT(!"abc"_string.starts_with_bytes("bc"sv));
EXPECT("abc"_short_string.starts_with(0x0061));
EXPECT(!"abc"_short_string.starts_with(0x0062));
EXPECT(!"abc"_short_string.starts_with(0x0063));
EXPECT("abc"_string.starts_with(0x0061));
EXPECT(!"abc"_string.starts_with(0x0062));
EXPECT(!"abc"_string.starts_with(0x0063));
auto emoji = "😀🙃"_string;
EXPECT(emoji.starts_with_bytes("\xF0"sv));
@ -850,24 +850,24 @@ TEST_CASE(ends_with)
EXPECT(!String {}.ends_with_bytes(" "sv));
EXPECT(!String {}.ends_with(0));
EXPECT("a"_short_string.ends_with_bytes({}));
EXPECT("a"_short_string.ends_with_bytes("a"sv));
EXPECT(!"a"_short_string.ends_with_bytes("b"sv));
EXPECT(!"a"_short_string.ends_with_bytes("ba"sv));
EXPECT("a"_string.ends_with_bytes({}));
EXPECT("a"_string.ends_with_bytes("a"sv));
EXPECT(!"a"_string.ends_with_bytes("b"sv));
EXPECT(!"a"_string.ends_with_bytes("ba"sv));
EXPECT("a"_short_string.ends_with(0x0061));
EXPECT(!"a"_short_string.ends_with(0x0062));
EXPECT("a"_string.ends_with(0x0061));
EXPECT(!"a"_string.ends_with(0x0062));
EXPECT("abc"_short_string.ends_with_bytes({}));
EXPECT("abc"_short_string.ends_with_bytes("c"sv));
EXPECT("abc"_short_string.ends_with_bytes("bc"sv));
EXPECT("abc"_short_string.ends_with_bytes("abc"sv));
EXPECT(!"abc"_short_string.ends_with_bytes("b"sv));
EXPECT(!"abc"_short_string.ends_with_bytes("ab"sv));
EXPECT("abc"_string.ends_with_bytes({}));
EXPECT("abc"_string.ends_with_bytes("c"sv));
EXPECT("abc"_string.ends_with_bytes("bc"sv));
EXPECT("abc"_string.ends_with_bytes("abc"sv));
EXPECT(!"abc"_string.ends_with_bytes("b"sv));
EXPECT(!"abc"_string.ends_with_bytes("ab"sv));
EXPECT("abc"_short_string.ends_with(0x0063));
EXPECT(!"abc"_short_string.ends_with(0x0062));
EXPECT(!"abc"_short_string.ends_with(0x0061));
EXPECT("abc"_string.ends_with(0x0063));
EXPECT(!"abc"_string.ends_with(0x0062));
EXPECT(!"abc"_string.ends_with(0x0061));
auto emoji = "😀🙃"_string;
EXPECT(emoji.ends_with_bytes("\x83"sv));

View file

@ -86,7 +86,7 @@ private:
m_root_container->set_layout<GUI::VerticalBoxLayout>(4, 0);
m_root_container->set_frame_style(Gfx::FrameStyle::Window);
m_percent_box = m_root_container->add<GUI::CheckBox>("\xE2\x84\xB9"_short_string);
m_percent_box = m_root_container->add<GUI::CheckBox>("\xE2\x84\xB9"_string);
m_percent_box->set_tooltip(show_percent() ? "Hide percent" : "Show percent");
m_percent_box->set_checked(show_percent());
m_percent_box->on_checked = [&](bool show_percent) {
@ -109,7 +109,7 @@ private:
update();
};
m_mute_box = m_root_container->add<GUI::CheckBox>("\xE2\x9D\x8C"_short_string);
m_mute_box = m_root_container->add<GUI::CheckBox>("\xE2\x9D\x8C"_string);
m_mute_box->set_checked(m_audio_muted);
m_mute_box->set_tooltip(m_audio_muted ? "Unmute" : "Mute");
m_mute_box->on_checked = [&](bool is_muted) {

View file

@ -27,13 +27,13 @@ ErrorOr<String> ClipboardHistoryModel::column_name(int column) const
{
switch (column) {
case Column::Data:
return "Data"_short_string;
return "Data"_string;
case Column::Type:
return "Type"_short_string;
return "Type"_string;
case Column::Size:
return "Size"_short_string;
return "Size"_string;
case Column::Time:
return "Time"_short_string;
return "Time"_string;
default:
VERIFY_NOT_REACHED();
}

View file

@ -372,7 +372,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
time.set_x(widget->width() - time.width() - 6);
widget->set_stat_label(time);
auto& file_menu = window->add_menu("&File"_short_string);
auto& file_menu = window->add_menu("&File"_string);
file_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) {
FileSystemAccessClient::OpenFileOptions options {
@ -390,7 +390,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
app->quit();
}));
auto& view_menu = window->add_menu("&View"_short_string);
auto& view_menu = window->add_menu("&View"_string);
view_menu.add_action(GUI::CommonActions::make_fullscreen_action([&](auto&) {
window->set_fullscreen(!window->is_fullscreen());
}));
@ -456,7 +456,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
texture_enabled_action->set_checked(true);
texture_menu.add_action(texture_enabled_action);
auto& wrap_u_menu = texture_menu.add_submenu("Wrap &S"_short_string);
auto& wrap_u_menu = texture_menu.add_submenu("Wrap &S"_string);
GUI::ActionGroup wrap_s_actions;
wrap_s_actions.set_exclusive(true);
@ -480,7 +480,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
wrap_u_repeat_action->set_checked(true);
auto& wrap_t_menu = texture_menu.add_submenu("Wrap &T"_short_string);
auto& wrap_t_menu = texture_menu.add_submenu("Wrap &T"_string);
GUI::ActionGroup wrap_t_actions;
wrap_t_actions.set_exclusive(true);
@ -504,7 +504,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
wrap_t_repeat_action->set_checked(true);
auto& texture_scale_menu = texture_menu.add_submenu("S&cale"_short_string);
auto& texture_scale_menu = texture_menu.add_submenu("S&cale"_string);
GUI::ActionGroup texture_scale_actions;
texture_scale_actions.set_exclusive(true);
@ -562,7 +562,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
texture_mag_filter_nearest_action->set_checked(true);
auto& help_menu = window->add_menu("&Help"_short_string);
auto& help_menu = window->add_menu("&Help"_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu.add_action(GUI::CommonActions::make_about_action("3D File Viewer", app_icon, window));

View file

@ -165,8 +165,8 @@ BookmarksBarWidget::BookmarksBarWidget(DeprecatedString const& bookmarks_file, b
this));
Vector<GUI::JsonArrayModel::FieldSpec> fields;
fields.empend("title", "Title"_short_string, Gfx::TextAlignment::CenterLeft);
fields.empend("url", "Url"_short_string, Gfx::TextAlignment::CenterRight);
fields.empend("title", "Title"_string, Gfx::TextAlignment::CenterLeft);
fields.empend("url", "Url"_string, Gfx::TextAlignment::CenterRight);
set_model(GUI::JsonArrayModel::create(bookmarks_file, move(fields)));
model()->invalidate();
}

View file

@ -153,7 +153,7 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url, WebView::UseJavaScr
void BrowserWindow::build_menus()
{
auto& file_menu = add_menu("&File"_short_string);
auto& file_menu = add_menu("&File"_string);
file_menu.add_action(WindowActions::the().create_new_tab_action());
file_menu.add_action(WindowActions::the().create_new_window_action());
@ -168,11 +168,11 @@ void BrowserWindow::build_menus()
GUI::Application::the()->quit();
}));
auto& view_menu = add_menu("&View"_short_string);
auto& view_menu = add_menu("&View"_string);
view_menu.add_action(WindowActions::the().show_bookmarks_bar_action());
view_menu.add_action(WindowActions::the().vertical_tabs_action());
view_menu.add_separator();
m_zoom_menu = view_menu.add_submenu("&Zoom"_short_string);
m_zoom_menu = view_menu.add_submenu("&Zoom"_string);
m_zoom_menu->add_action(GUI::CommonActions::make_zoom_in_action(
[this](auto&) {
auto& tab = active_tab();
@ -219,7 +219,7 @@ void BrowserWindow::build_menus()
m_reload_action = GUI::CommonActions::make_reload_action([this](auto&) { active_tab().reload(); }, this);
m_reload_action->set_status_tip("Reload current page"_string);
auto& go_menu = add_menu("&Go"_short_string);
auto& go_menu = add_menu("&Go"_string);
go_menu.add_action(*m_go_back_action);
go_menu.add_action(*m_go_forward_action);
go_menu.add_action(*m_go_home_action);
@ -340,7 +340,7 @@ void BrowserWindow::build_menus()
});
settings_menu.add_action(move(open_settings_action));
auto& debug_menu = add_menu("&Debug"_short_string);
auto& debug_menu = add_menu("&Debug"_string);
debug_menu.add_action(GUI::Action::create(
"Dump &DOM Tree", g_icon_bag.dom_tree, [this](auto&) {
active_tab().view().debug_request("dump-dom-tree");
@ -462,7 +462,7 @@ void BrowserWindow::build_menus()
same_origin_policy_action->set_checked(false);
debug_menu.add_action(same_origin_policy_action);
auto& help_menu = add_menu("&Help"_short_string);
auto& help_menu = add_menu("&Help"_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(this));
help_menu.add_action(WindowActions::the().about_action());
}
@ -564,7 +564,7 @@ void BrowserWindow::set_window_title_for_tab(Tab const& tab)
Tab& BrowserWindow::create_new_tab(URL url, Web::HTML::ActivateTab activate)
{
auto& new_tab = m_tab_widget->add_tab<Browser::Tab>("New tab"_short_string, *this, m_use_javascript_bytecode);
auto& new_tab = m_tab_widget->add_tab<Browser::Tab>("New tab"_string, *this, m_use_javascript_bytecode);
m_tab_widget->set_bar_visible(!is_fullscreen() && m_tab_widget->children().size() > 1);

View file

@ -38,13 +38,13 @@ ErrorOr<String> CookiesModel::column_name(int column) const
{
switch (column) {
case Column::Domain:
return "Domain"_short_string;
return "Domain"_string;
case Column::Path:
return "Path"_short_string;
return "Path"_string;
case Column::Name:
return "Name"_short_string;
return "Name"_string;
case Column::Value:
return "Value"_short_string;
return "Value"_string;
case Column::ExpiryTime:
return "Expiry time"_string;
case Column::SameSite:

View file

@ -103,7 +103,7 @@ DownloadWidget::DownloadWidget(const URL& url)
auto& button_container = add<GUI::Widget>();
button_container.set_layout<GUI::HorizontalBoxLayout>();
button_container.add_spacer().release_value_but_fixme_should_propagate_errors();
m_cancel_button = button_container.add<GUI::Button>("Cancel"_short_string);
m_cancel_button = button_container.add<GUI::Button>("Cancel"_string);
m_cancel_button->set_fixed_size(100, 22);
m_cancel_button->on_click = [this](auto) {
bool success = m_download->stop();
@ -111,7 +111,7 @@ DownloadWidget::DownloadWidget(const URL& url)
window()->close();
};
m_close_button = button_container.add<GUI::Button>("OK"_short_string);
m_close_button = button_container.add<GUI::Button>("OK"_string);
m_close_button->set_enabled(false);
m_close_button->set_fixed_size(100, 22);
m_close_button->on_click = [this](auto) {

View file

@ -38,9 +38,9 @@ ErrorOr<String> HistoryModel::column_name(int column) const
{
switch (column) {
case Column::Title:
return "Title"_short_string;
return "Title"_string;
case Column::URL:
return "URL"_short_string;
return "URL"_string;
default:
VERIFY_NOT_REACHED();
}

View file

@ -84,7 +84,7 @@ InspectorWidget::InspectorWidget()
auto& top_tab_widget = splitter.add<GUI::TabWidget>();
auto& dom_tree_container = top_tab_widget.add_tab<GUI::Widget>("DOM"_short_string);
auto& dom_tree_container = top_tab_widget.add_tab<GUI::Widget>("DOM"_string);
dom_tree_container.set_layout<GUI::VerticalBoxLayout>(4);
m_dom_tree_view = dom_tree_container.add<GUI::TreeView>();
m_dom_tree_view->on_selection_change = [this] {

View file

@ -39,9 +39,9 @@ ErrorOr<String> StorageModel::column_name(int column) const
{
switch (column) {
case Column::Key:
return "Key"_short_string;
return "Key"_string;
case Column::Value:
return "Value"_short_string;
return "Value"_string;
case Column::__Count:
return String {};
}

View file

@ -97,7 +97,7 @@ ErrorOr<void> BrowserSettingsWidget::setup()
};
Vector<GUI::JsonArrayModel::FieldSpec> search_engine_fields;
search_engine_fields.empend("title", "Title"_short_string, Gfx::TextAlignment::CenterLeft);
search_engine_fields.empend("title", "Title"_string, Gfx::TextAlignment::CenterLeft);
search_engine_fields.empend("url_format", "Url format"_string, Gfx::TextAlignment::CenterLeft);
auto search_engines_model = GUI::JsonArrayModel::create(DeprecatedString::formatted("{}/SearchEngines.json", Core::StandardPaths::config_directory()), move(search_engine_fields));
search_engines_model->invalidate();

View file

@ -37,7 +37,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = TRY(GUI::SettingsWindow::create("Browser Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
window->set_icon(app_icon.bitmap_for_size(16));
(void)TRY(window->add_tab(TRY(BrowserSettingsWidget::create()), "Browser"_short_string, "browser"sv));
(void)TRY(window->add_tab(TRY(BrowserSettingsWidget::create()), "Browser"_string, "browser"sv));
(void)TRY(window->add_tab(TRY(ContentFilterSettingsWidget::create()), "Content Filtering"_string, "content-filtering"sv));
(void)TRY(window->add_tab(TRY(AutoplaySettingsWidget::create()), "Autoplay"_string, "autoplay"sv));
window->set_active_tab(selected_tab);

View file

@ -149,7 +149,7 @@ void CalculatorWidget::update_display()
{
m_entry->set_text(m_keypad.to_deprecated_string());
if (m_calculator.has_error())
m_label->set_text("E"_short_string);
m_label->set_text("E"_string);
else
m_label->set_text({});
}

View file

@ -39,12 +39,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_icon(app_icon.bitmap_for_size(16));
auto& file_menu = window->add_menu("&File"_short_string);
auto& file_menu = window->add_menu("&File"_string);
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));
auto& edit_menu = window->add_menu("&Edit"_short_string);
auto& edit_menu = window->add_menu("&Edit"_string);
edit_menu.add_action(GUI::CommonActions::make_copy_action([&](auto&) {
GUI::Clipboard::the().set_plain_text(widget->get_entry());
}));
@ -71,7 +71,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
widget->set_typed_entry(Crypto::BigFraction { Crypto::SignedBigInteger(16180339887), power });
}));
auto& round_menu = window->add_menu("&Round"_short_string);
auto& round_menu = window->add_menu("&Round"_string);
GUI::ActionGroup preview_actions;
static constexpr auto rounding_modes = Array { 0, 2, 4 };
@ -121,7 +121,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
round_menu.action_at(last_rounding_mode.value())->activate();
auto& help_menu = window->add_menu("&Help"_short_string);
auto& help_menu = window->add_menu("&Help"_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu.add_action(GUI::CommonActions::make_about_action("Calculator", app_icon, window));

View file

@ -94,7 +94,7 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, EventManager& event_man
button_container.set_fixed_height(20);
button_container.set_layout<GUI::HorizontalBoxLayout>();
button_container.add_spacer().release_value_but_fixme_should_propagate_errors();
auto& ok_button = button_container.add<GUI::Button>("OK"_short_string);
auto& ok_button = button_container.add<GUI::Button>("OK"_string);
ok_button.set_fixed_size(80, 20);
ok_button.on_click = [&](auto) {
add_event_to_calendar().release_value_but_fixme_should_propagate_errors();
@ -142,7 +142,7 @@ ErrorOr<String> AddEventDialog::MonthListModel::column_name(int column) const
{
switch (column) {
case Column::Month:
return "Month"_short_string;
return "Month"_string;
default:
VERIFY_NOT_REACHED();
}

View file

@ -82,7 +82,7 @@ ErrorOr<NonnullRefPtr<CalendarWidget>> CalendarWidget::create(GUI::Window* paren
auto save_as_action = widget->create_save_as_action();
auto save_action = widget->create_save_action(save_as_action);
auto& file_menu = parent_window->add_menu("&File"_short_string);
auto& file_menu = parent_window->add_menu("&File"_string);
file_menu.add_action(open_settings_action);
file_menu.add_action(new_calendar_action);
file_menu.add_action(open_calendar_action);
@ -95,14 +95,14 @@ ErrorOr<NonnullRefPtr<CalendarWidget>> CalendarWidget::create(GUI::Window* paren
GUI::Application::the()->quit();
})));
auto& event_menu = parent_window->add_menu("&Event"_short_string);
auto& event_menu = parent_window->add_menu("&Event"_string);
event_menu.add_action(add_event_action);
auto view_menu = TRY(parent_window->try_add_menu("&View"_short_string));
auto view_menu = TRY(parent_window->try_add_menu("&View"_string));
TRY(view_menu->try_add_action(*view_month_action));
TRY(view_menu->try_add_action(*view_year_action));
auto help_menu = TRY(parent_window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(parent_window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(parent_window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Calendar", TRY(GUI::Icon::try_create_default_icon("app-calendar"sv)), parent_window)));

View file

@ -19,7 +19,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
auto app = TRY(GUI::Application::create(args));
TRY(Core::System::unveil(TRY(String::formatted("{}/.config/certs.pem", Core::StandardPaths::home_directory())), "rwc"_short_string));
TRY(Core::System::unveil(TRY(String::formatted("{}/.config/certs.pem", Core::StandardPaths::home_directory())), "rwc"_string));
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
TRY(Core::System::unveil("/etc/cacert.pem", "r"));
TRY(Core::System::unveil("/etc/timezone", "r"));

View file

@ -159,12 +159,12 @@ CharacterMapWidget::CharacterMapWidget()
ErrorOr<void> CharacterMapWidget::initialize_menubar(GUI::Window& window)
{
auto file_menu = TRY(window.try_add_menu("&File"_short_string));
auto file_menu = TRY(window.try_add_menu("&File"_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([](GUI::Action&) {
GUI::Application::the()->quit();
})));
auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
auto help_menu = TRY(window.try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([&](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/CharacterMap.md"), "/bin/Help");

View file

@ -36,7 +36,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app_icon = GUI::Icon::default_icon("app-analog-clock"sv); // FIXME: Create a ClockSettings icon.
auto window = TRY(GUI::SettingsWindow::create("Clock Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
(void)TRY(window->add_tab<ClockSettingsWidget>("Clock"_short_string, "clock"sv));
(void)TRY(window->add_tab<ClockSettingsWidget>("Clock"_string, "clock"sv));
auto timezonesettings_widget = TRY(TimeZoneSettingsWidget::create());
TRY(window->add_tab(timezonesettings_widget, "Time Zone"_string, "time-zone"sv));

View file

@ -38,11 +38,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = TRY(GUI::SettingsWindow::create("Display Settings"));
(void)TRY(window->add_tab<DisplaySettings::BackgroundSettingsWidget>("Background"_string, "background"sv, background_settings_changed));
(void)TRY(window->add_tab<DisplaySettings::ThemesSettingsWidget>("Themes"_short_string, "themes"sv, background_settings_changed));
(void)TRY(window->add_tab<DisplaySettings::FontSettingsWidget>("Fonts"_short_string, "fonts"sv));
(void)TRY(window->add_tab<DisplaySettings::MonitorSettingsWidget>("Monitor"_short_string, "monitor"sv));
(void)TRY(window->add_tab<DisplaySettings::ThemesSettingsWidget>("Themes"_string, "themes"sv, background_settings_changed));
(void)TRY(window->add_tab<DisplaySettings::FontSettingsWidget>("Fonts"_string, "fonts"sv));
(void)TRY(window->add_tab<DisplaySettings::MonitorSettingsWidget>("Monitor"_string, "monitor"sv));
(void)TRY(window->add_tab<DisplaySettings::DesktopSettingsWidget>("Workspaces"_string, "workspaces"sv));
(void)TRY(window->add_tab<GUI::DisplaySettings::EffectsSettingsWidget>("Effects"_short_string, "effects"sv));
(void)TRY(window->add_tab<GUI::DisplaySettings::EffectsSettingsWidget>("Effects"_string, "effects"sv));
window->set_active_tab(selected_tab);
window->set_icon(app_icon.bitmap_for_size(16));

View file

@ -84,17 +84,17 @@ ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename)
TRY(button_widget->add_spacer());
auto ok_button = TRY(make_button("OK"_short_string, button_widget));
auto ok_button = TRY(make_button("OK"_string, button_widget));
ok_button->on_click = [this](auto) {
if (apply_changes())
close();
};
auto cancel_button = TRY(make_button("Cancel"_short_string, button_widget));
auto cancel_button = TRY(make_button("Cancel"_string, button_widget));
cancel_button->on_click = [this](auto) {
close();
};
m_apply_button = TRY(make_button("Apply"_short_string, button_widget));
m_apply_button = TRY(make_button("Apply"_string, button_widget));
m_apply_button->on_click = [this](auto) { apply_changes(); };
m_apply_button->set_enabled(false);
@ -120,7 +120,7 @@ ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename)
ErrorOr<void> PropertiesWindow::create_general_tab(GUI::TabWidget& tab_widget, bool disable_rename)
{
auto general_tab = TRY(tab_widget.try_add_tab<GUI::Widget>("General"_short_string));
auto general_tab = TRY(tab_widget.try_add_tab<GUI::Widget>("General"_string));
TRY(general_tab->load_from_gml(properties_window_general_tab_gml));
m_icon = general_tab->find_descendant_of_type_named<GUI::ImageWidget>("icon");
@ -260,7 +260,7 @@ ErrorOr<void> PropertiesWindow::create_archive_tab(GUI::TabWidget& tab_widget, N
auto statistics = TRY(zip.calculate_statistics());
tab->find_descendant_of_type_named<GUI::Label>("archive_format")->set_text("ZIP"_short_string);
tab->find_descendant_of_type_named<GUI::Label>("archive_format")->set_text("ZIP"_string);
tab->find_descendant_of_type_named<GUI::Label>("archive_file_count")->set_text(TRY(String::number(statistics.file_count())));
tab->find_descendant_of_type_named<GUI::Label>("archive_directory_count")->set_text(TRY(String::number(statistics.directory_count())));
tab->find_descendant_of_type_named<GUI::Label>("archive_uncompressed_size")->set_text(TRY(String::from_deprecated_string(AK::human_readable_size(statistics.total_uncompressed_bytes()))));
@ -277,7 +277,7 @@ ErrorOr<void> PropertiesWindow::create_audio_tab(GUI::TabWidget& tab_widget, Non
}
auto loader = loader_or_error.release_value();
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Audio"_short_string));
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Audio"_string));
TRY(tab->load_from_gml(properties_window_audio_tab_gml));
tab->find_descendant_of_type_named<GUI::Label>("audio_type")->set_text(TRY(String::from_deprecated_string(loader->format_name())));
@ -359,7 +359,7 @@ ErrorOr<void> PropertiesWindow::create_font_tab(GUI::TabWidget& tab_widget, Nonn
auto font_info = font_info_or_error.release_value();
auto& typeface = font_info.typeface;
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Font"_short_string));
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Font"_string));
TRY(tab->load_from_gml(properties_window_font_tab_gml));
String format_name;
@ -382,7 +382,7 @@ ErrorOr<void> PropertiesWindow::create_font_tab(GUI::TabWidget& tab_widget, Nonn
}
tab->find_descendant_of_type_named<GUI::Label>("font_format")->set_text(format_name);
tab->find_descendant_of_type_named<GUI::Label>("font_family")->set_text(TRY(String::from_deprecated_string(typeface->family())));
tab->find_descendant_of_type_named<GUI::Label>("font_fixed_width")->set_text(typeface->is_fixed_width() ? "Yes"_short_string : "No"_short_string);
tab->find_descendant_of_type_named<GUI::Label>("font_fixed_width")->set_text(typeface->is_fixed_width() ? "Yes"_string : "No"_string);
tab->find_descendant_of_type_named<GUI::Label>("font_width")->set_text(TRY(String::from_utf8(Gfx::width_to_name(static_cast<Gfx::FontWidth>(typeface->width())))));
auto nearest_weight_class_name = [](unsigned weight) {
@ -404,7 +404,7 @@ ErrorOr<void> PropertiesWindow::create_image_tab(GUI::TabWidget& tab_widget, Non
if (!image_decoder)
return {};
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Image"_short_string));
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Image"_string));
TRY(tab->load_from_gml(properties_window_image_tab_gml));
tab->find_descendant_of_type_named<GUI::Label>("image_type")->set_text(TRY(String::from_utf8(mime_type)));
@ -426,7 +426,7 @@ ErrorOr<void> PropertiesWindow::create_image_tab(GUI::TabWidget& tab_widget, Non
animation_text = TRY(builder.to_string());
} else {
animation_text = "None"_short_string;
animation_text = "None"_string;
}
tab->find_descendant_of_type_named<GUI::Label>("image_animation")->set_text(move(animation_text));
@ -450,7 +450,7 @@ ErrorOr<void> PropertiesWindow::create_image_tab(GUI::TabWidget& tab_widget, Non
}
} else {
hide_icc_group("None"_short_string);
hide_icc_group("None"_string);
}
return {};
@ -467,7 +467,7 @@ ErrorOr<void> PropertiesWindow::create_pdf_tab(GUI::TabWidget& tab_widget, Nonnu
if (auto handler = document->security_handler(); handler && !handler->has_user_password()) {
// FIXME: Show a password dialog, once we've switched to lazy-loading
auto tab = TRY(tab_widget.try_add_tab<GUI::Label>("PDF"_short_string));
auto tab = TRY(tab_widget.try_add_tab<GUI::Label>("PDF"_string));
tab->set_text("PDF is password-protected."_string);
return {};
}
@ -477,7 +477,7 @@ ErrorOr<void> PropertiesWindow::create_pdf_tab(GUI::TabWidget& tab_widget, Nonnu
return {};
}
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("PDF"_short_string));
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("PDF"_string));
TRY(tab->load_from_gml(properties_window_pdf_tab_gml));
tab->find_descendant_of_type_named<GUI::Label>("pdf_version")->set_text(TRY(String::formatted("{}.{}", document->version().major, document->version().minor)));

View file

@ -993,7 +993,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
refresh_tree_view();
});
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto file_menu = TRY(window->try_add_menu("&File"_string));
TRY(file_menu->try_add_action(mkdir_action));
TRY(file_menu->try_add_action(touch_action));
TRY(file_menu->try_add_action(focus_dependent_delete_action));
@ -1005,7 +1005,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
GUI::Application::the()->quit();
})));
auto edit_menu = TRY(window->try_add_menu("&Edit"_short_string));
auto edit_menu = TRY(window->try_add_menu("&Edit"_string));
TRY(edit_menu->try_add_action(cut_action));
TRY(edit_menu->try_add_action(copy_action));
TRY(edit_menu->try_add_action(paste_action));
@ -1028,8 +1028,8 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
show_dotfiles_action->set_checked(show_dotfiles);
show_dotfiles_in_view(show_dotfiles);
auto view_menu = TRY(window->try_add_menu("&View"_short_string));
auto layout_menu = TRY(view_menu->try_add_submenu("&Layout"_short_string));
auto view_menu = TRY(window->try_add_menu("&View"_string));
auto layout_menu = TRY(view_menu->try_add_submenu("&Layout"_string));
TRY(layout_menu->try_add_action(*layout_toolbar_action));
TRY(layout_menu->try_add_action(*layout_location_action));
TRY(layout_menu->try_add_action(*layout_statusbar_action));
@ -1049,7 +1049,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
breadcrumbbar.show_location_text_box();
});
auto go_menu = TRY(window->try_add_menu("&Go"_short_string));
auto go_menu = TRY(window->try_add_menu("&Go"_string));
TRY(go_menu->try_add_action(go_back_action));
TRY(go_menu->try_add_action(go_forward_action));
TRY(go_menu->try_add_action(open_parent_directory_action));
@ -1059,7 +1059,7 @@ ErrorOr<int> run_in_windowed_mode(DeprecatedString const& initial_location, Depr
TRY(go_menu->try_add_separator());
TRY(go_menu->try_add_action(directory_view->open_terminal_action()));
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("File Manager"sv, GUI::Icon::default_icon("app-file-manager"sv), window)));

View file

@ -733,7 +733,7 @@ ErrorOr<void> MainWidget::initialize(StringView path, RefPtr<Gfx::BitmapFont>&&
ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
{
auto file_menu = TRY(window.try_add_menu("&File"_short_string));
auto file_menu = TRY(window.try_add_menu("&File"_string));
TRY(file_menu->try_add_action(*m_new_action));
TRY(file_menu->try_add_action(*m_open_action));
TRY(file_menu->try_add_action(*m_save_action));
@ -755,7 +755,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
GUI::Application::the()->quit();
})));
auto edit_menu = TRY(window.try_add_menu("&Edit"_short_string));
auto edit_menu = TRY(window.try_add_menu("&Edit"_string));
TRY(edit_menu->try_add_action(*m_undo_action));
TRY(edit_menu->try_add_action(*m_redo_action));
TRY(edit_menu->try_add_separator());
@ -770,13 +770,13 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
m_context_menu = edit_menu;
auto go_menu = TRY(window.try_add_menu("&Go"_short_string));
auto go_menu = TRY(window.try_add_menu("&Go"_string));
TRY(go_menu->try_add_action(*m_previous_glyph_action));
TRY(go_menu->try_add_action(*m_next_glyph_action));
TRY(go_menu->try_add_action(*m_go_to_glyph_action));
auto view_menu = TRY(window.try_add_menu("&View"_short_string));
auto layout_menu = TRY(view_menu->try_add_submenu("&Layout"_short_string));
auto view_menu = TRY(window.try_add_menu("&View"_string));
auto layout_menu = TRY(view_menu->try_add_submenu("&Layout"_string));
TRY(layout_menu->try_add_action(*m_show_toolbar_action));
TRY(layout_menu->try_add_action(*m_show_statusbar_action));
TRY(layout_menu->try_add_action(*m_show_metadata_action));
@ -787,13 +787,13 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
TRY(view_menu->try_add_action(*m_highlight_modifications_action));
TRY(view_menu->try_add_action(*m_show_system_emoji_action));
TRY(view_menu->try_add_separator());
auto scale_menu = TRY(view_menu->try_add_submenu("&Scale"_short_string));
auto scale_menu = TRY(view_menu->try_add_submenu("&Scale"_string));
scale_menu->set_icon(g_resources.scale_editor);
TRY(scale_menu->try_add_action(*m_scale_five_action));
TRY(scale_menu->try_add_action(*m_scale_ten_action));
TRY(scale_menu->try_add_action(*m_scale_fifteen_action));
auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
auto help_menu = TRY(window.try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/FontEditor.md"), "/bin/Help");

View file

@ -35,8 +35,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = TRY(GUI::SettingsWindow::create("Games Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
window->set_icon(app_icon.bitmap_for_size(16));
(void)TRY(window->add_tab<GamesSettings::CardSettingsWidget>("Cards"_short_string, "cards"sv));
(void)TRY(window->add_tab<GamesSettings::ChessSettingsWidget>("Chess"_short_string, "chess"sv));
(void)TRY(window->add_tab<GamesSettings::CardSettingsWidget>("Cards"_string, "cards"sv));
(void)TRY(window->add_tab<GamesSettings::ChessSettingsWidget>("Chess"_string, "chess"sv));
window->set_active_tab(selected_tab);
window->show();

View file

@ -205,17 +205,17 @@ ErrorOr<void> MainWidget::initialize_fallibles(GUI::Window& window)
(void)TRY(m_toolbar->try_add_action(*m_go_forward_action));
(void)TRY(m_toolbar->try_add_action(*m_go_home_action));
auto file_menu = TRY(window.try_add_menu("&File"_short_string));
auto file_menu = TRY(window.try_add_menu("&File"_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
})));
auto go_menu = TRY(window.try_add_menu("&Go"_short_string));
auto go_menu = TRY(window.try_add_menu("&Go"_string));
TRY(go_menu->try_add_action(*m_go_back_action));
TRY(go_menu->try_add_action(*m_go_forward_action));
TRY(go_menu->try_add_action(*m_go_home_action));
auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
auto help_menu = TRY(window.try_add_menu("&Help"_string));
String help_page_path = TRY(TRY(try_make_ref_counted<Manual::PageNode>(Manual::sections[1 - 1], "Applications/Help"_string))->path());
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::Action::create("&Contents", { Key_F1 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-unknown.png"sv)), [this, help_page_path = move(help_page_path)](auto&) {

View file

@ -412,7 +412,7 @@ void HexEditorWidget::update_inspector_values(size_t position)
ErrorOr<void> HexEditorWidget::initialize_menubar(GUI::Window& window)
{
auto file_menu = TRY(window.try_add_menu("&File"_short_string));
auto file_menu = TRY(window.try_add_menu("&File"_string));
TRY(file_menu->try_add_action(*m_new_action));
TRY(file_menu->try_add_action(*m_open_action));
TRY(file_menu->try_add_action(*m_save_action));
@ -433,7 +433,7 @@ ErrorOr<void> HexEditorWidget::initialize_menubar(GUI::Window& window)
GUI::Application::the()->quit();
})));
auto edit_menu = TRY(window.try_add_menu("&Edit"_short_string));
auto edit_menu = TRY(window.try_add_menu("&Edit"_string));
TRY(edit_menu->try_add_action(*m_undo_action));
TRY(edit_menu->try_add_action(*m_redo_action));
TRY(edit_menu->try_add_separator());
@ -480,7 +480,7 @@ ErrorOr<void> HexEditorWidget::initialize_menubar(GUI::Window& window)
TRY(edit_menu->try_add_separator());
TRY(edit_menu->try_add_action(*m_goto_offset_action));
auto view_menu = TRY(window.try_add_menu("&View"_short_string));
auto view_menu = TRY(window.try_add_menu("&View"_string));
auto show_toolbar = Config::read_bool("HexEditor"sv, "Layout"sv, "ShowToolbar"sv, true);
m_layout_toolbar_action->set_checked(show_toolbar);
@ -541,7 +541,7 @@ ErrorOr<void> HexEditorWidget::initialize_menubar(GUI::Window& window)
little_endian_mode->set_checked(use_little_endian);
big_endian_mode->set_checked(!use_little_endian);
auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
auto help_menu = TRY(window.try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/HexEditor.md"), "/bin/Help");

View file

@ -44,9 +44,9 @@ public:
{
switch (column) {
case Column::Offset:
return "Offset"_short_string;
return "Offset"_string;
case Column::Value:
return "Value"_short_string;
return "Value"_string;
}
VERIFY_NOT_REACHED();
}

View file

@ -67,7 +67,7 @@ public:
{
switch (column) {
case Column::Type:
return "Type"_short_string;
return "Type"_string;
case Column::Value:
return m_is_little_endian ? "Value (Little Endian)"_string : "Value (Big Endian)"_string;
}

View file

@ -306,7 +306,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
(void)TRY(main_toolbar->try_add_action(reset_zoom_action));
(void)TRY(main_toolbar->try_add_action(zoom_out_action));
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto file_menu = TRY(window->try_add_menu("&File"_string));
TRY(file_menu->try_add_action(open_action));
TRY(file_menu->try_add_action(delete_action));
TRY(file_menu->try_add_separator());
@ -323,7 +323,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(file_menu->try_add_action(quit_action));
auto image_menu = TRY(window->try_add_menu("&Image"_short_string));
auto image_menu = TRY(window->try_add_menu("&Image"_string));
TRY(image_menu->try_add_action(rotate_counterclockwise_action));
TRY(image_menu->try_add_action(rotate_clockwise_action));
TRY(image_menu->try_add_action(vertical_flip_action));
@ -337,7 +337,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(navigate_menu->try_add_action(go_forward_action));
TRY(navigate_menu->try_add_action(go_last_action));
auto view_menu = TRY(window->try_add_menu("&View"_short_string));
auto view_menu = TRY(window->try_add_menu("&View"_string));
TRY(view_menu->try_add_action(full_screen_action));
TRY(view_menu->try_add_separator());
TRY(view_menu->try_add_action(zoom_in_action));
@ -364,7 +364,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(view_menu->try_add_separator());
TRY(view_menu->try_add_action(hide_show_toolbar_action));
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/ImageViewer.md"), "/bin/Help");

View file

@ -88,10 +88,10 @@ void KeyboardMapperWidget::create_frame()
m_map_group->set_layout<GUI::HorizontalBoxLayout>();
m_map_group->set_fixed_width(450);
add_map_radio_button("map"sv, "Default"_short_string);
add_map_radio_button("shift_map"sv, "Shift"_short_string);
add_map_radio_button("altgr_map"sv, "AltGr"_short_string);
add_map_radio_button("alt_map"sv, "Alt"_short_string);
add_map_radio_button("map"sv, "Default"_string);
add_map_radio_button("shift_map"sv, "Shift"_string);
add_map_radio_button("altgr_map"sv, "AltGr"_string);
add_map_radio_button("alt_map"sv, "Alt"_string);
add_map_radio_button("shift_altgr_map"sv, "Shift+AltGr"_string);
bottom_widget.add_spacer().release_value_but_fixme_should_propagate_errors();

View file

@ -83,7 +83,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto_modifier_action->set_checkable(true);
auto_modifier_action->set_checked(false);
auto& file_menu = window->add_menu("&File"_short_string);
auto& file_menu = window->add_menu("&File"_string);
file_menu.add_action(open_action);
file_menu.add_action(save_action);
file_menu.add_action(save_as_action);
@ -93,7 +93,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto& settings_menu = window->add_menu("&Settings"_string);
settings_menu.add_action(auto_modifier_action);
auto& help_menu = window->add_menu("&Help"_short_string);
auto& help_menu = window->add_menu("&Help"_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu.add_action(GUI::CommonActions::make_about_action("Keyboard Mapper", app_icon, window));

View file

@ -61,7 +61,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_icon(app_icon.bitmap_for_size(16));
auto magnifier = TRY(window->set_main_widget<MagnifierWidget>());
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto file_menu = TRY(window->try_add_menu("&File"_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_save_as_action([&](auto&) {
AK::DeprecatedString filename = "file for saving";
auto do_save = [&]() -> ErrorOr<void> {
@ -142,7 +142,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
size_action_group->add_action(eight_x_action);
size_action_group->set_exclusive(true);
auto view_menu = TRY(window->try_add_menu("&View"_short_string));
auto view_menu = TRY(window->try_add_menu("&View"_string));
TRY(view_menu->try_add_action(two_x_action));
TRY(view_menu->try_add_action(four_x_action));
TRY(view_menu->try_add_action(eight_x_action));
@ -172,7 +172,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(window->try_add_menu(TRY(GUI::CommonMenus::make_accessibility_menu(magnifier))));
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/Magnifier.md"), "/bin/Help");

View file

@ -21,9 +21,9 @@ ErrorOr<String> InboxModel::column_name(int column_index) const
{
switch (column_index) {
case Column::From:
return "From"_short_string;
return "From"_string;
case Subject:
return "Subject"_short_string;
return "Subject"_string;
default:
VERIFY_NOT_REACHED();
}

View file

@ -45,14 +45,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_title("Mail");
window->resize(640, 400);
auto& file_menu = window->add_menu("&File"_short_string);
auto& file_menu = window->add_menu("&File"_string);
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
mail_widget->on_window_close();
app->quit();
}));
auto& help_menu = window->add_menu("&Help"_short_string);
auto& help_menu = window->add_menu("&Help"_string);
help_menu.add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu.add_action(GUI::CommonActions::make_about_action("Mail", app_icon, window));

View file

@ -34,7 +34,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app_icon = GUI::Icon::default_icon("app-mail"sv);
auto window = TRY(GUI::SettingsWindow::create("Mail Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
(void)TRY(window->add_tab<MailSettingsWidget>("Mail"_short_string, "mail"sv));
(void)TRY(window->add_tab<MailSettingsWidget>("Mail"_string, "mail"sv));
window->set_icon(app_icon.bitmap_for_size(16));
window->set_active_tab(selected_tab);

View file

@ -21,7 +21,7 @@ ErrorOr<String> MouseCursorModel::column_name(int column_index) const
case Column::Bitmap:
return String {};
case Column::Name:
return "Name"_short_string;
return "Name"_string;
}
VERIFY_NOT_REACHED();
}

View file

@ -34,7 +34,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app_icon = GUI::Icon::default_icon("app-mouse"sv);
auto window = TRY(GUI::SettingsWindow::create("Mouse Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
(void)TRY(window->add_tab<MouseWidget>("Mouse"_short_string, "mouse"sv));
(void)TRY(window->add_tab<MouseWidget>("Mouse"_string, "mouse"sv));
(void)TRY(window->add_tab<ThemeWidget>("Cursor Theme"_string, "cursor-theme"sv));
(void)TRY(window->add_tab<HighlightWidget>("Cursor Highlight"_string, "cursor-highlight"sv));

View file

@ -36,7 +36,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
auto app_icon = GUI::Icon::default_icon("network"sv);
auto window = TRY(GUI::SettingsWindow::create("Network Settings", GUI::SettingsWindow::ShowDefaultsButton::No));
auto network_settings_widget = TRY(window->add_tab<NetworkSettings::NetworkSettingsWidget>("Network"_short_string, "network"sv));
auto network_settings_widget = TRY(window->add_tab<NetworkSettings::NetworkSettingsWidget>("Network"_string, "network"sv));
if (!adapter.is_null()) {
network_settings_widget->switch_adapter(adapter);
}

View file

@ -68,9 +68,9 @@ public:
{
switch (index) {
case 0:
return "Page"_short_string;
return "Page"_string;
case 1:
return "Message"_short_string;
return "Message"_string;
default:
VERIFY_NOT_REACHED();
}
@ -208,7 +208,7 @@ PDFViewerWidget::PDFViewerWidget()
ErrorOr<void> PDFViewerWidget::initialize_menubar(GUI::Window& window)
{
auto file_menu = TRY(window.try_add_menu("&File"_short_string));
auto file_menu = TRY(window.try_add_menu("&File"_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) {
FileSystemAccessClient::OpenFileOptions options {
.allowed_file_types = Vector {
@ -230,7 +230,7 @@ ErrorOr<void> PDFViewerWidget::initialize_menubar(GUI::Window& window)
GUI::Application::the()->quit();
})));
auto view_menu = TRY(window.try_add_menu("&View"_short_string));
auto view_menu = TRY(window.try_add_menu("&View"_string));
TRY(view_menu->try_add_action(*m_toggle_sidebar_action));
TRY(view_menu->try_add_separator());
auto view_mode_menu = TRY(view_menu->try_add_submenu("View &Mode"_string));
@ -241,7 +241,7 @@ ErrorOr<void> PDFViewerWidget::initialize_menubar(GUI::Window& window)
TRY(view_menu->try_add_action(*m_zoom_out_action));
TRY(view_menu->try_add_action(*m_reset_zoom_action));
auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
auto help_menu = TRY(window.try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("PDF Viewer", GUI::Icon::default_icon("app-pdf-viewer"sv), &window)));
return {};

View file

@ -17,7 +17,7 @@ SidebarWidget::SidebarWidget()
auto& tab_bar = add<GUI::TabWidget>();
auto& outline_container = tab_bar.add_tab<GUI::Widget>("Outline"_short_string);
auto& outline_container = tab_bar.add_tab<GUI::Widget>("Outline"_string);
outline_container.set_layout<GUI::VerticalBoxLayout>(4);
m_outline_tree_view = outline_container.add<GUI::TreeView>();

View file

@ -29,7 +29,7 @@ ErrorOr<String> PartitionModel::column_name(int column) const
case Column::TotalBlocks:
return "Total Blocks"_string;
case Column::Size:
return "Size"_short_string;
return "Size"_string;
default:
VERIFY_NOT_REACHED();
}

View file

@ -80,12 +80,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
partition_table_view.set_model(partition_model);
partition_table_view.set_focus(true);
auto& file_menu = window->add_menu("&File"_short_string);
auto& file_menu = window->add_menu("&File"_string);
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
app->quit();
}));
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Partition Editor", app_icon, window)));

View file

@ -48,7 +48,7 @@ ErrorOr<void> MainWidget::initialize()
m_roll_widget->set_fixed_height(300);
(void)TRY(m_tab_widget->try_add_tab<SamplerWidget>("Sampler"_short_string, m_track_manager));
(void)TRY(m_tab_widget->try_add_tab<SamplerWidget>("Sampler"_string, m_track_manager));
m_player_widget = TRY(try_add<PlayerWidget>(m_track_manager, *this, m_audio_loop));
m_keys_and_knobs_container = TRY(try_add<GUI::Widget>());
@ -61,7 +61,7 @@ ErrorOr<void> MainWidget::initialize()
m_octave_container = TRY(m_keys_and_knobs_container->try_add<GUI::Widget>());
m_octave_container->set_preferred_width(GUI::SpecialDimension::Fit);
TRY(m_octave_container->try_set_layout<GUI::VerticalBoxLayout>());
auto octave_label = TRY(m_octave_container->try_add<GUI::Label>("Octave"_short_string));
auto octave_label = TRY(m_octave_container->try_add<GUI::Label>("Octave"_string));
octave_label->set_preferred_width(GUI::SpecialDimension::Fit);
m_octave_value = TRY(m_octave_container->try_add<GUI::Label>(TRY(String::number(m_track_manager.keyboard()->virtual_keyboard_octave()))));
m_octave_value->set_preferred_width(GUI::SpecialDimension::Fit);

View file

@ -45,7 +45,7 @@ ErrorOr<void> PlayerWidget::initialize()
set_fill_with_background_color(true);
TRY(m_track_number_choices.try_append("1"));
RefPtr<GUI::Label> label = TRY(try_add<GUI::Label>("Track"_short_string));
RefPtr<GUI::Label> label = TRY(try_add<GUI::Label>("Track"_string));
label->set_max_width(75);
m_track_dropdown = TRY(try_add<GUI::ComboBox>());

View file

@ -58,7 +58,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}));
main_widget_updater->start();
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto file_menu = TRY(window->try_add_menu("&File"_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&) {
save_path = GUI::FilePicker::get_save_filepath(window, "Untitled", "wav");
if (!save_path.has_value())
@ -83,10 +83,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return;
})));
auto edit_menu = TRY(window->try_add_menu("&Edit"_short_string));
auto edit_menu = TRY(window->try_add_menu("&Edit"_string));
TRY(main_widget->add_track_actions(edit_menu));
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Piano", app_icon, window)));

View file

@ -32,7 +32,7 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window)
main_widget->set_layout<GUI::VerticalBoxLayout>(4);
auto& name_label = main_widget->add<GUI::Label>("Name:"_short_string);
auto& name_label = main_widget->add<GUI::Label>("Name:"_string);
name_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
m_name_textbox = main_widget->add<GUI::TextBox>();
@ -42,12 +42,12 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window)
auto default_name = Config::read_string("PixelPaint"sv, "NewImage"sv, "Name"sv);
m_name_textbox->set_text(default_name);
auto& width_label = main_widget->add<GUI::Label>("Width:"_short_string);
auto& width_label = main_widget->add<GUI::Label>("Width:"_string);
width_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
auto& width_spinbox = main_widget->add<GUI::SpinBox>();
auto& height_label = main_widget->add<GUI::Label>("Height:"_short_string);
auto& height_label = main_widget->add<GUI::Label>("Height:"_string);
height_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
auto& height_spinbox = main_widget->add<GUI::SpinBox>();
@ -115,7 +115,7 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window)
auto& button_container = main_widget->add<GUI::Widget>();
button_container.set_layout<GUI::HorizontalBoxLayout>();
auto& ok_button = button_container.add<GUI::Button>("OK"_short_string);
auto& ok_button = button_container.add<GUI::Button>("OK"_string);
ok_button.on_click = [&](auto) {
if (set_defaults_checkbox.is_checked()) {
Config::write_string("PixelPaint"sv, "NewImage"sv, "Name"sv, m_image_name);
@ -128,7 +128,7 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window)
};
ok_button.set_default(true);
auto& cancel_button = button_container.add<GUI::Button>("Cancel"_short_string);
auto& cancel_button = button_container.add<GUI::Button>("Cancel"_string);
cancel_button.on_click = [this](auto) {
done(ExecResult::Cancel);
};

View file

@ -24,7 +24,7 @@ CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Win
main_widget->set_fill_with_background_color(true);
main_widget->set_layout<GUI::VerticalBoxLayout>(4);
auto& name_label = main_widget->add<GUI::Label>("Name:"_short_string);
auto& name_label = main_widget->add<GUI::Label>("Name:"_string);
name_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
m_name_textbox = main_widget->add<GUI::TextBox>();
@ -34,12 +34,12 @@ CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Win
m_layer_name = m_name_textbox->text();
};
auto& width_label = main_widget->add<GUI::Label>("Width:"_short_string);
auto& width_label = main_widget->add<GUI::Label>("Width:"_string);
width_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
auto& width_spinbox = main_widget->add<GUI::SpinBox>();
auto& height_label = main_widget->add<GUI::Label>("Height:"_short_string);
auto& height_label = main_widget->add<GUI::Label>("Height:"_string);
height_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
auto& height_spinbox = main_widget->add<GUI::SpinBox>();
@ -47,13 +47,13 @@ CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Win
auto& button_container = main_widget->add<GUI::Widget>();
button_container.set_layout<GUI::HorizontalBoxLayout>();
auto& ok_button = button_container.add<GUI::Button>("OK"_short_string);
auto& ok_button = button_container.add<GUI::Button>("OK"_string);
ok_button.on_click = [this](auto) {
done(ExecResult::OK);
};
ok_button.set_default(true);
auto& cancel_button = button_container.add<GUI::Button>("Cancel"_short_string);
auto& cancel_button = button_container.add<GUI::Button>("Cancel"_string);
cancel_button.on_click = [this](auto) {
done(ExecResult::Cancel);
};

View file

@ -82,10 +82,10 @@ private:
auto& norm_checkbox = main_widget->template add<GUI::CheckBox>("Normalize"_string);
norm_checkbox.set_checked(false);
auto& wrap_checkbox = main_widget->template add<GUI::CheckBox>("Wrap"_short_string);
auto& wrap_checkbox = main_widget->template add<GUI::CheckBox>("Wrap"_string);
wrap_checkbox.set_checked(m_should_wrap);
auto& button = main_widget->template add<GUI::Button>("Done"_short_string);
auto& button = main_widget->template add<GUI::Button>("Done"_string);
button.on_click = [&](auto) {
m_should_wrap = wrap_checkbox.is_checked();
if (norm_checkbox.is_checked())

View file

@ -69,7 +69,7 @@ ErrorOr<RefPtr<GUI::Widget>> Bloom::get_settings_widget()
radius_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
radius_label->set_fixed_height(20);
auto radius_slider = TRY(radius_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
auto radius_slider = TRY(radius_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
radius_slider->set_range(0, 50);
radius_slider->set_value(m_blur_radius);
radius_slider->on_change = [&](int value) {

View file

@ -88,11 +88,11 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
m_radius_container->set_fixed_height(20);
TRY(m_radius_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
auto radius_label = TRY(m_radius_container->try_add<GUI::Label>("Radius:"_short_string));
auto radius_label = TRY(m_radius_container->try_add<GUI::Label>("Radius:"_string));
radius_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
radius_label->set_fixed_size(50, 20);
auto radius_slider = TRY(m_radius_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
auto radius_slider = TRY(m_radius_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
radius_slider->set_range(0, 25);
radius_slider->set_value(m_radius);
radius_slider->on_change = [&](int value) {
@ -113,7 +113,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
radius_x_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
radius_x_label->set_fixed_size(50, 20);
m_radius_x_slider = TRY(radius_x_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
m_radius_x_slider = TRY(radius_x_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
m_radius_x_slider->set_range(0, 50);
m_radius_x_slider->set_value(m_radius_x);
m_radius_x_slider->on_change = [&](int value) {
@ -129,7 +129,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
radius_y_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
radius_y_label->set_fixed_size(50, 20);
m_radius_y_slider = TRY(radius_y_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
m_radius_y_slider = TRY(radius_y_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
m_radius_y_slider->set_range(0, 50);
m_radius_y_slider->set_value(m_radius_y);
m_radius_y_slider->on_change = [&](int value) {
@ -146,11 +146,11 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
angle_container->set_fixed_height(20);
TRY(angle_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto angle_label = TRY(angle_container->try_add<GUI::Label>("Angle:"_short_string));
auto angle_label = TRY(angle_container->try_add<GUI::Label>("Angle:"_string));
angle_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
angle_label->set_fixed_size(60, 20);
m_angle_slider = TRY(angle_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "°"_short_string));
m_angle_slider = TRY(angle_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "°"_string));
m_angle_slider->set_range(0, 360);
m_angle_slider->set_value(m_angle);
m_angle_slider->on_change = [&](int value) {
@ -166,7 +166,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
magnitude_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
magnitude_label->set_fixed_size(60, 20);
m_magnitude_slider = TRY(magnitude_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
m_magnitude_slider = TRY(magnitude_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
m_magnitude_slider->set_range(0, 50);
m_magnitude_slider->set_value(m_radius);
m_magnitude_slider->on_change = [&](int value) {

View file

@ -32,11 +32,11 @@ ErrorOr<RefPtr<GUI::Widget>> Sepia::get_settings_widget()
amount_container->set_fixed_height(20);
TRY(amount_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
auto amount_label = TRY(amount_container->try_add<GUI::Label>("Amount:"_short_string));
auto amount_label = TRY(amount_container->try_add<GUI::Label>("Amount:"_string));
amount_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
amount_label->set_fixed_size(50, 20);
auto amount_slider = TRY(amount_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
auto amount_slider = TRY(amount_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_string));
amount_slider->set_range(0, 100);
amount_slider->set_value(m_amount * 100);
amount_slider->on_change = [this](int value) {

View file

@ -30,7 +30,7 @@ LayerPropertiesWidget::LayerPropertiesWidget()
name_container.set_fixed_height(20);
name_container.set_layout<GUI::HorizontalBoxLayout>();
auto& name_label = name_container.add<GUI::Label>("Name:"_short_string);
auto& name_label = name_container.add<GUI::Label>("Name:"_string);
name_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
name_label.set_fixed_size(80, 20);
@ -56,7 +56,7 @@ LayerPropertiesWidget::LayerPropertiesWidget()
m_layer->set_opacity_percent(value);
};
m_visibility_checkbox = group_box.add<GUI::CheckBox>("Visible"_short_string);
m_visibility_checkbox = group_box.add<GUI::CheckBox>("Visible"_string);
m_visibility_checkbox->set_fixed_height(20);
m_visibility_checkbox->on_checked = [this](bool checked) {
if (m_layer)

View file

@ -149,7 +149,7 @@ static constexpr int s_zoom_level_fit_image = 10;
ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
{
auto file_menu = TRY(window.try_add_menu("&File"_short_string));
auto file_menu = TRY(window.try_add_menu("&File"_string));
m_new_image_action = GUI::Action::create(
"&New Image...", { Mod_Ctrl, Key_N }, g_icon_bag.filetype_pixelpaint, [&](auto&) {
@ -223,7 +223,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
TRY(file_menu->try_add_action(*m_save_image_action));
TRY(file_menu->try_add_action(*m_save_image_as_action));
m_export_submenu = TRY(file_menu->try_add_submenu("&Export"_short_string));
m_export_submenu = TRY(file_menu->try_add_submenu("&Export"_string));
TRY(m_export_submenu->try_add_action(
GUI::Action::create(
@ -292,7 +292,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
GUI::Application::the()->quit();
})));
m_edit_menu = TRY(window.try_add_menu("&Edit"_short_string));
m_edit_menu = TRY(window.try_add_menu("&Edit"_string));
m_cut_action = GUI::CommonActions::make_cut_action([&](auto&) {
auto* editor = current_image_editor();
@ -488,7 +488,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
GUI::MessageBox::show_error(&window, MUST(String::formatted("Writing color palette failed: {}", result.release_error())));
})));
m_view_menu = TRY(window.try_add_menu("&View"_short_string));
m_view_menu = TRY(window.try_add_menu("&View"_string));
m_zoom_in_action = GUI::CommonActions::make_zoom_in_action(
[&](auto&) {
@ -600,18 +600,18 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
vectorscope_action->set_checked(Config::read_bool("PixelPaint"sv, "Scopes"sv, "ShowVectorscope"sv, false));
m_vectorscope_widget->parent_widget()->set_visible(vectorscope_action->is_checked());
auto scopes_menu = TRY(m_view_menu->try_add_submenu("&Scopes"_short_string));
auto scopes_menu = TRY(m_view_menu->try_add_submenu("&Scopes"_string));
TRY(scopes_menu->try_add_action(histogram_action));
TRY(scopes_menu->try_add_action(vectorscope_action));
m_tool_menu = TRY(window.try_add_menu("&Tool"_short_string));
m_tool_menu = TRY(window.try_add_menu("&Tool"_string));
m_toolbox->for_each_tool([&](auto& tool) {
if (tool.action())
m_tool_menu->add_action(*tool.action());
return IterationDecision::Continue;
});
m_image_menu = TRY(window.try_add_menu("&Image"_short_string));
m_image_menu = TRY(window.try_add_menu("&Image"_string));
TRY(m_image_menu->try_add_action(GUI::Action::create(
"Flip Image &Vertically", g_icon_bag.edit_flip_vertical, [&](auto&) {
auto* editor = current_image_editor();
@ -713,7 +713,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
editor->did_complete_action("Crop Image to Content"sv);
})));
m_layer_menu = TRY(window.try_add_menu("&Layer"_short_string));
m_layer_menu = TRY(window.try_add_menu("&Layer"_string));
m_layer_menu->on_visibility_change = [this](bool visible) {
if (!visible)
@ -810,7 +810,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
};
};
auto mask_submenu = TRY(m_layer_menu->try_add_submenu("&Masks"_short_string));
auto mask_submenu = TRY(m_layer_menu->try_add_submenu("&Masks"_string));
m_add_mask_action = GUI::Action::create(
"Add M&ask", { Mod_Ctrl | Mod_Shift, Key_M }, g_icon_bag.add_mask, create_layer_mask_callback("Add Mask", [&](Layer* active_layer) {
@ -1140,7 +1140,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
editor->did_complete_action("Crop Layer to Content"sv);
})));
m_filter_menu = TRY(window.try_add_menu("&Filter"_short_string));
m_filter_menu = TRY(window.try_add_menu("&Filter"_string));
TRY(m_filter_menu->try_add_action(GUI::Action::create("Filter &Gallery", g_icon_bag.filter, [&](auto&) {
auto* editor = current_image_editor();
@ -1164,7 +1164,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
}
})));
auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
auto help_menu = TRY(window.try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Pixel Paint", GUI::Icon::default_icon("app-pixel-paint"sv), &window)));

View file

@ -147,11 +147,11 @@ ErrorOr<GUI::Widget*> BrushTool::get_properties_widget()
size_container->set_fixed_height(20);
(void)TRY(size_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_short_string));
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_string));
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
size_label->set_fixed_size(80, 20);
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
size_slider->set_range(1, 100);
size_slider->set_value(m_size);
size_slider->set_override_cursor(cursor());
@ -171,7 +171,7 @@ ErrorOr<GUI::Widget*> BrushTool::get_properties_widget()
hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
hardness_label->set_fixed_size(80, 20);
auto hardness_slider = TRY(hardness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
auto hardness_slider = TRY(hardness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_string));
hardness_slider->set_range(1, 100);
hardness_slider->set_value(m_hardness);

View file

@ -75,7 +75,7 @@ ErrorOr<GUI::Widget*> BucketTool::get_properties_widget()
threshold_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
threshold_label->set_fixed_size(80, 20);
auto threshold_slider = TRY(threshold_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
auto threshold_slider = TRY(threshold_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_string));
threshold_slider->set_range(0, 100);
threshold_slider->set_value(m_threshold);

View file

@ -135,11 +135,11 @@ ErrorOr<GUI::Widget*> CloneTool::get_properties_widget()
size_container->set_fixed_height(20);
(void)TRY(size_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_short_string));
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_string));
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
size_label->set_fixed_size(80, 20);
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
size_slider->set_range(1, 100);
size_slider->set_value(size());
@ -158,7 +158,7 @@ ErrorOr<GUI::Widget*> CloneTool::get_properties_widget()
hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
hardness_label->set_fixed_size(80, 20);
auto hardness_slider = TRY(hardness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
auto hardness_slider = TRY(hardness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_string));
hardness_slider->set_range(1, 100);
hardness_slider->on_change = [&](int value) {
set_hardness(value);

View file

@ -140,7 +140,7 @@ ErrorOr<GUI::Widget*> EllipseTool::get_properties_widget()
thickness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
thickness_label->set_fixed_size(80, 20);
auto thickness_slider = TRY(thickness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
auto thickness_slider = TRY(thickness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
thickness_slider->set_range(1, 10);
thickness_slider->set_value(m_thickness);
@ -152,13 +152,13 @@ ErrorOr<GUI::Widget*> EllipseTool::get_properties_widget()
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
mode_container->set_fixed_height(70);
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_short_string));
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_string));
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
auto mode_radio_container = TRY(mode_container->try_add<GUI::Widget>());
(void)TRY(mode_radio_container->try_set_layout<GUI::VerticalBoxLayout>());
auto outline_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Outline"_short_string));
auto fill_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Fill"_short_string));
auto outline_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Outline"_string));
auto fill_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Fill"_string));
auto aa_enable_checkbox = TRY(mode_radio_container->try_add<GUI::CheckBox>("Anti-alias"_string));
aa_enable_checkbox->on_checked = [this](bool checked) {
@ -197,7 +197,7 @@ ErrorOr<GUI::Widget*> EllipseTool::get_properties_widget()
}
};
auto multiply_label = TRY(aspect_container->try_add<GUI::Label>("x"_short_string));
auto multiply_label = TRY(aspect_container->try_add<GUI::Label>("x"_string));
multiply_label->set_text_alignment(Gfx::TextAlignment::Center);
multiply_label->set_fixed_size(10, 20);

View file

@ -64,11 +64,11 @@ ErrorOr<GUI::Widget*> EraseTool::get_properties_widget()
size_container->set_fixed_height(20);
(void)TRY(size_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_short_string));
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_string));
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
size_label->set_fixed_size(80, 20);
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
size_slider->set_range(1, 100);
size_slider->set_value(size());
@ -86,7 +86,7 @@ ErrorOr<GUI::Widget*> EraseTool::get_properties_widget()
hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
hardness_label->set_fixed_size(80, 20);
auto hardness_slider = TRY(hardness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
auto hardness_slider = TRY(hardness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_string));
hardness_slider->set_range(1, 100);
hardness_slider->set_value(hardness());
@ -115,8 +115,8 @@ ErrorOr<GUI::Widget*> EraseTool::get_properties_widget()
auto mode_radio_container = TRY(mode_container->try_add<GUI::Widget>());
(void)TRY(mode_radio_container->try_set_layout<GUI::VerticalBoxLayout>());
auto pencil_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Pencil"_short_string));
auto brush_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Brush"_short_string));
auto pencil_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Pencil"_string));
auto brush_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Brush"_string));
pencil_mode_radio->on_checked = [this, hardness_slider, size_slider](bool) {
m_draw_mode = DrawMode::Pencil;

View file

@ -275,7 +275,7 @@ ErrorOr<GUI::Widget*> GradientTool::get_properties_widget()
hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
hardness_label->set_fixed_size(80, 20);
auto hardness_slider = TRY(hardness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
auto hardness_slider = TRY(hardness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_string));
hardness_slider->set_range(1, 99);
hardness_slider->set_value(m_hardness);
hardness_slider->on_change = [this](int value) {
@ -297,7 +297,7 @@ ErrorOr<GUI::Widget*> GradientTool::get_properties_widget()
TRY(button_container->try_set_layout<GUI::HorizontalBoxLayout>());
button_container->add_spacer().release_value_but_fixme_should_propagate_errors();
auto apply_button = TRY(button_container->try_add<GUI::DialogButton>("Apply"_short_string));
auto apply_button = TRY(button_container->try_add<GUI::DialogButton>("Apply"_string));
apply_button->on_click = [this](auto) {
rasterize_gradient();
};

View file

@ -191,7 +191,7 @@ ErrorOr<GUI::Widget*> GuideTool::get_properties_widget()
snapping_label->set_fixed_size(80, 20);
snapping_label->set_tooltip("Press Shift to snap");
auto snapping_slider = TRY(snapping_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
auto snapping_slider = TRY(snapping_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
snapping_slider->set_range(0, 50);
snapping_slider->set_value(m_snap_size);

View file

@ -168,7 +168,7 @@ ErrorOr<GUI::Widget*> LassoSelectTool::get_properties_widget()
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto mode_label = TRY(mode_container->try_add<GUI::Label>());
mode_label->set_text("Mode:"_short_string);
mode_label->set_text("Mode:"_string);
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
mode_label->set_fixed_size(80, 20);

View file

@ -133,7 +133,7 @@ ErrorOr<GUI::Widget*> LineTool::get_properties_widget()
thickness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
thickness_label->set_fixed_size(80, 20);
auto thickness_slider = TRY(thickness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
auto thickness_slider = TRY(thickness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
thickness_slider->set_range(1, 10);
thickness_slider->set_value(m_thickness);
@ -146,7 +146,7 @@ ErrorOr<GUI::Widget*> LineTool::get_properties_widget()
mode_container->set_fixed_height(20);
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_short_string));
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_string));
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
mode_label->set_fixed_size(80, 20);

View file

@ -49,7 +49,7 @@ ErrorOr<GUI::Widget*> PenTool::get_properties_widget()
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
size_label->set_fixed_size(80, 20);
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
size_slider->set_range(1, 20);
size_slider->set_value(size());

View file

@ -197,7 +197,7 @@ ErrorOr<GUI::Widget*> PolygonalSelectTool::get_properties_widget()
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto mode_label = TRY(mode_container->try_add<GUI::Label>());
mode_label->set_text("Mode:"_short_string);
mode_label->set_text("Mode:"_string);
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
mode_label->set_fixed_size(80, 20);

View file

@ -170,7 +170,7 @@ ErrorOr<GUI::Widget*> RectangleSelectTool::get_properties_widget()
feather_label->set_fixed_size(80, 20);
int const feather_slider_max = 100;
auto feather_slider = TRY(feather_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
auto feather_slider = TRY(feather_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_string));
feather_slider->set_range(0, feather_slider_max);
feather_slider->set_value((int)floorf(m_edge_feathering * (float)feather_slider_max));
@ -184,7 +184,7 @@ ErrorOr<GUI::Widget*> RectangleSelectTool::get_properties_widget()
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto mode_label = TRY(mode_container->try_add<GUI::Label>());
mode_label->set_text("Mode:"_short_string);
mode_label->set_text("Mode:"_string);
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
mode_label->set_fixed_size(80, 20);

View file

@ -154,7 +154,7 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
thickness_or_radius_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
thickness_or_radius_label->set_fixed_size(80, 20);
auto thickness_or_radius_slider = TRY(thickness_or_radius_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
auto thickness_or_radius_slider = TRY(thickness_or_radius_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
thickness_or_radius_slider->on_change = [&](int value) {
if (m_fill_mode == FillMode::RoundedCorners) {
@ -181,18 +181,18 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
mode_container->set_fixed_height(90);
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_short_string));
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_string));
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
mode_label->set_fixed_size(30, 20);
auto mode_radio_container = TRY(mode_container->try_add<GUI::Widget>());
(void)TRY(mode_radio_container->try_set_layout<GUI::VerticalBoxLayout>());
auto outline_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Outline"_short_string));
auto fill_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Fill"_short_string));
auto outline_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Outline"_string));
auto fill_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Fill"_string));
auto gradient_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Gradient"_string));
mode_radio_container->set_fixed_width(70);
auto rounded_corners_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Rounded"_short_string));
auto rounded_corners_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Rounded"_string));
outline_mode_radio->on_checked = [this, update_slider](bool) {
m_fill_mode = FillMode::Outline;
@ -246,7 +246,7 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
}
};
auto multiply_label = TRY(aspect_fields_container->try_add<GUI::Label>("x"_short_string));
auto multiply_label = TRY(aspect_fields_container->try_add<GUI::Label>("x"_string));
multiply_label->set_text_alignment(Gfx::TextAlignment::Center);
multiply_label->set_fixed_size(10, 20);

View file

@ -100,11 +100,11 @@ ErrorOr<GUI::Widget*> SprayTool::get_properties_widget()
size_container->set_fixed_height(20);
(void)TRY(size_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_short_string));
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_string));
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
size_label->set_fixed_size(80, 20);
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
size_slider->set_range(1, 20);
size_slider->set_value(m_thickness);
@ -121,7 +121,7 @@ ErrorOr<GUI::Widget*> SprayTool::get_properties_widget()
density_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
density_label->set_fixed_size(80, 20);
auto density_slider = TRY(density_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
auto density_slider = TRY(density_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_string));
density_slider->set_range(1, 100);
density_slider->set_value(m_density);

View file

@ -83,7 +83,7 @@ ErrorOr<GUI::Widget*> WandSelectTool::get_properties_widget()
threshold_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
threshold_label->set_fixed_size(80, 20);
auto threshold_slider = TRY(threshold_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
auto threshold_slider = TRY(threshold_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_string));
threshold_slider->set_range(0, 100);
threshold_slider->set_value(m_threshold);
@ -97,7 +97,7 @@ ErrorOr<GUI::Widget*> WandSelectTool::get_properties_widget()
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
auto mode_label = TRY(mode_container->try_add<GUI::Label>());
mode_label->set_text("Mode:"_short_string);
mode_label->set_text("Mode:"_string);
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
mode_label->set_fixed_size(80, 20);

View file

@ -37,7 +37,7 @@ ErrorOr<GUI::Widget*> ZoomTool::get_properties_widget()
sensitivity_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
sensitivity_label->set_fixed_size(80, 20);
auto sensitivity_slider = TRY(sensitivity_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
auto sensitivity_slider = TRY(sensitivity_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_string));
sensitivity_slider->set_range(1, 100);
sensitivity_slider->set_value(100 * m_sensitivity);

View file

@ -55,7 +55,7 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
{
auto* window = this->window();
// Set up the menu bar.
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto file_menu = TRY(window->try_add_menu("&File"_string));
auto open_action = GUI::CommonActions::make_open_action([this](auto&) {
FileSystemAccessClient::OpenFileOptions options {
.allowed_file_types = { { GUI::FileTypeFilter { "Presentation Files", { { "presenter" } } }, GUI::FileTypeFilter::all_files() } },
@ -98,7 +98,7 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
TRY(presentation_menu->try_add_action(*m_previous_slide_action));
TRY(presentation_menu->try_add_action(*m_present_from_first_slide_action));
auto view_menu = TRY(window->try_add_menu("&View"_short_string));
auto view_menu = TRY(window->try_add_menu("&View"_string));
m_full_screen_action = GUI::Action::create("Toggle &Full Screen", { KeyModifier::Mod_Shift, KeyCode::Key_F5 }, { KeyCode::Key_F11 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/fullscreen.png"sv)), [this](auto&) {
auto* window = this->window();
window->set_fullscreen(!window->is_fullscreen());
@ -117,7 +117,7 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
update_slides_actions();
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Presenter", GUI::Icon::default_icon("app-presenter"sv))));
return {};

View file

@ -92,12 +92,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_title("Settings");
window->resize(420, 265);
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto file_menu = TRY(window->try_add_menu("&File"_string));
file_menu->add_action(GUI::CommonActions::make_quit_action([&](auto&) {
app->quit();
}));
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Settings", app_icon, window)));

View file

@ -61,15 +61,15 @@ ErrorOr<String> PlaylistModel::column_name(int column) const
{
switch (column) {
case Column::Title:
return "Title"_short_string;
return "Title"_string;
case Column::Duration:
return "Duration"_string;
case Column::Group:
return "Group"_short_string;
return "Group"_string;
case Column::Album:
return "Album"_short_string;
return "Album"_string;
case Column::Artist:
return "Artist"_short_string;
return "Artist"_string;
case Column::Filesize:
return "Filesize"_string;
}

View file

@ -253,7 +253,7 @@ void SoundPlayerWidget::file_name_changed(StringView name)
DeprecatedString title = name;
if (playback_manager().loader()) {
auto const& metadata = playback_manager().loader()->metadata();
if (auto artists_or_error = metadata.all_artists(" / "_short_string);
if (auto artists_or_error = metadata.all_artists(" / "_string);
!artists_or_error.is_error() && artists_or_error.value().has_value() && metadata.title.has_value()) {
title = DeprecatedString::formatted("{} {}", metadata.title.value(), artists_or_error.release_value().release_value());
} else if (metadata.title.has_value()) {

View file

@ -60,7 +60,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
player->set_loop_mode(Player::LoopMode::Playlist);
}
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto file_menu = TRY(window->try_add_menu("&File"_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) {
Optional<DeprecatedString> path = GUI::FilePicker::get_open_filepath(window);
if (path.has_value()) {
@ -163,7 +163,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
selected_visualization_widget->set_checked(true);
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Sound Player", app_icon, window)));

View file

@ -67,7 +67,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
tree_map_widget.set_focus(true);
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto file_menu = TRY(window->try_add_menu("&File"_string));
TRY(file_menu->try_add_action(GUI::Action::create("&Analyze", { KeyCode::Key_F5 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
// FIXME: Just modify the tree in memory instead of traversing the entire file system
if (auto result = tree_map_widget.analyze(statusbar); result.is_error()) {
@ -79,7 +79,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
app->quit();
})));
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action(APP_NAME, app_icon, window)));

View file

@ -56,7 +56,7 @@ CellTypeDialog::CellTypeDialog(Vector<Position> const& positions, Sheet& sheet,
buttonbox.set_shrink_to_fit(true);
buttonbox.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 10);
buttonbox.add_spacer().release_value_but_fixme_should_propagate_errors();
auto& ok_button = buttonbox.add<GUI::Button>("OK"_short_string);
auto& ok_button = buttonbox.add<GUI::Button>("OK"_string);
ok_button.set_fixed_width(80);
ok_button.on_click = [&](auto) { done(ExecResult::OK); };
}
@ -132,7 +132,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
m_conditional_formats = cell.conditional_formats();
}
auto& type_tab = tabs.add_tab<GUI::Widget>("Type"_short_string);
auto& type_tab = tabs.add_tab<GUI::Widget>("Type"_string);
type_tab.set_layout<GUI::HorizontalBoxLayout>(4);
{
auto& left_side = type_tab.add<GUI::Widget>();
@ -264,7 +264,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
}
}
auto& colors_tab = tabs.add_tab<GUI::Widget>("Color"_short_string);
auto& colors_tab = tabs.add_tab<GUI::Widget>("Color"_string);
colors_tab.set_layout<GUI::VerticalBoxLayout>(4);
{
// Static formatting

View file

@ -123,7 +123,7 @@ HelpWindow::HelpWindow(GUI::Window* parent)
widget->add_sheet(sheet.release_nonnull());
window->show();
} else if (url.host() == "doc"_short_string) {
} else if (url.host() == "doc"_string) {
auto entry = LexicalPath::basename(url.serialize_path());
m_webview->load(URL::create_with_data("text/html"sv, render(entry)));
} else {

View file

@ -264,7 +264,7 @@ Optional<Position> Sheet::position_from_url(const URL& url) const
return {};
}
if (url.scheme() != "spreadsheet" || url.host() != "cell"_short_string) {
if (url.scheme() != "spreadsheet" || url.host() != "cell"_string) {
dbgln("Bad url: {}", url.to_deprecated_string());
return {};
}
@ -757,7 +757,7 @@ URL Position::to_url(Sheet const& sheet) const
{
URL url;
url.set_scheme("spreadsheet");
url.set_host("cell"_short_string);
url.set_host("cell"_string);
url.set_paths({ DeprecatedString::number(getpid()) });
url.set_fragment(to_cell_identifier(sheet));
return url;

View file

@ -718,7 +718,7 @@ void SpreadsheetWidget::clipboard_action(bool is_cut)
ErrorOr<void> SpreadsheetWidget::initialize_menubar(GUI::Window& window)
{
auto file_menu = TRY(window.try_add_menu("&File"_short_string));
auto file_menu = TRY(window.try_add_menu("&File"_string));
TRY(file_menu->try_add_action(*m_new_action));
TRY(file_menu->try_add_action(*m_open_action));
TRY(file_menu->try_add_action(*m_save_action));
@ -737,7 +737,7 @@ ErrorOr<void> SpreadsheetWidget::initialize_menubar(GUI::Window& window)
}));
TRY(file_menu->try_add_action(*m_quit_action));
auto edit_menu = TRY(window.try_add_menu("&Edit"_short_string));
auto edit_menu = TRY(window.try_add_menu("&Edit"_string));
TRY(edit_menu->try_add_action(*m_undo_action));
TRY(edit_menu->try_add_action(*m_redo_action));
TRY(edit_menu->try_add_separator());
@ -746,7 +746,7 @@ ErrorOr<void> SpreadsheetWidget::initialize_menubar(GUI::Window& window)
TRY(edit_menu->try_add_action(*m_paste_action));
TRY(edit_menu->try_add_action(*m_insert_emoji_action));
auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
auto help_menu = TRY(window.try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(*m_search_action));
TRY(help_menu->try_add_action(*m_functions_help_action));
TRY(help_menu->try_add_action(*m_about_action));

View file

@ -50,9 +50,9 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
else
return object.get_deprecated_string("ipv4_address"sv).value_or("").is_empty() ? *m_network_disconnected_bitmap : *m_network_connected_bitmap;
});
net_adapters_fields.empend("name", "Name"_short_string, Gfx::TextAlignment::CenterLeft);
net_adapters_fields.empend("class_name", "Class"_short_string, Gfx::TextAlignment::CenterLeft);
net_adapters_fields.empend("mac_address", "MAC"_short_string, Gfx::TextAlignment::CenterLeft);
net_adapters_fields.empend("name", "Name"_string, Gfx::TextAlignment::CenterLeft);
net_adapters_fields.empend("class_name", "Class"_string, Gfx::TextAlignment::CenterLeft);
net_adapters_fields.empend("mac_address", "MAC"_string, Gfx::TextAlignment::CenterLeft);
net_adapters_fields.empend("Link status"_string, Gfx::TextAlignment::CenterLeft,
[](JsonObject const& object) -> DeprecatedString {
if (!object.get_bool("link_up"sv).value_or(false))
@ -61,12 +61,12 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
return DeprecatedString::formatted("{} Mb/s {}-duplex", object.get_i32("link_speed"sv).value_or(0),
object.get_bool("link_full_duplex"sv).value_or(false) ? "full"sv : "half"sv);
});
net_adapters_fields.empend("IPv4"_short_string, Gfx::TextAlignment::CenterLeft,
net_adapters_fields.empend("IPv4"_string, Gfx::TextAlignment::CenterLeft,
[](JsonObject const& object) -> DeprecatedString {
return object.get_deprecated_string("ipv4_address"sv).value_or(""sv);
});
net_adapters_fields.empend("packets_in", "Pkt In"_short_string, Gfx::TextAlignment::CenterRight);
net_adapters_fields.empend("packets_out", "Pkt Out"_short_string, Gfx::TextAlignment::CenterRight);
net_adapters_fields.empend("packets_in", "Pkt In"_string, Gfx::TextAlignment::CenterRight);
net_adapters_fields.empend("packets_out", "Pkt Out"_string, Gfx::TextAlignment::CenterRight);
net_adapters_fields.empend("bytes_in", "Bytes In"_string, Gfx::TextAlignment::CenterRight);
net_adapters_fields.empend("bytes_out", "Bytes Out"_string, Gfx::TextAlignment::CenterRight);
m_adapter_model = GUI::JsonArrayModel::create("/sys/kernel/net/adapters", move(net_adapters_fields));
@ -97,15 +97,15 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
m_tcp_socket_table_view = tcp_sockets_group_box.add<GUI::TableView>();
Vector<GUI::JsonArrayModel::FieldSpec> net_tcp_fields;
net_tcp_fields.empend("peer_address", "Peer"_short_string, Gfx::TextAlignment::CenterLeft);
net_tcp_fields.empend("peer_port", "Port"_short_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("local_address", "Local"_short_string, Gfx::TextAlignment::CenterLeft);
net_tcp_fields.empend("local_port", "Port"_short_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("state", "State"_short_string, Gfx::TextAlignment::CenterLeft);
net_tcp_fields.empend("ack_number", "Ack#"_short_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("sequence_number", "Seq#"_short_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("packets_in", "Pkt In"_short_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("packets_out", "Pkt Out"_short_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("peer_address", "Peer"_string, Gfx::TextAlignment::CenterLeft);
net_tcp_fields.empend("peer_port", "Port"_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("local_address", "Local"_string, Gfx::TextAlignment::CenterLeft);
net_tcp_fields.empend("local_port", "Port"_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("state", "State"_string, Gfx::TextAlignment::CenterLeft);
net_tcp_fields.empend("ack_number", "Ack#"_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("sequence_number", "Seq#"_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("packets_in", "Pkt In"_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("packets_out", "Pkt Out"_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("bytes_in", "Bytes In"_string, Gfx::TextAlignment::CenterRight);
net_tcp_fields.empend("bytes_out", "Bytes Out"_string, Gfx::TextAlignment::CenterRight);
m_tcp_socket_model = GUI::JsonArrayModel::create("/sys/kernel/net/tcp", move(net_tcp_fields));
@ -117,10 +117,10 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
m_udp_socket_table_view = udp_sockets_group_box.add<GUI::TableView>();
Vector<GUI::JsonArrayModel::FieldSpec> net_udp_fields;
net_udp_fields.empend("peer_address", "Peer"_short_string, Gfx::TextAlignment::CenterLeft);
net_udp_fields.empend("peer_port", "Port"_short_string, Gfx::TextAlignment::CenterRight);
net_udp_fields.empend("local_address", "Local"_short_string, Gfx::TextAlignment::CenterLeft);
net_udp_fields.empend("local_port", "Port"_short_string, Gfx::TextAlignment::CenterRight);
net_udp_fields.empend("peer_address", "Peer"_string, Gfx::TextAlignment::CenterLeft);
net_udp_fields.empend("peer_port", "Port"_string, Gfx::TextAlignment::CenterRight);
net_udp_fields.empend("local_address", "Local"_string, Gfx::TextAlignment::CenterLeft);
net_udp_fields.empend("local_port", "Port"_string, Gfx::TextAlignment::CenterRight);
m_udp_socket_model = GUI::JsonArrayModel::create("/sys/kernel/net/udp", move(net_udp_fields));
m_udp_socket_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_udp_socket_model)));

View file

@ -22,17 +22,17 @@ ErrorOr<NonnullRefPtr<ProcessFileDescriptorMapWidget>> ProcessFileDescriptorMapW
widget->m_table_view = TRY(widget->try_add<GUI::TableView>());
Vector<GUI::JsonArrayModel::FieldSpec> pid_fds_fields;
TRY(pid_fds_fields.try_empend("fd", "FD"_short_string, Gfx::TextAlignment::CenterRight));
TRY(pid_fds_fields.try_empend("class", "Class"_short_string, Gfx::TextAlignment::CenterLeft));
TRY(pid_fds_fields.try_empend("offset", "Offset"_short_string, Gfx::TextAlignment::CenterRight));
TRY(pid_fds_fields.try_empend("absolute_path", "Path"_short_string, Gfx::TextAlignment::CenterLeft));
TRY(pid_fds_fields.try_empend("Access"_short_string, Gfx::TextAlignment::CenterLeft, [](auto& object) {
TRY(pid_fds_fields.try_empend("fd", "FD"_string, Gfx::TextAlignment::CenterRight));
TRY(pid_fds_fields.try_empend("class", "Class"_string, Gfx::TextAlignment::CenterLeft));
TRY(pid_fds_fields.try_empend("offset", "Offset"_string, Gfx::TextAlignment::CenterRight));
TRY(pid_fds_fields.try_empend("absolute_path", "Path"_string, Gfx::TextAlignment::CenterLeft));
TRY(pid_fds_fields.try_empend("Access"_string, Gfx::TextAlignment::CenterLeft, [](auto& object) {
return object.get_bool("seekable"sv).value_or(false) ? "Seekable" : "Sequential";
}));
TRY(pid_fds_fields.try_empend("Blocking"_string, Gfx::TextAlignment::CenterLeft, [](auto& object) {
return object.get_bool("blocking"sv).value_or(false) ? "Blocking" : "Nonblocking";
}));
TRY(pid_fds_fields.try_empend("On exec"_short_string, Gfx::TextAlignment::CenterLeft, [](auto& object) {
TRY(pid_fds_fields.try_empend("On exec"_string, Gfx::TextAlignment::CenterLeft, [](auto& object) {
return object.get_bool("cloexec"sv).value_or(false) ? "Close" : "Keep";
}));
TRY(pid_fds_fields.try_empend("Can read"_string, Gfx::TextAlignment::CenterLeft, [](auto& object) {

View file

@ -57,13 +57,13 @@ ErrorOr<NonnullRefPtr<ProcessMemoryMapWidget>> ProcessMemoryMapWidget::try_creat
Vector<GUI::JsonArrayModel::FieldSpec> pid_vm_fields;
TRY(pid_vm_fields.try_empend(
"Address"_short_string, Gfx::TextAlignment::CenterLeft,
"Address"_string, Gfx::TextAlignment::CenterLeft,
[](auto& object) { return DeprecatedString::formatted("{:p}", object.get_u64("address"sv).value_or(0)); },
[](auto& object) { return object.get_u64("address"sv).value_or(0); }));
TRY(pid_vm_fields.try_empend("size", "Size"_short_string, Gfx::TextAlignment::CenterRight));
TRY(pid_vm_fields.try_empend("size", "Size"_string, Gfx::TextAlignment::CenterRight));
TRY(pid_vm_fields.try_empend("amount_resident", "Resident"_string, Gfx::TextAlignment::CenterRight));
TRY(pid_vm_fields.try_empend("amount_dirty", "Dirty"_short_string, Gfx::TextAlignment::CenterRight));
TRY(pid_vm_fields.try_empend("Access"_short_string, Gfx::TextAlignment::CenterLeft, [](auto& object) {
TRY(pid_vm_fields.try_empend("amount_dirty", "Dirty"_string, Gfx::TextAlignment::CenterRight));
TRY(pid_vm_fields.try_empend("Access"_string, Gfx::TextAlignment::CenterLeft, [](auto& object) {
StringBuilder builder;
if (object.get_bool("readable"sv).value_or(false))
builder.append('R');
@ -102,8 +102,8 @@ ErrorOr<NonnullRefPtr<ProcessMemoryMapWidget>> ProcessMemoryMapWidget::try_creat
auto pagemap = object.get_deprecated_string("pagemap"sv).value_or({});
return pagemap;
}));
TRY(pid_vm_fields.try_empend("cow_pages", "# CoW"_short_string, Gfx::TextAlignment::CenterRight));
TRY(pid_vm_fields.try_empend("name", "Name"_short_string, Gfx::TextAlignment::CenterLeft));
TRY(pid_vm_fields.try_empend("cow_pages", "# CoW"_string, Gfx::TextAlignment::CenterRight));
TRY(pid_vm_fields.try_empend("name", "Name"_string, Gfx::TextAlignment::CenterLeft));
widget->m_json_model = GUI::JsonArrayModel::create({}, move(pid_vm_fields));
widget->m_table_view->set_model(TRY(GUI::SortingProxyModel::create(*widget->m_json_model)));

View file

@ -77,65 +77,65 @@ ErrorOr<String> ProcessModel::column_name(int column) const
case Column::Icon:
return String {};
case Column::PID:
return "PID"_short_string;
return "PID"_string;
case Column::TID:
return "TID"_short_string;
return "TID"_string;
case Column::PPID:
return "PPID"_short_string;
return "PPID"_string;
case Column::PGID:
return "PGID"_short_string;
return "PGID"_string;
case Column::SID:
return "SID"_short_string;
return "SID"_string;
case Column::State:
return "State"_short_string;
return "State"_string;
case Column::User:
return "User"_short_string;
return "User"_string;
case Column::Priority:
return "Pr"_short_string;
return "Pr"_string;
case Column::Virtual:
return "Virtual"_short_string;
return "Virtual"_string;
case Column::Physical:
return "Physical"_string;
case Column::DirtyPrivate:
return "Private"_short_string;
return "Private"_string;
case Column::CleanInode:
return "CleanI"_short_string;
return "CleanI"_string;
case Column::PurgeableVolatile:
return "Purg:V"_short_string;
return "Purg:V"_string;
case Column::PurgeableNonvolatile:
return "Purg:N"_short_string;
return "Purg:N"_string;
case Column::CPU:
return "CPU"_short_string;
return "CPU"_string;
case Column::Processor:
return "Processor"_string;
case Column::Name:
return "Name"_short_string;
return "Name"_string;
case Column::Syscalls:
return "Syscalls"_string;
case Column::InodeFaults:
return "F:Inode"_short_string;
return "F:Inode"_string;
case Column::ZeroFaults:
return "F:Zero"_short_string;
return "F:Zero"_string;
case Column::CowFaults:
return "F:CoW"_short_string;
return "F:CoW"_string;
case Column::IPv4SocketReadBytes:
return "IPv4 In"_short_string;
return "IPv4 In"_string;
case Column::IPv4SocketWriteBytes:
return "IPv4 Out"_string;
case Column::UnixSocketReadBytes:
return "Unix In"_short_string;
return "Unix In"_string;
case Column::UnixSocketWriteBytes:
return "Unix Out"_string;
case Column::FileReadBytes:
return "File In"_short_string;
return "File In"_string;
case Column::FileWriteBytes:
return "File Out"_string;
case Column::Pledge:
return "Pledge"_short_string;
return "Pledge"_string;
case Column::Veil:
return "Veil"_short_string;
return "Veil"_string;
case Column::Command:
return "Command"_short_string;
return "Command"_string;
default:
VERIFY_NOT_REACHED();
}
@ -226,7 +226,7 @@ GUI::Variant ProcessModel::data(GUI::ModelIndex const& index, GUI::ModelRole rol
case Column::Name:
return thread.current_state.name;
case Column::Command:
return thread.current_state.command.visit([](String const& cmdline) { return cmdline; }, [](auto const&) { return ""_short_string; });
return thread.current_state.command.visit([](String const& cmdline) { return cmdline; }, [](auto const&) { return ""_string; });
case Column::Syscalls:
return thread.current_state.syscall_count;
case Column::InodeFaults:
@ -296,7 +296,7 @@ GUI::Variant ProcessModel::data(GUI::ModelIndex const& index, GUI::ModelRole rol
return DeprecatedString::formatted("{} (*)", thread.current_state.name);
return thread.current_state.name;
case Column::Command:
return thread.current_state.command.visit([](String const& cmdline) { return cmdline; }, [](auto const&) { return ""_short_string; });
return thread.current_state.command.visit([](String const& cmdline) { return cmdline; }, [](auto const&) { return ""_string; });
case Column::Syscalls:
return thread.current_state.syscall_count;
case Column::InodeFaults:

View file

@ -23,7 +23,7 @@ ErrorOr<NonnullRefPtr<ProcessUnveiledPathsWidget>> ProcessUnveiledPathsWidget::t
widget->m_table_view = TRY(widget->try_add<GUI::TableView>());
Vector<GUI::JsonArrayModel::FieldSpec> pid_unveil_fields;
TRY(pid_unveil_fields.try_empend("path", "Path"_short_string, Gfx::TextAlignment::CenterLeft));
TRY(pid_unveil_fields.try_empend("path", "Path"_string, Gfx::TextAlignment::CenterLeft));
TRY(pid_unveil_fields.try_empend("permissions", "Permissions"_string, Gfx::TextAlignment::CenterLeft));
widget->m_model = GUI::JsonArrayModel::create({}, move(pid_unveil_fields));

View file

@ -34,11 +34,11 @@ public:
{
switch (column) {
case Column::Address:
return "Address"_short_string;
return "Address"_string;
case Column::Object:
return "Object"_short_string;
return "Object"_string;
case Column::Symbol:
return "Symbol"_short_string;
return "Symbol"_string;
default:
VERIFY_NOT_REACHED();
}

View file

@ -124,10 +124,10 @@ public:
Vector<GUI::JsonArrayModel::FieldSpec> df_fields;
df_fields.empend("mount_point", "Mount point"_string, Gfx::TextAlignment::CenterLeft);
df_fields.empend("class_name", "Class"_short_string, Gfx::TextAlignment::CenterLeft);
df_fields.empend("source", "Source"_short_string, Gfx::TextAlignment::CenterLeft);
df_fields.empend("class_name", "Class"_string, Gfx::TextAlignment::CenterLeft);
df_fields.empend("source", "Source"_string, Gfx::TextAlignment::CenterLeft);
df_fields.empend(
"Size"_short_string, Gfx::TextAlignment::CenterRight,
"Size"_string, Gfx::TextAlignment::CenterRight,
[](JsonObject const& object) {
StringBuilder size_builder;
size_builder.append(' ');
@ -148,7 +148,7 @@ public:
return percentage;
});
df_fields.empend(
"Used"_short_string, Gfx::TextAlignment::CenterRight,
"Used"_string, Gfx::TextAlignment::CenterRight,
[](JsonObject const& object) {
auto total_blocks = object.get_u64("total_block_count"sv).value_or(0);
auto free_blocks = object.get_u64("free_block_count"sv).value_or(0);
@ -168,7 +168,7 @@ public:
[](JsonObject const& object) {
return object.get_u64("free_block_count"sv).value_or(0) * object.get_u64("block_size"sv).value_or(0);
});
df_fields.empend("Access"_short_string, Gfx::TextAlignment::CenterLeft, [](JsonObject const& object) {
df_fields.empend("Access"_string, Gfx::TextAlignment::CenterLeft, [](JsonObject const& object) {
bool readonly = object.get_bool("readonly"sv).value_or(false);
int mount_flags = object.get_i32("mount_flags"sv).value_or(0);
return readonly || (mount_flags & MS_RDONLY) ? "Read-only" : "Read/Write";
@ -427,7 +427,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
},
&process_table_view);
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto file_menu = TRY(window->try_add_menu("&File"_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
})));
@ -466,7 +466,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(make_frequency_action(3));
TRY(make_frequency_action(5));
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("System Monitor", app_icon, window)));

View file

@ -335,7 +335,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(terminal->context_menu().try_add_separator());
TRY(terminal->context_menu().try_add_action(open_settings_action));
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto file_menu = TRY(window->try_add_menu("&File"_string));
TRY(file_menu->try_add_action(GUI::Action::create("Open New &Terminal", { Mod_Ctrl | Mod_Shift, Key_N }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"sv)), [&](auto&) {
GUI::Process::spawn_or_show_error(window, "/bin/Terminal"sv);
})));
@ -384,7 +384,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
})));
auto edit_menu = TRY(window->try_add_menu("&Edit"_short_string));
auto edit_menu = TRY(window->try_add_menu("&Edit"_string));
TRY(edit_menu->try_add_action(terminal->copy_action()));
TRY(edit_menu->try_add_action(terminal->paste_action()));
TRY(edit_menu->try_add_separator());
@ -394,7 +394,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
find_window->move_to_front();
})));
auto view_menu = TRY(window->try_add_menu("&View"_short_string));
auto view_menu = TRY(window->try_add_menu("&View"_string));
TRY(view_menu->try_add_action(GUI::CommonActions::make_fullscreen_action([&](auto&) {
window->set_fullscreen(!window->is_fullscreen());
})));
@ -418,7 +418,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
adjust_font_size(-1);
})));
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/Terminal.md"), "/bin/Help");

View file

@ -32,7 +32,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = TRY(GUI::SettingsWindow::create("Terminal Settings"));
window->set_icon(app_icon.bitmap_for_size(16));
(void)TRY(window->add_tab<TerminalSettingsViewWidget>("View"_short_string, "view"sv));
(void)TRY(window->add_tab<TerminalSettingsViewWidget>("View"_string, "view"sv));
(void)TRY(window->add_tab<TerminalSettingsMainWidget>("Terminal"_string, "terminal"sv));
window->set_active_tab(selected_tab);

View file

@ -365,7 +365,7 @@ WebView::OutOfProcessWebView& MainWidget::ensure_web_view()
ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
{
auto file_menu = TRY(window.try_add_menu("&File"_short_string));
auto file_menu = TRY(window.try_add_menu("&File"_string));
TRY(file_menu->try_add_action(*m_new_action));
TRY(file_menu->try_add_action(*m_open_action));
TRY(file_menu->try_add_action(*m_save_action));
@ -396,7 +396,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
GUI::Application::the()->quit();
})));
auto edit_menu = TRY(window.try_add_menu("&Edit"_short_string));
auto edit_menu = TRY(window.try_add_menu("&Edit"_string));
TRY(edit_menu->try_add_action(m_editor->undo_action()));
TRY(edit_menu->try_add_action(m_editor->redo_action()));
TRY(edit_menu->try_add_separator());
@ -460,8 +460,8 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
m_layout_ruler_action->set_checked(show_ruler);
m_editor->set_ruler_visible(show_ruler);
auto view_menu = TRY(window.try_add_menu("&View"_short_string));
auto layout_menu = TRY(view_menu->try_add_submenu("&Layout"_short_string));
auto view_menu = TRY(window.try_add_menu("&View"_string));
auto layout_menu = TRY(view_menu->try_add_submenu("&Layout"_string));
TRY(layout_menu->try_add_action(*m_layout_toolbar_action));
TRY(layout_menu->try_add_action(*m_layout_statusbar_action));
TRY(layout_menu->try_add_action(*m_layout_ruler_action));
@ -594,7 +594,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
syntax_actions.set_exclusive(true);
auto syntax_menu = TRY(view_menu->try_add_submenu("&Syntax"_short_string));
auto syntax_menu = TRY(view_menu->try_add_submenu("&Syntax"_string));
m_plain_text_highlight = GUI::Action::create_checkable("&Plain Text", [&](auto&) {
m_statusbar->set_text(1, "Plain Text"_string);
m_editor->set_syntax_highlighter({});
@ -689,7 +689,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
syntax_actions.add_action(*m_sql_highlight);
TRY(syntax_menu->try_add_action(*m_sql_highlight));
auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
auto help_menu = TRY(window.try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/TextEditor.md"), "/bin/Help");

View file

@ -245,7 +245,7 @@ MainWidget::MainWidget(NonnullRefPtr<AlignmentModel> alignment_model)
ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
{
auto file_menu = TRY(window.try_add_menu("&File"_short_string));
auto file_menu = TRY(window.try_add_menu("&File"_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) {
if (request_close() == GUI::Window::CloseRequestDecision::StayOpen)
return;
@ -307,7 +307,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
TRY(window.try_add_menu(TRY(GUI::CommonMenus::make_accessibility_menu(*m_preview_widget))));
auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
auto help_menu = TRY(window.try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Theme Editor", GUI::Icon::default_icon("app-theme-editor"sv), &window)));

View file

@ -382,7 +382,7 @@ void VideoPlayerWidget::set_sizing_mode(VideoSizingMode sizing_mode)
ErrorOr<void> VideoPlayerWidget::initialize_menubar(GUI::Window& window)
{
// File menu
auto file_menu = TRY(window.try_add_menu("&File"_short_string));
auto file_menu = TRY(window.try_add_menu("&File"_string));
TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) {
FileSystemAccessClient::OpenFileOptions options {
.allowed_file_types = { { GUI::FileTypeFilter { "Video Files", { { "mkv", "webm" } } }, GUI::FileTypeFilter::all_files() } },
@ -408,7 +408,7 @@ ErrorOr<void> VideoPlayerWidget::initialize_menubar(GUI::Window& window)
set_seek_mode(Video::PlaybackManager::DEFAULT_SEEK_MODE);
// View menu
auto view_menu = TRY(window.try_add_menu("&View"_short_string));
auto view_menu = TRY(window.try_add_menu("&View"_string));
TRY(view_menu->try_add_action(*m_toggle_fullscreen_action));
auto sizing_mode_menu = TRY(view_menu->try_add_submenu("&Sizing Mode"_string));
@ -427,7 +427,7 @@ ErrorOr<void> VideoPlayerWidget::initialize_menubar(GUI::Window& window)
TRY(sizing_mode_menu->try_add_action(*m_size_fullsize_action));
// Help menu
auto help_menu = TRY(window.try_add_menu("&Help"_short_string));
auto help_menu = TRY(window.try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Video Player", TRY(GUI::Icon::try_create_default_icon("app-video-player"sv)), &window)));
return {};

View file

@ -84,12 +84,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
set_window_frame_enabled(!hide_window_frame);
show_window_frame_action->set_checked(window_frame_enabled);
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
auto file_menu = TRY(window->try_add_menu("&File"_string));
TRY(file_menu->try_add_action(move(show_window_frame_action)));
TRY(file_menu->try_add_separator());
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
auto help_menu = TRY(window->try_add_menu("&Help"_string));
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/Eyes.md"), "/bin/Help");

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