mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-02 08:22:55 +00:00
ProfileViewer: Show kernel frames with a red icon :^)
This commit is contained in:
parent
f692577559
commit
e4267020c4
Notes:
sideshowbarker
2024-07-19 10:51:42 +09:00
Author: https://github.com/awesomekling
Commit: e4267020c4
3 changed files with 10 additions and 4 deletions
BIN
Base/res/icons/16x16/inspector-object-red.png
Normal file
BIN
Base/res/icons/16x16/inspector-object-red.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 196 B |
|
@ -7,7 +7,8 @@
|
||||||
ProfileModel::ProfileModel(Profile& profile)
|
ProfileModel::ProfileModel(Profile& profile)
|
||||||
: m_profile(profile)
|
: m_profile(profile)
|
||||||
{
|
{
|
||||||
m_frame_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/inspector-object.png"));
|
m_user_frame_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/inspector-object.png"));
|
||||||
|
m_kernel_frame_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/inspector-object-red.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileModel::~ProfileModel()
|
ProfileModel::~ProfileModel()
|
||||||
|
@ -90,8 +91,11 @@ GVariant ProfileModel::data(const GModelIndex& index, Role role) const
|
||||||
{
|
{
|
||||||
auto* node = static_cast<ProfileNode*>(index.internal_data());
|
auto* node = static_cast<ProfileNode*>(index.internal_data());
|
||||||
if (role == Role::Icon) {
|
if (role == Role::Icon) {
|
||||||
if (index.column() == Column::StackFrame)
|
if (index.column() == Column::StackFrame) {
|
||||||
return m_frame_icon;
|
if (node->address() < (8 * MB))
|
||||||
|
return m_kernel_frame_icon;
|
||||||
|
return m_user_frame_icon;
|
||||||
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
if (role == Role::Display) {
|
if (role == Role::Display) {
|
||||||
|
|
|
@ -33,5 +33,7 @@ private:
|
||||||
explicit ProfileModel(Profile&);
|
explicit ProfileModel(Profile&);
|
||||||
|
|
||||||
Profile& m_profile;
|
Profile& m_profile;
|
||||||
GIcon m_frame_icon;
|
|
||||||
|
GIcon m_user_frame_icon;
|
||||||
|
GIcon m_kernel_frame_icon;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue