mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
VisualBuilder: Display read-only propery values in gray.
This commit is contained in:
parent
383b2efc1f
commit
34dd4fcaf1
Notes:
sideshowbarker
2024-07-19 14:45:01 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/34dd4fcaf1f
@ -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 { };
|
||||
}
|
||||
|
@ -82,6 +82,6 @@ GWidget* VBWidgetRegistry::build_gwidget(VBWidgetType type, GWidget* parent, Vec
|
||||
property->set_readonly(is_readonly);
|
||||
properties.append(move(property));
|
||||
};
|
||||
add_property("ClassName", to_class_name(type), true);
|
||||
add_property("class", to_class_name(type), true);
|
||||
return gwidget;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user