mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 07:07:44 +00:00
Everywhere: Use _{short_,}string to create Strings from literals
This commit is contained in:
parent
85414d9338
commit
09d40bfbb2
92 changed files with 334 additions and 310 deletions
|
@ -84,7 +84,7 @@ DownloadWidget::DownloadWidget(const URL& url)
|
|||
destination_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
destination_label.set_fixed_height(16);
|
||||
|
||||
m_close_on_finish_checkbox = add<GUI::CheckBox>(String::from_utf8("Close when finished"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_close_on_finish_checkbox = add<GUI::CheckBox>("Close when finished"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_close_on_finish_checkbox->set_checked(close_on_finish);
|
||||
|
||||
m_close_on_finish_checkbox->on_checked = [&](bool checked) {
|
||||
|
@ -94,7 +94,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>(String::from_utf8_short_string("Cancel"sv));
|
||||
m_cancel_button = button_container.add<GUI::Button>("Cancel"_short_string);
|
||||
m_cancel_button->set_fixed_size(100, 22);
|
||||
m_cancel_button->on_click = [this](auto) {
|
||||
bool success = m_download->stop();
|
||||
|
@ -102,7 +102,7 @@ DownloadWidget::DownloadWidget(const URL& url)
|
|||
window()->close();
|
||||
};
|
||||
|
||||
m_close_button = button_container.add<GUI::Button>(String::from_utf8_short_string("OK"sv));
|
||||
m_close_button = button_container.add<GUI::Button>("OK"_short_string);
|
||||
m_close_button->set_enabled(false);
|
||||
m_close_button->set_fixed_size(100, 22);
|
||||
m_close_button->on_click = [this](auto) {
|
||||
|
@ -151,7 +151,7 @@ void DownloadWidget::did_finish(bool success)
|
|||
m_browser_image->load_from_file("/res/graphics/download-finished.gif"sv);
|
||||
window()->set_title("Download finished!");
|
||||
m_close_button->set_enabled(true);
|
||||
m_cancel_button->set_text(String::from_utf8("Open in Folder"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_cancel_button->set_text("Open in Folder"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_cancel_button->on_click = [this](auto) {
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme(Core::StandardPaths::downloads_directory(), m_url.basename()));
|
||||
window()->close();
|
||||
|
|
|
@ -46,8 +46,8 @@ RoundingDialog::RoundingDialog(GUI::Window* parent_window, StringView title)
|
|||
|
||||
m_rounding_spinbox = GUI::SpinBox::construct();
|
||||
m_buttons_container = GUI::Widget::construct();
|
||||
m_ok_button = GUI::DialogButton::construct(String::from_utf8_short_string("OK"sv));
|
||||
m_cancel_button = GUI::DialogButton::construct(String::from_utf8_short_string("Cancel"sv));
|
||||
m_ok_button = GUI::DialogButton::construct("OK"_short_string);
|
||||
m_cancel_button = GUI::DialogButton::construct("Cancel"_short_string);
|
||||
|
||||
main_widget->add_child(*m_rounding_spinbox);
|
||||
main_widget->add_child(*m_buttons_container);
|
||||
|
|
|
@ -90,7 +90,7 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, Window* parent_window)
|
|||
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>(String::from_utf8_short_string("OK"sv));
|
||||
auto& ok_button = button_container.add<GUI::Button>("OK"_short_string);
|
||||
ok_button.set_fixed_size(80, 20);
|
||||
ok_button.on_click = [this](auto) {
|
||||
dbgln("TODO: Add event icon on specific tile");
|
||||
|
|
|
@ -154,17 +154,17 @@ ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename)
|
|||
|
||||
TRY(button_widget->add_spacer());
|
||||
|
||||
auto ok_button = TRY(make_button(String::from_utf8_short_string("OK"sv), button_widget));
|
||||
auto ok_button = TRY(make_button("OK"_short_string, button_widget));
|
||||
ok_button->on_click = [this](auto) {
|
||||
if (apply_changes())
|
||||
close();
|
||||
};
|
||||
auto cancel_button = TRY(make_button(String::from_utf8_short_string("Cancel"sv), button_widget));
|
||||
auto cancel_button = TRY(make_button("Cancel"_short_string, button_widget));
|
||||
cancel_button->on_click = [this](auto) {
|
||||
close();
|
||||
};
|
||||
|
||||
m_apply_button = TRY(make_button(String::from_utf8_short_string("Apply"sv), button_widget));
|
||||
m_apply_button = TRY(make_button("Apply"_short_string, button_widget));
|
||||
m_apply_button->on_click = [this](auto) { apply_changes(); };
|
||||
m_apply_button->set_enabled(false);
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ ErrorOr<void> MainWidget::initialize_fallibles(GUI::Window& window)
|
|||
TRY(go_menu->try_add_action(*m_go_home_action));
|
||||
|
||||
auto help_menu = TRY(window.try_add_menu("&Help"));
|
||||
String help_page_path = TRY(TRY(try_make_ref_counted<Manual::PageNode>(Manual::sections[1 - 1], TRY(String::from_utf8("Help"sv))))->path());
|
||||
String help_page_path = TRY(TRY(try_make_ref_counted<Manual::PageNode>(Manual::sections[1 - 1], TRY("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&) {
|
||||
open_page(help_page_path);
|
||||
|
|
|
@ -88,11 +88,11 @@ void KeyboardMapperWidget::create_frame()
|
|||
m_map_group->set_layout<GUI::HorizontalBoxLayout>();
|
||||
m_map_group->set_fixed_width(450);
|
||||
|
||||
add_map_radio_button("map"sv, String::from_utf8_short_string("Default"sv));
|
||||
add_map_radio_button("shift_map"sv, String::from_utf8_short_string("Shift"sv));
|
||||
add_map_radio_button("altgr_map"sv, String::from_utf8_short_string("AltGr"sv));
|
||||
add_map_radio_button("alt_map"sv, String::from_utf8_short_string("Alt"sv));
|
||||
add_map_radio_button("shift_altgr_map"sv, String::from_utf8("Shift+AltGr"sv).release_value_but_fixme_should_propagate_errors());
|
||||
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("shift_altgr_map"sv, "Shift+AltGr"_string.release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
bottom_widget.add_spacer().release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
|
|
@ -339,11 +339,11 @@ void PDFViewerWidget::initialize_toolbar(GUI::Toolbar& toolbar)
|
|||
toolbar.add_separator();
|
||||
|
||||
m_show_clipping_paths = toolbar.add<GUI::CheckBox>();
|
||||
m_show_clipping_paths->set_text(String::from_utf8("Show clipping paths"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_show_clipping_paths->set_text("Show clipping paths"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_show_clipping_paths->set_checked(m_viewer->show_clipping_paths(), GUI::AllowCallback::No);
|
||||
m_show_clipping_paths->on_checked = [&](auto checked) { m_viewer->set_show_clipping_paths(checked); };
|
||||
m_show_images = toolbar.add<GUI::CheckBox>();
|
||||
m_show_images->set_text(String::from_utf8("Show images"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_show_images->set_text("Show images"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_show_images->set_checked(m_viewer->show_images(), GUI::AllowCallback::No);
|
||||
m_show_images->on_checked = [&](auto checked) { m_viewer->set_show_images(checked); };
|
||||
}
|
||||
|
|
|
@ -110,12 +110,12 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window)
|
|||
};
|
||||
|
||||
auto& set_defaults_checkbox = main_widget->add<GUI::CheckBox>();
|
||||
set_defaults_checkbox.set_text(String::from_utf8("Use these settings as default"sv).release_value_but_fixme_should_propagate_errors());
|
||||
set_defaults_checkbox.set_text("Use these settings as default"_string.release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
auto& button_container = main_widget->add<GUI::Widget>();
|
||||
button_container.set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto& ok_button = button_container.add<GUI::Button>(String::from_utf8_short_string("OK"sv));
|
||||
auto& ok_button = button_container.add<GUI::Button>("OK"_short_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>(String::from_utf8_short_string("Cancel"sv));
|
||||
auto& cancel_button = button_container.add<GUI::Button>("Cancel"_short_string);
|
||||
cancel_button.on_click = [this](auto) {
|
||||
done(ExecResult::Cancel);
|
||||
};
|
||||
|
|
|
@ -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>(String::from_utf8_short_string("OK"sv));
|
||||
auto& ok_button = button_container.add<GUI::Button>("OK"_short_string);
|
||||
ok_button.on_click = [this](auto) {
|
||||
done(ExecResult::OK);
|
||||
};
|
||||
ok_button.set_default(true);
|
||||
|
||||
auto& cancel_button = button_container.add<GUI::Button>(String::from_utf8_short_string("Cancel"sv));
|
||||
auto& cancel_button = button_container.add<GUI::Button>("Cancel"_short_string);
|
||||
cancel_button.on_click = [this](auto) {
|
||||
done(ExecResult::Cancel);
|
||||
};
|
||||
|
|
|
@ -80,13 +80,13 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
auto& norm_checkbox = main_widget->template add<GUI::CheckBox>(String::from_utf8("Normalize"sv).release_value_but_fixme_should_propagate_errors());
|
||||
auto& norm_checkbox = main_widget->template add<GUI::CheckBox>("Normalize"_string.release_value_but_fixme_should_propagate_errors());
|
||||
norm_checkbox.set_checked(false);
|
||||
|
||||
auto& wrap_checkbox = main_widget->template add<GUI::CheckBox>(String::from_utf8_short_string("Wrap"sv));
|
||||
auto& wrap_checkbox = main_widget->template add<GUI::CheckBox>("Wrap"_short_string);
|
||||
wrap_checkbox.set_checked(m_should_wrap);
|
||||
|
||||
auto& button = main_widget->template add<GUI::Button>(String::from_utf8_short_string("Done"sv));
|
||||
auto& button = main_widget->template add<GUI::Button>("Done"_short_string);
|
||||
button.on_click = [&](auto) {
|
||||
m_should_wrap = wrap_checkbox.is_checked();
|
||||
if (norm_checkbox.is_checked())
|
||||
|
|
|
@ -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, String::from_utf8_short_string("px"sv)));
|
||||
auto radius_slider = TRY(radius_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
|
||||
radius_slider->set_range(0, 50);
|
||||
radius_slider->set_value(m_blur_radius);
|
||||
radius_slider->on_change = [&](int value) {
|
||||
|
|
|
@ -47,7 +47,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
name_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
name_label->set_fixed_height(10);
|
||||
|
||||
auto asymmetric_checkbox = TRY(settings_widget->try_add<GUI::CheckBox>(TRY(String::from_utf8("Use Asymmetric Radii"sv))));
|
||||
auto asymmetric_checkbox = TRY(settings_widget->try_add<GUI::CheckBox>(TRY("Use Asymmetric Radii"_string)));
|
||||
asymmetric_checkbox->set_checked(false);
|
||||
asymmetric_checkbox->set_fixed_height(15);
|
||||
asymmetric_checkbox->on_checked = [this](bool checked) {
|
||||
|
@ -68,7 +68,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
update_preview();
|
||||
};
|
||||
|
||||
m_vector_checkbox = TRY(settings_widget->try_add<GUI::CheckBox>(TRY(String::from_utf8("Use Direction and magnitude"sv))));
|
||||
m_vector_checkbox = TRY(settings_widget->try_add<GUI::CheckBox>(TRY("Use Direction and magnitude"_string)));
|
||||
m_vector_checkbox->set_checked(false);
|
||||
m_vector_checkbox->set_visible(false);
|
||||
m_vector_checkbox->set_fixed_height(15);
|
||||
|
@ -92,7 +92,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
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, String::from_utf8_short_string("px"sv)));
|
||||
auto radius_slider = TRY(m_radius_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_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, String::from_utf8_short_string("px"sv)));
|
||||
m_radius_x_slider = TRY(radius_x_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_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, String::from_utf8_short_string("px"sv)));
|
||||
m_radius_y_slider = TRY(radius_y_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_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) {
|
||||
|
@ -150,7 +150,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
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, String::from_utf8_short_string("°"sv)));
|
||||
m_angle_slider = TRY(angle_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "°"_short_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, String::from_utf8_short_string("px"sv)));
|
||||
m_magnitude_slider = TRY(magnitude_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
|
||||
m_magnitude_slider->set_range(0, 50);
|
||||
m_magnitude_slider->set_value(m_radius);
|
||||
m_magnitude_slider->on_change = [&](int value) {
|
||||
|
@ -178,7 +178,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
gaussian_container->set_fixed_height(20);
|
||||
TRY(gaussian_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
|
||||
|
||||
m_gaussian_checkbox = TRY(gaussian_container->try_add<GUI::CheckBox>(TRY(String::from_utf8("Approximate Gaussian Blur"sv))));
|
||||
m_gaussian_checkbox = TRY(gaussian_container->try_add<GUI::CheckBox>(TRY("Approximate Gaussian Blur"_string)));
|
||||
m_gaussian_checkbox->set_checked(m_approximate_gauss);
|
||||
m_gaussian_checkbox->set_tooltip("A real gaussian blur can be approximated by running the box blur multiple times with different weights.");
|
||||
m_gaussian_checkbox->on_checked = [this](bool checked) {
|
||||
|
|
|
@ -36,7 +36,7 @@ ErrorOr<RefPtr<GUI::Widget>> Sepia::get_settings_widget()
|
|||
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, String::from_utf8_short_string("%"sv)));
|
||||
auto amount_slider = TRY(amount_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
|
||||
amount_slider->set_range(0, 100);
|
||||
amount_slider->set_value(m_amount * 100);
|
||||
amount_slider->on_change = [this](int value) {
|
||||
|
|
|
@ -56,7 +56,7 @@ LayerPropertiesWidget::LayerPropertiesWidget()
|
|||
m_layer->set_opacity_percent(value);
|
||||
};
|
||||
|
||||
m_visibility_checkbox = group_box.add<GUI::CheckBox>(String::from_utf8_short_string("Visible"sv));
|
||||
m_visibility_checkbox = group_box.add<GUI::CheckBox>("Visible"_short_string);
|
||||
m_visibility_checkbox->set_fixed_height(20);
|
||||
m_visibility_checkbox->on_checked = [this](bool checked) {
|
||||
if (m_layer)
|
||||
|
|
|
@ -151,7 +151,7 @@ ErrorOr<GUI::Widget*> BrushTool::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, String::from_utf8_short_string("px"sv)));
|
||||
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_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, String::from_utf8_short_string("%"sv)));
|
||||
auto hardness_slider = TRY(hardness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
|
||||
hardness_slider->set_range(1, 100);
|
||||
hardness_slider->set_value(m_hardness);
|
||||
|
||||
|
|
|
@ -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, String::from_utf8_short_string("%"sv)));
|
||||
auto threshold_slider = TRY(threshold_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
|
||||
threshold_slider->set_range(0, 100);
|
||||
threshold_slider->set_value(m_threshold);
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ ErrorOr<GUI::Widget*> CloneTool::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, String::from_utf8_short_string("px"sv)));
|
||||
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
|
||||
size_slider->set_range(1, 100);
|
||||
size_slider->set_value(size());
|
||||
|
||||
|
@ -164,7 +164,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, String::from_utf8_short_string("%"sv)));
|
||||
auto hardness_slider = TRY(hardness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
|
||||
hardness_slider->set_range(1, 100);
|
||||
hardness_slider->on_change = [&](int value) {
|
||||
set_hardness(value);
|
||||
|
|
|
@ -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, String::from_utf8_short_string("px"sv)));
|
||||
auto thickness_slider = TRY(thickness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
|
||||
thickness_slider->set_range(1, 10);
|
||||
thickness_slider->set_value(m_thickness);
|
||||
|
||||
|
@ -157,9 +157,9 @@ ErrorOr<GUI::Widget*> EllipseTool::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 outline_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>(String::from_utf8_short_string("Outline"sv)));
|
||||
auto fill_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>(String::from_utf8_short_string("Fill"sv)));
|
||||
auto aa_enable_checkbox = TRY(mode_radio_container->try_add<GUI::CheckBox>(TRY(String::from_utf8("Anti-alias"sv))));
|
||||
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 aa_enable_checkbox = TRY(mode_radio_container->try_add<GUI::CheckBox>(TRY("Anti-alias"_string)));
|
||||
|
||||
aa_enable_checkbox->on_checked = [this](bool checked) {
|
||||
m_antialias_enabled = checked;
|
||||
|
|
|
@ -67,7 +67,7 @@ ErrorOr<GUI::Widget*> EraseTool::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, String::from_utf8_short_string("px"sv)));
|
||||
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
|
||||
size_slider->set_range(1, 100);
|
||||
size_slider->set_value(size());
|
||||
|
||||
|
@ -85,7 +85,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, String::from_utf8_short_string("%"sv)));
|
||||
auto hardness_slider = TRY(hardness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
|
||||
hardness_slider->set_range(1, 100);
|
||||
hardness_slider->set_value(hardness());
|
||||
|
||||
|
@ -100,7 +100,7 @@ ErrorOr<GUI::Widget*> EraseTool::get_properties_widget()
|
|||
|
||||
auto use_secondary_color_checkbox = TRY(secondary_color_container->try_add<GUI::CheckBox>());
|
||||
use_secondary_color_checkbox->set_checked(m_use_secondary_color);
|
||||
use_secondary_color_checkbox->set_text(TRY(String::from_utf8("Use secondary color"sv)));
|
||||
use_secondary_color_checkbox->set_text(TRY("Use secondary color"_string));
|
||||
use_secondary_color_checkbox->on_checked = [this](bool checked) {
|
||||
m_use_secondary_color = checked;
|
||||
};
|
||||
|
@ -114,8 +114,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>(String::from_utf8_short_string("Pencil"sv)));
|
||||
auto brush_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>(String::from_utf8_short_string("Brush"sv)));
|
||||
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));
|
||||
|
||||
pencil_mode_radio->on_checked = [this, hardness_slider, size_slider](bool) {
|
||||
m_draw_mode = DrawMode::Pencil;
|
||||
|
|
|
@ -206,7 +206,7 @@ ErrorOr<GUI::Widget*> GradientTool::get_properties_widget()
|
|||
|
||||
set_primary_slider(opacity_slider);
|
||||
|
||||
auto use_secondary_color_checkbox = TRY(properties_widget->try_add<GUI::CheckBox>(TRY(String::from_utf8("Use secondary color"sv))));
|
||||
auto use_secondary_color_checkbox = TRY(properties_widget->try_add<GUI::CheckBox>(TRY("Use secondary color"_string)));
|
||||
use_secondary_color_checkbox->on_checked = [this](bool checked) {
|
||||
m_use_secondary_color = checked;
|
||||
m_editor->update();
|
||||
|
@ -217,7 +217,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>(String::from_utf8_short_string("Apply"sv)));
|
||||
auto apply_button = TRY(button_container->try_add<GUI::DialogButton>("Apply"_short_string));
|
||||
apply_button->on_click = [this](auto) {
|
||||
rasterize_gradient();
|
||||
};
|
||||
|
|
|
@ -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, String::from_utf8_short_string("px"sv)));
|
||||
auto snapping_slider = TRY(snapping_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
|
||||
snapping_slider->set_range(0, 50);
|
||||
snapping_slider->set_value(m_snap_size);
|
||||
|
||||
|
|
|
@ -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, String::from_utf8_short_string("px"sv)));
|
||||
auto thickness_slider = TRY(thickness_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
|
||||
thickness_slider->set_range(1, 10);
|
||||
thickness_slider->set_value(m_thickness);
|
||||
|
||||
|
@ -150,7 +150,7 @@ ErrorOr<GUI::Widget*> LineTool::get_properties_widget()
|
|||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(80, 20);
|
||||
|
||||
auto aa_enable_checkbox = TRY(mode_container->try_add<GUI::CheckBox>(TRY(String::from_utf8("Anti-alias"sv))));
|
||||
auto aa_enable_checkbox = TRY(mode_container->try_add<GUI::CheckBox>(TRY("Anti-alias"_string)));
|
||||
aa_enable_checkbox->on_checked = [this](bool checked) {
|
||||
m_antialias_enabled = checked;
|
||||
};
|
||||
|
|
|
@ -304,9 +304,9 @@ ErrorOr<GUI::Widget*> MoveTool::get_properties_widget()
|
|||
|
||||
auto mode_radio_container = TRY(selection_mode_container->try_add<GUI::Widget>());
|
||||
(void)TRY(mode_radio_container->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
m_selection_mode_foreground = TRY(mode_radio_container->try_add<GUI::RadioButton>(TRY(String::from_utf8("Foreground"sv))));
|
||||
m_selection_mode_foreground = TRY(mode_radio_container->try_add<GUI::RadioButton>(TRY("Foreground"_string)));
|
||||
|
||||
m_selection_mode_active = TRY(mode_radio_container->try_add<GUI::RadioButton>(TRY(String::from_utf8("Active Layer"sv))));
|
||||
m_selection_mode_active = TRY(mode_radio_container->try_add<GUI::RadioButton>(TRY("Active Layer"_string)));
|
||||
|
||||
m_selection_mode_foreground->on_checked = [this](bool) {
|
||||
m_layer_selection_mode = LayerSelectionMode::ForegroundLayer;
|
||||
|
|
|
@ -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, String::from_utf8_short_string("px"sv)));
|
||||
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
|
||||
size_slider->set_range(1, 20);
|
||||
size_slider->set_value(size());
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ ErrorOr<GUI::Widget*> PickerTool::get_properties_widget()
|
|||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
|
||||
auto sample_checkbox = TRY(properties_widget->try_add<GUI::CheckBox>(TRY(String::from_utf8("Sample all layers"sv))));
|
||||
auto sample_checkbox = TRY(properties_widget->try_add<GUI::CheckBox>(TRY("Sample all layers"_string)));
|
||||
sample_checkbox->set_checked(m_sample_all_layers);
|
||||
sample_checkbox->on_checked = [this](bool value) {
|
||||
m_sample_all_layers = value;
|
||||
|
|
|
@ -166,7 +166,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, String::from_utf8_short_string("%"sv)));
|
||||
auto feather_slider = TRY(feather_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
|
||||
feather_slider->set_range(0, feather_slider_max);
|
||||
feather_slider->set_value((int)floorf(m_edge_feathering * (float)feather_slider_max));
|
||||
|
||||
|
|
|
@ -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, String::from_utf8_short_string("px"sv)));
|
||||
auto thickness_or_radius_slider = TRY(thickness_or_radius_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_string));
|
||||
|
||||
thickness_or_radius_slider->on_change = [&](int value) {
|
||||
if (m_fill_mode == FillMode::RoundedCorners) {
|
||||
|
@ -187,12 +187,12 @@ ErrorOr<GUI::Widget*> RectangleTool::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 outline_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>(String::from_utf8_short_string("Outline"sv)));
|
||||
auto fill_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>(String::from_utf8_short_string("Fill"sv)));
|
||||
auto gradient_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>(TRY(String::from_utf8("Gradient"sv))));
|
||||
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 gradient_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>(TRY("Gradient"_string)));
|
||||
mode_radio_container->set_fixed_width(70);
|
||||
|
||||
auto rounded_corners_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>(String::from_utf8_short_string("Rounded"sv)));
|
||||
auto rounded_corners_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Rounded"_short_string));
|
||||
|
||||
outline_mode_radio->on_checked = [this, update_slider](bool) {
|
||||
m_fill_mode = FillMode::Outline;
|
||||
|
@ -215,7 +215,7 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
|
|||
auto mode_extras_container = TRY(mode_container->try_add<GUI::Widget>());
|
||||
(void)TRY(mode_extras_container->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
|
||||
auto aa_enable_checkbox = TRY(mode_extras_container->try_add<GUI::CheckBox>(TRY(String::from_utf8("Anti-alias"sv))));
|
||||
auto aa_enable_checkbox = TRY(mode_extras_container->try_add<GUI::CheckBox>(TRY("Anti-alias"_string)));
|
||||
aa_enable_checkbox->on_checked = [this](bool checked) {
|
||||
m_antialias_enabled = checked;
|
||||
};
|
||||
|
|
|
@ -104,7 +104,7 @@ ErrorOr<GUI::Widget*> SprayTool::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, String::from_utf8_short_string("px"sv)));
|
||||
auto size_slider = TRY(size_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_short_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, String::from_utf8_short_string("%"sv)));
|
||||
auto density_slider = TRY(density_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
|
||||
density_slider->set_range(1, 100);
|
||||
density_slider->set_value(m_density);
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ ErrorOr<GUI::Widget*> TextTool::get_properties_widget()
|
|||
|
||||
m_font_label = TRY(properties_widget->try_add<GUI::Label>(m_selected_font->human_readable_name()));
|
||||
|
||||
auto change_font_button = TRY(properties_widget->try_add<GUI::Button>(TRY(String::from_utf8("Change Font..."sv))));
|
||||
auto change_font_button = TRY(properties_widget->try_add<GUI::Button>(TRY("Change Font..."_string)));
|
||||
change_font_button->on_click = [this](auto) {
|
||||
auto picker = GUI::FontPicker::construct(nullptr, m_selected_font, false);
|
||||
if (picker->exec() == GUI::Dialog::ExecResult::OK) {
|
||||
|
|
|
@ -81,7 +81,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, String::from_utf8_short_string("%"sv)));
|
||||
auto threshold_slider = TRY(threshold_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
|
||||
threshold_slider->set_range(0, 100);
|
||||
threshold_slider->set_value(m_threshold);
|
||||
|
||||
|
|
|
@ -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, String::from_utf8_short_string("%"sv)));
|
||||
auto sensitivity_slider = TRY(sensitivity_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "%"_short_string));
|
||||
sensitivity_slider->set_range(1, 100);
|
||||
sensitivity_slider->set_value(100 * m_sensitivity);
|
||||
|
||||
|
|
|
@ -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>(String::from_utf8_short_string("OK"sv));
|
||||
auto& ok_button = buttonbox.add<GUI::Button>("OK"_short_string);
|
||||
ok_button.set_fixed_width(80);
|
||||
ok_button.on_click = [&](auto) { done(ExecResult::OK); };
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
|
|||
};
|
||||
|
||||
{
|
||||
auto& checkbox = right_side.add<GUI::CheckBox>(String::from_utf8("Override max length"sv).release_value_but_fixme_should_propagate_errors());
|
||||
auto& checkbox = right_side.add<GUI::CheckBox>("Override max length"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& spinbox = right_side.add<GUI::SpinBox>();
|
||||
checkbox.set_checked(m_length != -1);
|
||||
spinbox.set_min(0);
|
||||
|
@ -177,7 +177,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
|
|||
};
|
||||
}
|
||||
{
|
||||
auto& checkbox = right_side.add<GUI::CheckBox>(String::from_utf8("Override display format"sv).release_value_but_fixme_should_propagate_errors());
|
||||
auto& checkbox = right_side.add<GUI::CheckBox>("Override display format"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& editor = right_side.add<GUI::TextEditor>();
|
||||
checkbox.set_checked(!m_format.is_empty());
|
||||
editor.set_name("format_editor");
|
||||
|
|
|
@ -201,8 +201,8 @@ static ErrorOr<NonnullRefPtr<GUI::Window>> create_find_window(VT::TerminalWidget
|
|||
find_forwards->click();
|
||||
};
|
||||
|
||||
auto match_case = TRY(main_widget->try_add<GUI::CheckBox>(TRY(String::from_utf8("Case sensitive"sv))));
|
||||
auto wrap_around = TRY(main_widget->try_add<GUI::CheckBox>(TRY(String::from_utf8("Wrap around"sv))));
|
||||
auto match_case = TRY(main_widget->try_add<GUI::CheckBox>(TRY("Case sensitive"_string)));
|
||||
auto wrap_around = TRY(main_widget->try_add<GUI::CheckBox>(TRY("Wrap around"_string)));
|
||||
|
||||
find_backwards->on_click = [&terminal, find_textbox, match_case, wrap_around](auto) {
|
||||
auto needle = find_textbox->text();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue