mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:47:46 +00:00
LibGfx: Convert Font APIs to return String instead of DeprecatedString
This commit is contained in:
parent
4e9dc127ae
commit
545d8336b8
29 changed files with 106 additions and 104 deletions
|
@ -190,15 +190,15 @@ void FontPicker::set_font(Gfx::Font const* font)
|
|||
return;
|
||||
}
|
||||
|
||||
m_family = font->family();
|
||||
m_variant = font->variant();
|
||||
m_family = font->family().to_deprecated_string();
|
||||
m_variant = font->variant().to_deprecated_string();
|
||||
m_size = font->presentation_size();
|
||||
|
||||
auto family_index = m_families.find_first_index(m_font->family());
|
||||
auto family_index = m_families.find_first_index(m_font->family().to_deprecated_string());
|
||||
if (family_index.has_value())
|
||||
m_family_list_view->set_cursor(m_family_list_view->model()->index(family_index.value()), GUI::AbstractView::SelectionUpdate::Set);
|
||||
|
||||
auto variant_index = m_variants.find_first_index(m_font->variant());
|
||||
auto variant_index = m_variants.find_first_index(m_font->variant().to_deprecated_string());
|
||||
if (variant_index.has_value())
|
||||
m_variant_list_view->set_cursor(m_variant_list_view->model()->index(variant_index.value()), GUI::AbstractView::SelectionUpdate::Set);
|
||||
|
||||
|
|
|
@ -826,20 +826,20 @@ void Widget::set_font_family(String const& family)
|
|||
|
||||
void Widget::set_font_size(unsigned size)
|
||||
{
|
||||
set_font(Gfx::FontDatabase::the().get(m_font->family(), size, m_font->weight(), m_font->width(), m_font->slope()));
|
||||
set_font(Gfx::FontDatabase::the().get(m_font->family().to_deprecated_string(), size, m_font->weight(), m_font->width(), m_font->slope()));
|
||||
}
|
||||
|
||||
void Widget::set_font_weight(unsigned weight)
|
||||
{
|
||||
set_font(Gfx::FontDatabase::the().get(m_font->family(), m_font->presentation_size(), weight, m_font->width(), m_font->slope()));
|
||||
set_font(Gfx::FontDatabase::the().get(m_font->family().to_deprecated_string(), m_font->presentation_size(), weight, m_font->width(), m_font->slope()));
|
||||
}
|
||||
|
||||
void Widget::set_font_fixed_width(bool fixed_width)
|
||||
{
|
||||
if (fixed_width)
|
||||
set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_fixed_width_font().family(), m_font->presentation_size(), m_font->weight(), m_font->width(), m_font->slope()));
|
||||
set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_fixed_width_font().family().to_deprecated_string(), m_font->presentation_size(), m_font->weight(), m_font->width(), m_font->slope()));
|
||||
else
|
||||
set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_font().family(), m_font->presentation_size(), m_font->weight(), m_font->width(), m_font->slope()));
|
||||
set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_font().family().to_deprecated_string(), m_font->presentation_size(), m_font->weight(), m_font->width(), m_font->slope()));
|
||||
}
|
||||
|
||||
bool Widget::is_font_fixed_width()
|
||||
|
@ -1272,7 +1272,7 @@ void Widget::add_spacer()
|
|||
|
||||
String Widget::font_family() const
|
||||
{
|
||||
return String::from_deprecated_string(m_font->family()).release_value_but_fixme_should_propagate_errors();
|
||||
return m_font->family();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue