Inspector: Add a special icon for layout classes

This commit is contained in:
Andreas Kling 2020-03-05 11:13:44 +01:00
parent a119d812e1
commit 6bcda1875e
Notes: sideshowbarker 2024-07-19 08:54:11 +09:00
3 changed files with 4 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

View file

@ -37,6 +37,7 @@ RemoteObjectGraphModel::RemoteObjectGraphModel(RemoteProcess& process)
{
m_object_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/inspector-object.png"));
m_window_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/window.png"));
m_layout_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/layout.png"));
}
RemoteObjectGraphModel::~RemoteObjectGraphModel()
@ -100,6 +101,8 @@ GUI::Variant RemoteObjectGraphModel::data(const GUI::ModelIndex& index, Role rol
if (role == Role::Icon) {
if (remote_object->class_name == "Window")
return m_window_icon;
if (remote_object->class_name.ends_with("Layout"))
return m_layout_icon;
return m_object_icon;
}
if (role == Role::Display) {

View file

@ -57,4 +57,5 @@ private:
GIcon m_object_icon;
GIcon m_window_icon;
GIcon m_layout_icon;
};