Inspector: Add a special icon for layout classes
This commit is contained in:
parent
a119d812e1
commit
6bcda1875e
Notes:
sideshowbarker
2024-07-19 08:54:11 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6bcda1875e2
3 changed files with 4 additions and 0 deletions
BIN
Base/res/icons/16x16/layout.png
Normal file
BIN
Base/res/icons/16x16/layout.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 158 B |
|
@ -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) {
|
||||
|
|
|
@ -57,4 +57,5 @@ private:
|
|||
|
||||
GIcon m_object_icon;
|
||||
GIcon m_window_icon;
|
||||
GIcon m_layout_icon;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue