From 6bcda1875e27c35cb52c67ab50e674edc578142b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 5 Mar 2020 11:13:44 +0100 Subject: [PATCH] Inspector: Add a special icon for layout classes --- Base/res/icons/16x16/layout.png | Bin 0 -> 158 bytes DevTools/Inspector/RemoteObjectGraphModel.cpp | 3 +++ DevTools/Inspector/RemoteObjectGraphModel.h | 1 + 3 files changed, 4 insertions(+) create mode 100644 Base/res/icons/16x16/layout.png diff --git a/Base/res/icons/16x16/layout.png b/Base/res/icons/16x16/layout.png new file mode 100644 index 0000000000000000000000000000000000000000..9c2b6059612de4a0011aaf0fbb655a297877678e GIT binary patch literal 158 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7QaxQ9Lo7}wCoB*!FfuSO zsQB>bKfmyekF66YM*Qp3@9E)r!6v|c;-Yix<%Ft;3#=ZT%&QpO*x1M{%D_+{7xcYjPJAl^0|SGntDnm{r-UW| DlW{X2 literal 0 HcmV?d00001 diff --git a/DevTools/Inspector/RemoteObjectGraphModel.cpp b/DevTools/Inspector/RemoteObjectGraphModel.cpp index b5d6db23d0..aed1bd5b57 100644 --- a/DevTools/Inspector/RemoteObjectGraphModel.cpp +++ b/DevTools/Inspector/RemoteObjectGraphModel.cpp @@ -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) { diff --git a/DevTools/Inspector/RemoteObjectGraphModel.h b/DevTools/Inspector/RemoteObjectGraphModel.h index 007b6861f7..374416c49d 100644 --- a/DevTools/Inspector/RemoteObjectGraphModel.h +++ b/DevTools/Inspector/RemoteObjectGraphModel.h @@ -57,4 +57,5 @@ private: GIcon m_object_icon; GIcon m_window_icon; + GIcon m_layout_icon; };