1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-04 20:27:35 +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:
Andreas Kling 2020-03-05 15:47:24 +01:00
parent 3edcaa9b99
commit b2be8466fb
5 changed files with 39 additions and 0 deletions

View file

@ -30,6 +30,7 @@
#include "RemoteProcess.h"
#include <LibGUI/Application.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/ModelEditingDelegate.h>
#include <LibGUI/Splitter.h>
#include <LibGUI/TableView.h>
#include <LibGUI/TreeView.h>
@ -77,6 +78,10 @@ int main(int argc, char** argv)
auto& properties_table_view = splitter.add<GUI::TableView>();
properties_table_view.set_size_columns_to_fit_content(true);
properties_table_view.set_editable(true);
properties_table_view.aid_create_editing_delegate = [](auto&) {
return make<GUI::StringModelEditingDelegate>();
};
tree_view.on_activation = [&](auto& index) {
auto* remote_object = static_cast<RemoteObject*>(index.internal_data());