mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 14:47:34 +00:00
Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
This commit is contained in:
parent
e5f09ea170
commit
3f3f45580a
762 changed files with 8315 additions and 8316 deletions
|
@ -30,14 +30,14 @@ WelcomeWidget::WelcomeWidget()
|
|||
tip_frame.set_fill_with_background_color(true);
|
||||
|
||||
auto& light_bulb_label = *find_descendant_of_type_named<GUI::Label>("light_bulb_label");
|
||||
light_bulb_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/app-welcome.png").release_value_but_fixme_should_propagate_errors());
|
||||
light_bulb_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/app-welcome.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
m_web_view = *find_descendant_of_type_named<WebView::OutOfProcessWebView>("web_view");
|
||||
|
||||
m_tip_label = *find_descendant_of_type_named<GUI::Label>("tip_label");
|
||||
|
||||
m_next_button = *find_descendant_of_type_named<GUI::Button>("next_button");
|
||||
m_next_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png").release_value_but_fixme_should_propagate_errors());
|
||||
m_next_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_next_button->on_click = [&](auto) {
|
||||
if (!tip_frame.is_visible()) {
|
||||
m_web_view->set_visible(false);
|
||||
|
@ -52,7 +52,7 @@ WelcomeWidget::WelcomeWidget()
|
|||
};
|
||||
|
||||
m_help_button = *find_descendant_of_type_named<GUI::Button>("help_button");
|
||||
m_help_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/book-open.png").release_value_but_fixme_should_propagate_errors());
|
||||
m_help_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/book-open.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
m_help_button->on_click = [&](auto) {
|
||||
GUI::Process::spawn_or_show_error(window(), "/bin/Help"sv);
|
||||
};
|
||||
|
@ -68,11 +68,11 @@ WelcomeWidget::WelcomeWidget()
|
|||
GUI::Application::the()->quit();
|
||||
};
|
||||
|
||||
auto exec_path = Config::read_string("SystemServer", "Welcome", "Executable", {});
|
||||
auto exec_path = Config::read_string("SystemServer"sv, "Welcome"sv, "Executable"sv, {});
|
||||
m_startup_checkbox = *find_descendant_of_type_named<GUI::CheckBox>("startup_checkbox");
|
||||
m_startup_checkbox->set_checked(!exec_path.is_empty());
|
||||
m_startup_checkbox->on_checked = [](bool is_checked) {
|
||||
Config::write_string("SystemServer", "Welcome", "Executable", is_checked ? "/bin/Welcome" : "");
|
||||
Config::write_string("SystemServer"sv, "Welcome"sv, "Executable"sv, is_checked ? "/bin/Welcome"sv : ""sv);
|
||||
};
|
||||
|
||||
open_and_parse_readme_file();
|
||||
|
@ -129,8 +129,8 @@ void WelcomeWidget::paint_event(GUI::PaintEvent& event)
|
|||
GUI::Painter painter(*this);
|
||||
painter.add_clip_rect(event.rect());
|
||||
|
||||
static auto font = Gfx::BitmapFont::load_from_file("/res/fonts/MarietaRegular24.font");
|
||||
painter.draw_text({ 12, 4, 1, 30 }, "Welcome to ", *font, Gfx::TextAlignment::CenterLeft, palette().base_text());
|
||||
painter.draw_text({ 12 + font->width("Welcome to "), 4, 1, 30 }, "Serenity", font->bold_variant(), Gfx::TextAlignment::CenterLeft, palette().base_text());
|
||||
painter.draw_text({ 12 + font->width("Welcome to ") + font->bold_variant().width("Serenity"), 4, 1, 30 }, "OS", font->bold_variant(), Gfx::TextAlignment::CenterLeft, palette().base() == palette().window() ? palette().base_text() : palette().base());
|
||||
static auto font = Gfx::BitmapFont::load_from_file("/res/fonts/MarietaRegular24.font"sv);
|
||||
painter.draw_text({ 12, 4, 1, 30 }, "Welcome to "sv, *font, Gfx::TextAlignment::CenterLeft, palette().base_text());
|
||||
painter.draw_text({ 12 + font->width("Welcome to "sv), 4, 1, 30 }, "Serenity"sv, font->bold_variant(), Gfx::TextAlignment::CenterLeft, palette().base_text());
|
||||
painter.draw_text({ 12 + font->width("Welcome to "sv) + font->bold_variant().width("Serenity"sv), 4, 1, 30 }, "OS"sv, font->bold_variant(), Gfx::TextAlignment::CenterLeft, palette().base() == palette().window() ? palette().base_text() : palette().base());
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil("/tmp/portal/webcontent", "rw"));
|
||||
TRY(Core::System::unveil("/bin/Help", "x"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
auto app_icon = GUI::Icon::default_icon("app-welcome");
|
||||
auto app_icon = GUI::Icon::default_icon("app-welcome"sv);
|
||||
|
||||
auto window = TRY(GUI::Window::try_create());
|
||||
window->resize(480, 250);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue