mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 09:18:52 +00:00
GJsonArrayModel: Support fields that aren't tied to a single JSON value
Change the custom data massaging callback to take a const JsonObject&. This will allow binding together data from multiple fields into one output in the model. :^)
This commit is contained in:
parent
a4548a150f
commit
afd25679bc
Notes:
sideshowbarker
2024-07-19 12:46:16 +09:00
Author: https://github.com/awesomekling
Commit: afd25679bc
3 changed files with 13 additions and 6 deletions
|
@ -16,8 +16,8 @@ ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget(GWidget* parent)
|
|||
pid_fds_fields.empend("class", "Class", TextAlignment::CenterLeft);
|
||||
pid_fds_fields.empend("offset", "Offset", TextAlignment::CenterRight);
|
||||
pid_fds_fields.empend("absolute_path", "Path", TextAlignment::CenterLeft);
|
||||
pid_fds_fields.empend("seekable", "Access", TextAlignment::CenterLeft, [](auto& data) {
|
||||
return data.to_bool() ? "Seekable" : "Sequential";
|
||||
pid_fds_fields.empend("Access", TextAlignment::CenterLeft, [](auto& object) {
|
||||
return object.get("seekable").to_bool() ? "Seekable" : "Sequential";
|
||||
});
|
||||
|
||||
m_table_view->set_model(GJsonArrayModel::create({}, move(pid_fds_fields)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue