mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
Inspector: Show GWindows with a little window icon.
This commit is contained in:
parent
770cf498ca
commit
a32123f221
Notes:
sideshowbarker
2024-07-19 12:36:00 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a32123f221f
@ -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) {
|
||||
|
@ -39,4 +39,5 @@ private:
|
||||
JsonArray m_json;
|
||||
NonnullOwnPtrVector<RemoteObject> m_remote_roots;
|
||||
GIcon m_object_icon;
|
||||
GIcon m_window_icon;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user