mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibGUI: Take ProcessManager's process view and turn it into GTableView.
Make it sufficiently generic that it can be reused for any table data. :^)
This commit is contained in:
parent
b3ae1163ef
commit
dc9f8a9361
Notes:
sideshowbarker
2024-07-19 15:36:16 +09:00
Author: https://github.com/awesomekling
Commit: dc9f8a9361
11 changed files with 173 additions and 88 deletions
33
LibGUI/GTableModel.cpp
Normal file
33
LibGUI/GTableModel.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#include <LibGUI/GTableModel.h>
|
||||
#include <LibGUI/GTableView.h>
|
||||
|
||||
GTableModel::GTableModel()
|
||||
{
|
||||
}
|
||||
|
||||
GTableModel::~GTableModel()
|
||||
{
|
||||
}
|
||||
|
||||
void GTableModel::register_view(Badge<GTableView>, GTableView& view)
|
||||
{
|
||||
m_views.set(&view);
|
||||
}
|
||||
|
||||
void GTableModel::unregister_view(Badge<GTableView>, GTableView& view)
|
||||
{
|
||||
m_views.remove(&view);
|
||||
}
|
||||
|
||||
void GTableModel::for_each_view(Function<void(GTableView&)> callback)
|
||||
{
|
||||
for (auto* view : m_views)
|
||||
callback(*view);
|
||||
}
|
||||
|
||||
void GTableModel::did_update()
|
||||
{
|
||||
for_each_view([] (GTableView& view) {
|
||||
view.did_update_model();
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue