mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:47:44 +00:00
Userland: Set Button text using the new String class
This commit is contained in:
parent
b5cb9a9ebb
commit
e39adc4772
49 changed files with 134 additions and 127 deletions
|
@ -157,9 +157,9 @@ GUI::Widget* EllipseTool::get_properties_widget()
|
|||
|
||||
auto& mode_radio_container = mode_container.add<GUI::Widget>();
|
||||
mode_radio_container.set_layout<GUI::VerticalBoxLayout>();
|
||||
auto& outline_mode_radio = mode_radio_container.add<GUI::RadioButton>("Outline");
|
||||
auto& fill_mode_radio = mode_radio_container.add<GUI::RadioButton>("Fill");
|
||||
auto& aa_enable_checkbox = mode_radio_container.add<GUI::CheckBox>("Anti-alias");
|
||||
auto& outline_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Outline"sv));
|
||||
auto& fill_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Fill"sv));
|
||||
auto& aa_enable_checkbox = mode_radio_container.add<GUI::CheckBox>(String::from_utf8("Anti-alias"sv).release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
aa_enable_checkbox.on_checked = [&](bool checked) {
|
||||
m_antialias_enabled = checked;
|
||||
|
|
|
@ -100,7 +100,7 @@ GUI::Widget* EraseTool::get_properties_widget()
|
|||
|
||||
auto& use_secondary_color_checkbox = secondary_color_container.add<GUI::CheckBox>();
|
||||
use_secondary_color_checkbox.set_checked(m_use_secondary_color);
|
||||
use_secondary_color_checkbox.set_text_deprecated("Use secondary color");
|
||||
use_secondary_color_checkbox.set_text(String::from_utf8("Use secondary color"sv).release_value_but_fixme_should_propagate_errors());
|
||||
use_secondary_color_checkbox.on_checked = [&](bool checked) {
|
||||
m_use_secondary_color = checked;
|
||||
};
|
||||
|
@ -114,8 +114,8 @@ GUI::Widget* EraseTool::get_properties_widget()
|
|||
|
||||
auto& mode_radio_container = mode_container.add<GUI::Widget>();
|
||||
mode_radio_container.set_layout<GUI::VerticalBoxLayout>();
|
||||
auto& pencil_mode_radio = mode_radio_container.add<GUI::RadioButton>("Pencil");
|
||||
auto& brush_mode_radio = mode_radio_container.add<GUI::RadioButton>("Brush");
|
||||
auto& pencil_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Pencil"sv));
|
||||
auto& brush_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Brush"sv));
|
||||
|
||||
pencil_mode_radio.on_checked = [&](bool) {
|
||||
m_draw_mode = DrawMode::Pencil;
|
||||
|
|
|
@ -203,7 +203,7 @@ GUI::Widget* GradientTool::get_properties_widget()
|
|||
auto& button_container_layout = button_container.set_layout<GUI::HorizontalBoxLayout>();
|
||||
button_container_layout.add_spacer();
|
||||
|
||||
auto& apply_button = button_container.add<GUI::DialogButton>("Apply");
|
||||
auto& apply_button = button_container.add<GUI::DialogButton>(String::from_utf8_short_string("Apply"sv));
|
||||
apply_button.on_click = [this](auto) {
|
||||
rasterize_gradient();
|
||||
};
|
||||
|
|
|
@ -150,7 +150,7 @@ 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 = mode_container.add<GUI::CheckBox>("Anti-alias");
|
||||
auto& aa_enable_checkbox = mode_container.add<GUI::CheckBox>(String::from_utf8("Anti-alias"sv).release_value_but_fixme_should_propagate_errors());
|
||||
aa_enable_checkbox.on_checked = [&](bool checked) {
|
||||
m_antialias_enabled = checked;
|
||||
};
|
||||
|
|
|
@ -304,9 +304,9 @@ GUI::Widget* MoveTool::get_properties_widget()
|
|||
|
||||
auto& mode_radio_container = selection_mode_container.add<GUI::Widget>();
|
||||
mode_radio_container.set_layout<GUI::VerticalBoxLayout>();
|
||||
m_selection_mode_foreground = mode_radio_container.add<GUI::RadioButton>("Foreground");
|
||||
m_selection_mode_foreground = mode_radio_container.add<GUI::RadioButton>(String::from_utf8("Foreground"sv).release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
m_selection_mode_active = mode_radio_container.add<GUI::RadioButton>("Active Layer");
|
||||
m_selection_mode_active = mode_radio_container.add<GUI::RadioButton>(String::from_utf8("Active Layer"sv).release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
m_selection_mode_foreground->on_checked = [&](bool) {
|
||||
m_layer_selection_mode = LayerSelectionMode::ForegroundLayer;
|
||||
|
|
|
@ -46,7 +46,7 @@ GUI::Widget* PickerTool::get_properties_widget()
|
|||
m_properties_widget = GUI::Widget::construct();
|
||||
m_properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto& sample_checkbox = m_properties_widget->add<GUI::CheckBox>("Sample all layers");
|
||||
auto& sample_checkbox = m_properties_widget->add<GUI::CheckBox>(String::from_utf8("Sample all layers"sv).release_value_but_fixme_should_propagate_errors());
|
||||
sample_checkbox.set_checked(m_sample_all_layers);
|
||||
sample_checkbox.on_checked = [&](bool value) {
|
||||
m_sample_all_layers = value;
|
||||
|
|
|
@ -187,12 +187,12 @@ GUI::Widget* RectangleTool::get_properties_widget()
|
|||
|
||||
auto& mode_radio_container = mode_container.add<GUI::Widget>();
|
||||
mode_radio_container.set_layout<GUI::VerticalBoxLayout>();
|
||||
auto& outline_mode_radio = mode_radio_container.add<GUI::RadioButton>("Outline");
|
||||
auto& fill_mode_radio = mode_radio_container.add<GUI::RadioButton>("Fill");
|
||||
auto& gradient_mode_radio = mode_radio_container.add<GUI::RadioButton>("Gradient");
|
||||
auto& outline_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Outline"sv));
|
||||
auto& fill_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Fill"sv));
|
||||
auto& gradient_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8("Gradient"sv).release_value_but_fixme_should_propagate_errors());
|
||||
mode_radio_container.set_fixed_width(70);
|
||||
|
||||
auto& rounded_corners_mode_radio = mode_radio_container.add<GUI::RadioButton>("Rounded");
|
||||
auto& rounded_corners_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Rounded"sv));
|
||||
|
||||
outline_mode_radio.on_checked = [&, update_slider](bool) {
|
||||
m_fill_mode = FillMode::Outline;
|
||||
|
@ -215,7 +215,7 @@ GUI::Widget* RectangleTool::get_properties_widget()
|
|||
auto& mode_extras_container = mode_container.add<GUI::Widget>();
|
||||
mode_extras_container.set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto& aa_enable_checkbox = mode_extras_container.add<GUI::CheckBox>("Anti-alias");
|
||||
auto& aa_enable_checkbox = mode_extras_container.add<GUI::CheckBox>(String::from_utf8("Anti-alias"sv).release_value_but_fixme_should_propagate_errors());
|
||||
aa_enable_checkbox.on_checked = [&](bool checked) {
|
||||
m_antialias_enabled = checked;
|
||||
};
|
||||
|
|
|
@ -112,7 +112,7 @@ GUI::Widget* TextTool::get_properties_widget()
|
|||
|
||||
m_font_label = m_properties_widget->add<GUI::Label>(m_selected_font->human_readable_name());
|
||||
|
||||
auto& change_font_button = m_properties_widget->add<GUI::Button>("Change Font...");
|
||||
auto& change_font_button = m_properties_widget->add<GUI::Button>(String::from_utf8("Change Font..."sv).release_value_but_fixme_should_propagate_errors());
|
||||
change_font_button.on_click = [&](auto) {
|
||||
auto picker = GUI::FontPicker::construct(nullptr, m_selected_font, false);
|
||||
if (picker->exec() == GUI::Dialog::ExecResult::OK) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue