1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

Userland: Set Button text using the new String class

This commit is contained in:
Karol Kosek 2023-02-11 20:51:04 +01:00 committed by Linus Groh
parent b5cb9a9ebb
commit e39adc4772
49 changed files with 134 additions and 127 deletions

View file

@ -15,10 +15,10 @@
namespace GUI {
ProcessChooser::ProcessChooser(StringView window_title, StringView button_label, Gfx::Bitmap const* window_icon, GUI::Window* parent_window)
ProcessChooser::ProcessChooser(StringView window_title, String button_label, Gfx::Bitmap const* window_icon, GUI::Window* parent_window)
: Dialog(parent_window)
, m_window_title(window_title)
, m_button_label(button_label)
, m_button_label(move(button_label))
, m_window_icon(window_icon)
{
set_title(m_window_title);
@ -62,7 +62,7 @@ ProcessChooser::ProcessChooser(StringView window_title, StringView button_label,
auto index = m_table_view->selection().first();
set_pid_from_index_and_close(index);
};
auto& cancel_button = button_container.add<GUI::Button>("Cancel");
auto& cancel_button = button_container.add<GUI::Button>(String::from_utf8_short_string("Cancel"sv));
cancel_button.set_fixed_width(80);
cancel_button.on_click = [this](auto) {
done(ExecResult::Cancel);