mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:27:35 +00:00
LibGUI+Userland: Port Labels to String
This commit is contained in:
parent
3d53dc8228
commit
91bafc2653
92 changed files with 240 additions and 242 deletions
|
@ -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:");
|
||||
auto& name_label = main_widget->add<GUI::Label>("Name:"_short_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:");
|
||||
auto& width_label = main_widget->add<GUI::Label>("Width:"_short_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:");
|
||||
auto& height_label = main_widget->add<GUI::Label>("Height:"_short_string);
|
||||
height_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
auto& height_spinbox = main_widget->add<GUI::SpinBox>();
|
||||
|
@ -80,7 +80,7 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window)
|
|||
return BackgroundIndex::Custom;
|
||||
}();
|
||||
|
||||
auto& background_label = main_widget->add<GUI::Label>("Background:");
|
||||
auto& background_label = main_widget->add<GUI::Label>("Background:"_string.release_value_but_fixme_should_propagate_errors());
|
||||
background_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
auto& background_color_combo = main_widget->add<GUI::ComboBox>();
|
||||
auto& background_color_input = main_widget->add<GUI::ColorInput>();
|
||||
|
|
|
@ -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:");
|
||||
auto& name_label = main_widget->add<GUI::Label>("Name:"_short_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:");
|
||||
auto& width_label = main_widget->add<GUI::Label>("Width:"_short_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:");
|
||||
auto& height_label = main_widget->add<GUI::Label>("Height:"_short_string);
|
||||
height_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
auto& height_spinbox = main_widget->add<GUI::SpinBox>();
|
||||
|
|
|
@ -64,7 +64,7 @@ FilterGallery::FilterGallery(GUI::Window* parent_window, ImageEditor* editor)
|
|||
|
||||
auto settings_widget_or_error = m_selected_filter->get_settings_widget();
|
||||
if (settings_widget_or_error.is_error()) {
|
||||
m_error_label->set_text(DeprecatedString::formatted("Error creating settings: {}", settings_widget_or_error.error()));
|
||||
m_error_label->set_text(String::formatted("Error creating settings: {}", settings_widget_or_error.error()).release_value_but_fixme_should_propagate_errors());
|
||||
m_selected_filter_config_widget = m_error_label;
|
||||
} else {
|
||||
m_selected_filter_config_widget = settings_widget_or_error.release_value();
|
||||
|
|
|
@ -40,7 +40,7 @@ ErrorOr<RefPtr<GUI::Widget>> Bloom::get_settings_widget()
|
|||
auto settings_widget = TRY(GUI::Widget::try_create());
|
||||
TRY(settings_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>("Bloom Filter"));
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>(TRY("Bloom Filter"_string)));
|
||||
name_label->set_font_weight(Gfx::FontWeight::Bold);
|
||||
name_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
name_label->set_fixed_height(20);
|
||||
|
@ -49,7 +49,7 @@ ErrorOr<RefPtr<GUI::Widget>> Bloom::get_settings_widget()
|
|||
luma_lower_container->set_fixed_height(50);
|
||||
TRY(luma_lower_container->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
|
||||
|
||||
auto luma_lower_label = TRY(luma_lower_container->try_add<GUI::Label>("Luma lower bound:"));
|
||||
auto luma_lower_label = TRY(luma_lower_container->try_add<GUI::Label>(TRY("Luma lower bound:"_string)));
|
||||
luma_lower_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
luma_lower_label->set_fixed_height(20);
|
||||
|
||||
|
@ -65,7 +65,7 @@ ErrorOr<RefPtr<GUI::Widget>> Bloom::get_settings_widget()
|
|||
radius_container->set_fixed_height(50);
|
||||
TRY(radius_container->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
|
||||
|
||||
auto radius_label = TRY(radius_container->try_add<GUI::Label>("Blur Radius:"));
|
||||
auto radius_label = TRY(radius_container->try_add<GUI::Label>(TRY("Blur Radius:"_string)));
|
||||
radius_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
radius_label->set_fixed_height(20);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
auto settings_widget = TRY(GUI::Widget::try_create());
|
||||
TRY(settings_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>("Fast Box Blur Filter"));
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>(TRY("Fast Box Blur Filter"_string)));
|
||||
name_label->set_font_weight(Gfx::FontWeight::Bold);
|
||||
name_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
name_label->set_fixed_height(10);
|
||||
|
@ -88,7 +88,7 @@ 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:"));
|
||||
auto radius_label = TRY(m_radius_container->try_add<GUI::Label>("Radius:"_short_string));
|
||||
radius_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
radius_label->set_fixed_size(50, 20);
|
||||
|
||||
|
@ -109,7 +109,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
radius_x_container->set_fixed_height(20);
|
||||
radius_x_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto radius_x_label = TRY(radius_x_container->try_add<GUI::Label>("Radius X:"));
|
||||
auto radius_x_label = TRY(radius_x_container->try_add<GUI::Label>(TRY("Radius X:"_string)));
|
||||
radius_x_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
radius_x_label->set_fixed_size(50, 20);
|
||||
|
||||
|
@ -125,7 +125,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
radius_y_container->set_fixed_height(20);
|
||||
TRY(radius_y_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto radius_y_label = TRY(radius_y_container->try_add<GUI::Label>("Radius Y:"));
|
||||
auto radius_y_label = TRY(radius_y_container->try_add<GUI::Label>(TRY("Radius Y:"_string)));
|
||||
radius_y_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
radius_y_label->set_fixed_size(50, 20);
|
||||
|
||||
|
@ -146,7 +146,7 @@ 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:"));
|
||||
auto angle_label = TRY(angle_container->try_add<GUI::Label>("Angle:"_short_string));
|
||||
angle_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
angle_label->set_fixed_size(60, 20);
|
||||
|
||||
|
@ -162,7 +162,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
magnitude_container->set_fixed_height(20);
|
||||
TRY(magnitude_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto magnitude_label = TRY(magnitude_container->try_add<GUI::Label>("Magnitude:"));
|
||||
auto magnitude_label = TRY(magnitude_container->try_add<GUI::Label>(TRY("Magnitude:"_string)));
|
||||
magnitude_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
magnitude_label->set_fixed_size(60, 20);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ ErrorOr<RefPtr<GUI::Widget>> Filter::get_settings_widget()
|
|||
auto settings_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(settings_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>(filter_name()));
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>(TRY(String::from_utf8(filter_name()))));
|
||||
name_label->set_text_alignment(Gfx::TextAlignment::TopLeft);
|
||||
|
||||
(void)TRY(settings_widget->try_add<GUI::Widget>());
|
||||
|
|
|
@ -34,7 +34,7 @@ ErrorOr<RefPtr<GUI::Widget>> HueAndSaturation::get_settings_widget()
|
|||
(void)TRY(settings_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
|
||||
auto add_slider = [&](auto name, int min, int max, auto member) -> ErrorOr<void> {
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>(name));
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>(TRY(String::from_utf8(name))));
|
||||
name_label->set_font_weight(Gfx::FontWeight::Bold);
|
||||
name_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
name_label->set_fixed_height(20);
|
||||
|
@ -49,9 +49,9 @@ ErrorOr<RefPtr<GUI::Widget>> HueAndSaturation::get_settings_widget()
|
|||
return {};
|
||||
};
|
||||
|
||||
TRY(add_slider("Hue", -180, 180, &HueAndSaturation::m_hue));
|
||||
TRY(add_slider("Saturation", -100, 100, &HueAndSaturation::m_saturation));
|
||||
TRY(add_slider("Lightness", -100, 100, &HueAndSaturation::m_lightness));
|
||||
TRY(add_slider("Hue"sv, -180, 180, &HueAndSaturation::m_hue));
|
||||
TRY(add_slider("Saturation"sv, -100, 100, &HueAndSaturation::m_saturation));
|
||||
TRY(add_slider("Lightness"sv, -100, 100, &HueAndSaturation::m_lightness));
|
||||
m_settings_widget = settings_widget;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ ErrorOr<RefPtr<GUI::Widget>> Sepia::get_settings_widget()
|
|||
auto settings_widget = TRY(GUI::Widget::try_create());
|
||||
TRY(settings_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>("Sepia Filter"));
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>(TRY("Sepia Filter"_string)));
|
||||
name_label->set_font_weight(Gfx::FontWeight::Bold);
|
||||
name_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
name_label->set_fixed_height(20);
|
||||
|
@ -32,7 +32,7 @@ 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:"));
|
||||
auto amount_label = TRY(amount_container->try_add<GUI::Label>("Amount:"_short_string));
|
||||
amount_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
amount_label->set_fixed_size(50, 20);
|
||||
|
||||
|
|
|
@ -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:");
|
||||
auto& name_label = name_container.add<GUI::Label>("Name:"_short_string);
|
||||
name_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
name_label.set_fixed_size(80, 20);
|
||||
|
||||
|
@ -45,7 +45,7 @@ LayerPropertiesWidget::LayerPropertiesWidget()
|
|||
opacity_container.set_fixed_height(20);
|
||||
opacity_container.set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto& opacity_label = opacity_container.add<GUI::Label>("Opacity:");
|
||||
auto& opacity_label = opacity_container.add<GUI::Label>("Opacity:"_string.release_value_but_fixme_should_propagate_errors());
|
||||
opacity_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
opacity_label.set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ LevelsDialog::LevelsDialog(GUI::Window* parent_window, ImageEditor* editor)
|
|||
VERIFY(cancel_button);
|
||||
VERIFY(m_editor->active_layer());
|
||||
|
||||
context_label->set_text(DeprecatedString::formatted("Working on layer: {}", m_editor->active_layer()->name()));
|
||||
context_label->set_text(String::formatted("Working on layer: {}", m_editor->active_layer()->name()).release_value_but_fixme_should_propagate_errors());
|
||||
m_gamma_slider->set_value(100);
|
||||
|
||||
m_brightness_slider->on_change = [this](auto) {
|
||||
|
|
|
@ -36,7 +36,7 @@ void ToolPropertiesWidget::set_active_tool(Tool* tool)
|
|||
auto active_tool_widget_or_error = tool->get_properties_widget();
|
||||
if (active_tool_widget_or_error.is_error()) {
|
||||
m_active_tool_widget = nullptr;
|
||||
m_error_label->set_text(DeprecatedString::formatted("Error creating tool properties: {}", active_tool_widget_or_error.release_error()));
|
||||
m_error_label->set_text(String::formatted("Error creating tool properties: {}", active_tool_widget_or_error.release_error()).release_value_but_fixme_should_propagate_errors());
|
||||
m_tool_widget_stack->set_active_widget(m_error_label);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ 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:"));
|
||||
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_short_string));
|
||||
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
size_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -167,7 +167,7 @@ ErrorOr<GUI::Widget*> BrushTool::get_properties_widget()
|
|||
hardness_container->set_fixed_height(20);
|
||||
(void)TRY(hardness_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto hardness_label = TRY(hardness_container->try_add<GUI::Label>("Hardness:"));
|
||||
auto hardness_label = TRY(hardness_container->try_add<GUI::Label>(TRY("Hardness:"_string)));
|
||||
hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
hardness_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ ErrorOr<GUI::Widget*> BucketTool::get_properties_widget()
|
|||
threshold_container->set_fixed_height(20);
|
||||
(void)TRY(threshold_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto threshold_label = TRY(threshold_container->try_add<GUI::Label>("Threshold:"));
|
||||
auto threshold_label = TRY(threshold_container->try_add<GUI::Label>(TRY("Threshold:"_string)));
|
||||
threshold_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
threshold_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ 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:"));
|
||||
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_short_string));
|
||||
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
size_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -154,7 +154,7 @@ ErrorOr<GUI::Widget*> CloneTool::get_properties_widget()
|
|||
hardness_container->set_fixed_height(20);
|
||||
(void)TRY(hardness_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto hardness_label = TRY(hardness_container->try_add<GUI::Label>("Hardness:"));
|
||||
auto hardness_label = TRY(hardness_container->try_add<GUI::Label>(TRY("Hardness:"_string)));
|
||||
hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
hardness_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ ErrorOr<GUI::Widget*> EllipseTool::get_properties_widget()
|
|||
thickness_container->set_fixed_height(20);
|
||||
(void)TRY(thickness_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto thickness_label = TRY(thickness_container->try_add<GUI::Label>("Thickness:"));
|
||||
auto thickness_label = TRY(thickness_container->try_add<GUI::Label>(TRY("Thickness:"_string)));
|
||||
thickness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
thickness_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -152,7 +152,7 @@ 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:"));
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_short_string));
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
auto mode_radio_container = TRY(mode_container->try_add<GUI::Widget>());
|
||||
|
@ -180,7 +180,7 @@ ErrorOr<GUI::Widget*> EllipseTool::get_properties_widget()
|
|||
aspect_container->set_fixed_height(20);
|
||||
(void)TRY(aspect_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto aspect_label = TRY(aspect_container->try_add<GUI::Label>("Aspect Ratio:"));
|
||||
auto aspect_label = TRY(aspect_container->try_add<GUI::Label>(TRY("Aspect Ratio:"_string)));
|
||||
aspect_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
aspect_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -197,7 +197,7 @@ ErrorOr<GUI::Widget*> EllipseTool::get_properties_widget()
|
|||
}
|
||||
};
|
||||
|
||||
auto multiply_label = TRY(aspect_container->try_add<GUI::Label>("x"));
|
||||
auto multiply_label = TRY(aspect_container->try_add<GUI::Label>("x"_short_string));
|
||||
multiply_label->set_text_alignment(Gfx::TextAlignment::Center);
|
||||
multiply_label->set_fixed_size(10, 20);
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ 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:"));
|
||||
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_short_string));
|
||||
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
size_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -81,7 +81,7 @@ ErrorOr<GUI::Widget*> EraseTool::get_properties_widget()
|
|||
hardness_container->set_fixed_height(20);
|
||||
(void)TRY(hardness_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto hardness_label = TRY(hardness_container->try_add<GUI::Label>("Hardness:"));
|
||||
auto hardness_label = TRY(hardness_container->try_add<GUI::Label>(TRY("Hardness:"_string)));
|
||||
hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
hardness_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -108,7 +108,7 @@ ErrorOr<GUI::Widget*> EraseTool::get_properties_widget()
|
|||
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
mode_container->set_fixed_height(46);
|
||||
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Draw Mode:"));
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>(TRY("Draw Mode:"_string)));
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ ErrorOr<GUI::Widget*> GradientTool::get_properties_widget()
|
|||
auto mode_container = TRY(properties_widget->try_add<GUI::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>("Gradient Type:"));
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>(TRY("Gradient Type:"_string)));
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -236,7 +236,7 @@ ErrorOr<GUI::Widget*> GradientTool::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>("Opacity:"));
|
||||
auto size_label = TRY(size_container->try_add<GUI::Label>(TRY("Opacity:"_string)));
|
||||
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
size_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -270,7 +270,7 @@ ErrorOr<GUI::Widget*> GradientTool::get_properties_widget()
|
|||
hardness_container->set_visible(m_mode == GradientMode::Radial);
|
||||
};
|
||||
|
||||
auto hardness_label = TRY(hardness_container->try_add<GUI::Label>("Hardness:"));
|
||||
auto hardness_label = TRY(hardness_container->try_add<GUI::Label>(TRY("Hardness:"_string)));
|
||||
hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
auto hardness_slider = TRY(hardness_container->try_add<GUI::HorizontalOpacitySlider>());
|
||||
|
|
|
@ -186,7 +186,7 @@ ErrorOr<GUI::Widget*> GuideTool::get_properties_widget()
|
|||
snapping_container->set_fixed_height(20);
|
||||
(void)TRY(snapping_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto snapping_label = TRY(snapping_container->try_add<GUI::Label>("Snap offset:"));
|
||||
auto snapping_label = TRY(snapping_container->try_add<GUI::Label>(TRY("Snap offset:"_string)));
|
||||
snapping_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
snapping_label->set_fixed_size(80, 20);
|
||||
snapping_label->set_tooltip("Press Shift to snap");
|
||||
|
|
|
@ -185,7 +185,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:");
|
||||
mode_label->set_text("Mode:"_short_string);
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ ErrorOr<GUI::Widget*> LineTool::get_properties_widget()
|
|||
thickness_container->set_fixed_height(20);
|
||||
(void)TRY(thickness_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto thickness_label = TRY(thickness_container->try_add<GUI::Label>("Thickness:"));
|
||||
auto thickness_label = TRY(thickness_container->try_add<GUI::Label>(TRY("Thickness:"_string)));
|
||||
thickness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
thickness_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -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:"));
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_short_string));
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -298,7 +298,7 @@ ErrorOr<GUI::Widget*> MoveTool::get_properties_widget()
|
|||
auto selection_mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
(void)TRY(selection_mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
selection_mode_container->set_fixed_height(46);
|
||||
auto selection_mode_label = TRY(selection_mode_container->try_add<GUI::Label>("Selection Mode:"));
|
||||
auto selection_mode_label = TRY(selection_mode_container->try_add<GUI::Label>(TRY("Selection Mode:"_string)));
|
||||
selection_mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
selection_mode_label->set_fixed_size(80, 40);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ ErrorOr<GUI::Widget*> PenTool::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>("Thickness:"));
|
||||
auto size_label = TRY(size_container->try_add<GUI::Label>(TRY("Thickness:"_string)));
|
||||
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
size_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -190,7 +190,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:");
|
||||
mode_label->set_text("Mode:"_short_string);
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ ErrorOr<GUI::Widget*> RectangleSelectTool::get_properties_widget()
|
|||
(void)TRY(feather_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto feather_label = TRY(feather_container->try_add<GUI::Label>());
|
||||
feather_label->set_text("Feather:");
|
||||
feather_label->set_text(TRY("Feather:"_string));
|
||||
feather_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
feather_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -180,7 +180,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:");
|
||||
mode_label->set_text("Mode:"_short_string);
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -165,14 +165,14 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
|
|||
|
||||
auto update_slider = [this, thickness_or_radius_label, thickness_or_radius_slider] {
|
||||
auto update_values = [&](auto label, int value, int range_min, int range_max = 10) {
|
||||
thickness_or_radius_label->set_text(label);
|
||||
thickness_or_radius_label->set_text(String::from_utf8(label).release_value_but_fixme_should_propagate_errors());
|
||||
thickness_or_radius_slider->set_range(range_min, range_max);
|
||||
thickness_or_radius_slider->set_value(value);
|
||||
};
|
||||
if (m_fill_mode == FillMode::RoundedCorners)
|
||||
update_values("Radius:", m_corner_radius, 0, 50);
|
||||
update_values("Radius:"sv, m_corner_radius, 0, 50);
|
||||
else
|
||||
update_values("Thickness:", m_thickness, 1);
|
||||
update_values("Thickness:"sv, m_thickness, 1);
|
||||
};
|
||||
|
||||
update_slider();
|
||||
|
@ -181,7 +181,7 @@ 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:"));
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_short_string));
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(30, 20);
|
||||
|
||||
|
@ -225,7 +225,7 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
|
|||
(void)TRY(aspect_container->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
aspect_container->set_fixed_width(75);
|
||||
|
||||
auto aspect_label = TRY(aspect_container->try_add<GUI::Label>("Aspect Ratio:"));
|
||||
auto aspect_label = TRY(aspect_container->try_add<GUI::Label>(TRY("Aspect Ratio:"_string)));
|
||||
aspect_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
aspect_label->set_fixed_size(75, 20);
|
||||
|
||||
|
@ -246,7 +246,7 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
|
|||
}
|
||||
};
|
||||
|
||||
auto multiply_label = TRY(aspect_fields_container->try_add<GUI::Label>("x"));
|
||||
auto multiply_label = TRY(aspect_fields_container->try_add<GUI::Label>("x"_short_string));
|
||||
multiply_label->set_text_alignment(Gfx::TextAlignment::Center);
|
||||
multiply_label->set_fixed_size(10, 20);
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ 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:"));
|
||||
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_short_string));
|
||||
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
size_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -117,7 +117,7 @@ ErrorOr<GUI::Widget*> SprayTool::get_properties_widget()
|
|||
density_container->set_fixed_height(20);
|
||||
(void)TRY(density_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto density_label = TRY(density_container->try_add<GUI::Label>("Density:"));
|
||||
auto density_label = TRY(density_container->try_add<GUI::Label>(TRY("Density:"_string)));
|
||||
density_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
density_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -111,16 +111,16 @@ ErrorOr<GUI::Widget*> TextTool::get_properties_widget()
|
|||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
|
||||
auto font_header = TRY(properties_widget->try_add<GUI::Label>("Current Font:"));
|
||||
auto font_header = TRY(properties_widget->try_add<GUI::Label>(TRY("Current Font:"_string)));
|
||||
font_header->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
m_font_label = TRY(properties_widget->try_add<GUI::Label>(m_selected_font->human_readable_name()));
|
||||
m_font_label = TRY(properties_widget->try_add<GUI::Label>(TRY(String::from_deprecated_string(m_selected_font->human_readable_name()))));
|
||||
|
||||
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) {
|
||||
m_font_label->set_text(picker->font()->human_readable_name());
|
||||
m_font_label->set_text(String::from_deprecated_string(picker->font()->human_readable_name()).release_value_but_fixme_should_propagate_errors());
|
||||
m_selected_font = picker->font();
|
||||
m_text_editor->set_font(m_selected_font);
|
||||
m_editor->set_focus(true);
|
||||
|
|
|
@ -77,7 +77,7 @@ ErrorOr<GUI::Widget*> WandSelectTool::get_properties_widget()
|
|||
threshold_container->set_fixed_height(20);
|
||||
(void)TRY(threshold_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto threshold_label = TRY(threshold_container->try_add<GUI::Label>("Threshold:"));
|
||||
auto threshold_label = TRY(threshold_container->try_add<GUI::Label>(TRY("Threshold:"_string)));
|
||||
threshold_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
threshold_label->set_fixed_size(80, 20);
|
||||
|
||||
|
@ -95,7 +95,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:");
|
||||
mode_label->set_text("Mode:"_short_string);
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ ErrorOr<GUI::Widget*> ZoomTool::get_properties_widget()
|
|||
sensitivity_container->set_fixed_height(20);
|
||||
(void)TRY(sensitivity_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
|
||||
auto sensitivity_label = TRY(sensitivity_container->try_add<GUI::Label>("Sensitivity:"));
|
||||
auto sensitivity_label = TRY(sensitivity_container->try_add<GUI::Label>(TRY("Sensitivity:"_string)));
|
||||
sensitivity_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
sensitivity_label->set_fixed_size(80, 20);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue