Skip to content

Commit

Permalink
Inspector: Add a special icon for layout classes
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Mar 5, 2020
1 parent a119d81 commit 6bcda18
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Binary file added Base/res/icons/16x16/layout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions DevTools/Inspector/RemoteObjectGraphModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions DevTools/Inspector/RemoteObjectGraphModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ class RemoteObjectGraphModel final : public GUI::Model {

GIcon m_object_icon;
GIcon m_window_icon;
GIcon m_layout_icon;
};

0 comments on commit 6bcda18

Please sign in to comment.