mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 06:18:59 +00:00
Inspector: Make properties editable :^)
This patch makes it possible to live-edit remote object properties by simply double clicking on them in the property table view. This is pretty neat! :^)
This commit is contained in:
parent
3edcaa9b99
commit
b2be8466fb
Notes:
sideshowbarker
2024-07-19 08:53:48 +09:00
Author: https://github.com/awesomekling
Commit: b2be8466fb
5 changed files with 39 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "RemoteObjectPropertyModel.h"
|
||||
#include "RemoteObject.h"
|
||||
#include "RemoteProcess.h"
|
||||
|
||||
RemoteObjectPropertyModel::RemoteObjectPropertyModel(RemoteObject& object)
|
||||
: m_object(object)
|
||||
|
@ -70,3 +71,12 @@ void RemoteObjectPropertyModel::update()
|
|||
});
|
||||
did_update();
|
||||
}
|
||||
|
||||
void RemoteObjectPropertyModel::set_data(const GUI::ModelIndex& index, const GUI::Variant& new_value)
|
||||
{
|
||||
auto& property = m_properties[index.row()];
|
||||
uintptr_t address = m_object.json.get("address").to_number<uintptr_t>();
|
||||
RemoteProcess::the().set_property(address, property.name.to_string(), new_value.to_string());
|
||||
property.value = new_value.to_string();
|
||||
did_update();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue