1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-19 08:32:07 +00:00

LibGUI: Models should always specify font via Model::Role::Font

This gets rid of one field in ColumnData. The goal is to get rid of all
fields and lose ColumnData entirely.
This commit is contained in:
Andreas Kling 2020-05-21 18:56:52 +02:00
parent 57d15acd4c
commit 04187576ff
8 changed files with 23 additions and 26 deletions

View file

@ -61,12 +61,17 @@ GUI::Model::ColumnMetadata VBWidgetPropertyModel::column_metadata(int column) co
{
UNUSED_PARAM(column);
if (column == Column::Name)
return { 110, Gfx::TextAlignment::CenterLeft, &Gfx::Font::default_bold_font() };
return { 110, Gfx::TextAlignment::CenterLeft };
return { 90, Gfx::TextAlignment::CenterLeft };
}
GUI::Variant VBWidgetPropertyModel::data(const GUI::ModelIndex& index, Role role) const
{
if (role == Role::Font) {
if (index.column() == Column::Name)
return Gfx::Font::default_bold_font();
return {};
}
if (role == Role::Custom) {
auto& property = m_widget.m_properties[index.row()];
if (index.column() == Column::Type)