Inspector: Show GWindows with a little window icon.

This commit is contained in:
Andreas Kling 2019-08-18 19:54:35 +02:00
parent 770cf498ca
commit a32123f221
Notes: sideshowbarker 2024-07-19 12:36:00 +09:00
2 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,7 @@ RemoteObjectGraphModel::RemoteObjectGraphModel(pid_t pid)
: m_pid(pid)
{
m_object_icon.set_bitmap_for_size(16, load_png("/res/icons/16x16/inspector-object.png"));
m_window_icon.set_bitmap_for_size(16, load_png("/res/icons/16x16/window.png"));
}
RemoteObjectGraphModel::~RemoteObjectGraphModel()
@ -59,6 +60,8 @@ GVariant RemoteObjectGraphModel::data(const GModelIndex& index, Role role) const
{
auto* remote_object = static_cast<RemoteObject*>(index.internal_data());
if (role == Role::Icon) {
if (remote_object->class_name == "GWindow")
return m_window_icon;
return m_object_icon;
}
if (role == Role::Display) {

View File

@ -39,4 +39,5 @@ private:
JsonArray m_json;
NonnullOwnPtrVector<RemoteObject> m_remote_roots;
GIcon m_object_icon;
GIcon m_window_icon;
};