1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 02:27:44 +00:00

Userland: Replace usages of AbstractButton::text_deprecated with text()

This commit is contained in:
Karol Kosek 2023-02-12 11:40:58 +01:00 committed by Linus Groh
parent fca29eae09
commit d32d4029d3
9 changed files with 25 additions and 25 deletions

View file

@ -57,7 +57,7 @@ class ResultRow final : public GUI::Button {
if (!m_context_menu) {
m_context_menu = GUI::Menu::construct();
if (LexicalPath path { text_deprecated() }; path.is_absolute()) {
if (LexicalPath path { text().to_deprecated_string() }; path.is_absolute()) {
m_context_menu->add_action(GUI::Action::create("&Show in File Manager", MUST(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-file-manager.png"sv)), [=](auto&) {
Desktop::Launcher::open(URL::create_with_file_scheme(path.dirname(), path.basename()));
}));
@ -65,7 +65,7 @@ class ResultRow final : public GUI::Button {
}
m_context_menu->add_action(GUI::Action::create("&Copy as Text", MUST(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"sv)), [&](auto&) {
GUI::Clipboard::the().set_plain_text(text_deprecated());
GUI::Clipboard::the().set_plain_text(text());
}));
}
m_context_menu->popup(event.screen_position());

View file

@ -264,7 +264,7 @@ void BookmarksBarWidget::update_content_size()
for (size_t i = m_last_visible_index; i < m_bookmarks.size(); ++i) {
auto& bookmark = m_bookmarks.at(i);
bookmark.set_visible(false);
m_additional_menu->add_action(GUI::Action::create(bookmark.text_deprecated(), g_icon_bag.filetype_html, [&](auto&) { bookmark.on_click(0); }));
m_additional_menu->add_action(GUI::Action::create(bookmark.text().to_deprecated_string(), g_icon_bag.filetype_html, [&](auto&) { bookmark.on_click(0); }));
}
}
}

View file

@ -38,13 +38,13 @@ void KeyButton::paint_event(GUI::PaintEvent& event)
painter.draw_rect(key_cap_face_border_rect, Color::from_rgb(0x8C7272), false);
painter.fill_rect(key_cap_face_rect, face_color);
if (text_deprecated().is_empty() || text_deprecated().starts_with('\0'))
if (text().is_empty() || text().bytes_as_string_view().starts_with('\0'))
return;
Gfx::IntRect text_rect { 0, 0, static_cast<int>(ceilf(font.width(text_deprecated()))), font.glyph_height() };
Gfx::IntRect text_rect { 0, 0, static_cast<int>(ceilf(font.width(text()))), font.glyph_height() };
text_rect.align_within(key_cap_face_rect, Gfx::TextAlignment::Center);
painter.draw_text(text_rect, text_deprecated(), font, Gfx::TextAlignment::Center, Color::Black, Gfx::TextElision::Right);
painter.draw_text(text_rect, text(), font, Gfx::TextAlignment::Center, Color::Black, Gfx::TextElision::Right);
if (is_focused())
painter.draw_rect(text_rect.inflated(6, 4), palette().focus_outline());
}