1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:57:45 +00:00

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
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_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_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() RemoteObjectGraphModel::~RemoteObjectGraphModel()
@ -100,6 +101,8 @@ GUI::Variant RemoteObjectGraphModel::data(const GUI::ModelIndex& index, Role rol
if (role == Role::Icon) { if (role == Role::Icon) {
if (remote_object->class_name == "Window") if (remote_object->class_name == "Window")
return m_window_icon; return m_window_icon;
if (remote_object->class_name.ends_with("Layout"))
return m_layout_icon;
return m_object_icon; return m_object_icon;
} }
if (role == Role::Display) { if (role == Role::Display) {

View file

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