mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 22:25:08 +00:00
VisualBuilder: Display read-only propery values in gray.
This commit is contained in:
parent
383b2efc1f
commit
34dd4fcaf1
2 changed files with 10 additions and 2 deletions
|
@ -36,11 +36,19 @@ GVariant VBWidgetPropertyModel::data(const GModelIndex& index, Role role) const
|
|||
{
|
||||
if (role == Role::Display) {
|
||||
auto& property = *m_widget.m_properties[index.row()];
|
||||
auto value = property.value();
|
||||
switch (index.column()) {
|
||||
case Column::Name: return property.name();
|
||||
case Column::Value: return property.value();
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
if (role == Role::ForegroundColor) {
|
||||
auto& property = *m_widget.m_properties[index.row()];
|
||||
switch (index.column()) {
|
||||
case Column::Name: return Color::Black;
|
||||
case Column::Value: return property.is_readonly() ? Color(Color::MidGray) : Color(Color::Black);
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
return { };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue