diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-11 21:53:39 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-11 21:53:39 +0200 |
commit | 34dd4fcaf1f04b1da23163e215c7a07573ca9964 (patch) | |
tree | 6e8101f80ba27c769dc81e28b1766c6b04c0796f /Applications/VisualBuilder | |
parent | 383b2efc1f8c39c672f660ba63e9805571ae42ee (diff) | |
download | serenity-34dd4fcaf1f04b1da23163e215c7a07573ca9964.zip |
VisualBuilder: Display read-only propery values in gray.
Diffstat (limited to 'Applications/VisualBuilder')
-rw-r--r-- | Applications/VisualBuilder/VBWidgetPropertyModel.cpp | 10 | ||||
-rw-r--r-- | Applications/VisualBuilder/VBWidgetRegistry.cpp | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/Applications/VisualBuilder/VBWidgetPropertyModel.cpp b/Applications/VisualBuilder/VBWidgetPropertyModel.cpp index 2b110a15c6..e2897f1457 100644 --- a/Applications/VisualBuilder/VBWidgetPropertyModel.cpp +++ b/Applications/VisualBuilder/VBWidgetPropertyModel.cpp @@ -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 { }; } diff --git a/Applications/VisualBuilder/VBWidgetRegistry.cpp b/Applications/VisualBuilder/VBWidgetRegistry.cpp index 0cd75e451e..5082706794 100644 --- a/Applications/VisualBuilder/VBWidgetRegistry.cpp +++ b/Applications/VisualBuilder/VBWidgetRegistry.cpp @@ -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; } |