mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +00:00
LibGUI: Rename table view's "cell painting delegate" to "column *"
What you install with this API is a delegate that manages painting of all the items in a specific column, so let's make the API reflect that.
This commit is contained in:
parent
44e371635e
commit
cfc30b11ba
5 changed files with 5 additions and 5 deletions
|
@ -62,7 +62,7 @@ SpreadsheetView::SpreadsheetView(Sheet& sheet)
|
||||||
|
|
||||||
// FIXME: This is dumb.
|
// FIXME: This is dumb.
|
||||||
for (size_t i = 0; i < m_sheet->column_count(); ++i) {
|
for (size_t i = 0; i < m_sheet->column_count(); ++i) {
|
||||||
m_table_view->set_cell_painting_delegate(i + 1, make<TableCellPainter>(*m_table_view));
|
m_table_view->set_column_painting_delegate(i + 1, make<TableCellPainter>(*m_table_view));
|
||||||
m_table_view->set_column_width(i + 1, 50);
|
m_table_view->set_column_width(i + 1, 50);
|
||||||
m_table_view->set_column_header_alignment(i + 1, Gfx::TextAlignment::Center);
|
m_table_view->set_column_header_alignment(i + 1, Gfx::TextAlignment::Center);
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ ProcessMemoryMapWidget::ProcessMemoryMapWidget()
|
||||||
m_json_model = GUI::JsonArrayModel::create({}, move(pid_vm_fields));
|
m_json_model = GUI::JsonArrayModel::create({}, move(pid_vm_fields));
|
||||||
m_table_view->set_model(GUI::SortingProxyModel::create(*m_json_model));
|
m_table_view->set_model(GUI::SortingProxyModel::create(*m_json_model));
|
||||||
|
|
||||||
m_table_view->set_cell_painting_delegate(7, make<PagemapPaintingDelegate>());
|
m_table_view->set_column_painting_delegate(7, make<PagemapPaintingDelegate>());
|
||||||
|
|
||||||
m_table_view->set_key_column_and_sort_order(0, GUI::SortOrder::Ascending);
|
m_table_view->set_key_column_and_sort_order(0, GUI::SortOrder::Ascending);
|
||||||
m_timer = add<Core::Timer>(1000, [this] { refresh(); });
|
m_timer = add<Core::Timer>(1000, [this] { refresh(); });
|
||||||
|
|
|
@ -443,7 +443,7 @@ NonnullRefPtr<GUI::Widget> build_file_systems_tab()
|
||||||
df_fields.empend("block_size", "Block size", Gfx::TextAlignment::CenterRight);
|
df_fields.empend("block_size", "Block size", Gfx::TextAlignment::CenterRight);
|
||||||
fs_table_view.set_model(GUI::SortingProxyModel::create(GUI::JsonArrayModel::create("/proc/df", move(df_fields))));
|
fs_table_view.set_model(GUI::SortingProxyModel::create(GUI::JsonArrayModel::create("/proc/df", move(df_fields))));
|
||||||
|
|
||||||
fs_table_view.set_cell_painting_delegate(3, make<ProgressBarPaintingDelegate>());
|
fs_table_view.set_column_painting_delegate(3, make<ProgressBarPaintingDelegate>());
|
||||||
|
|
||||||
fs_table_view.model()->update();
|
fs_table_view.model()->update();
|
||||||
};
|
};
|
||||||
|
|
|
@ -115,7 +115,7 @@ TableCellPaintingDelegate* AbstractTableView::column_painting_delegate(int colum
|
||||||
return const_cast<TableCellPaintingDelegate*>(m_column_painting_delegate.get(column).value_or(nullptr));
|
return const_cast<TableCellPaintingDelegate*>(m_column_painting_delegate.get(column).value_or(nullptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractTableView::set_cell_painting_delegate(int column, OwnPtr<TableCellPaintingDelegate> delegate)
|
void AbstractTableView::set_column_painting_delegate(int column, OwnPtr<TableCellPaintingDelegate> delegate)
|
||||||
{
|
{
|
||||||
if (!delegate)
|
if (!delegate)
|
||||||
m_column_painting_delegate.remove(column);
|
m_column_painting_delegate.remove(column);
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
Gfx::TextAlignment column_header_alignment(int column) const;
|
Gfx::TextAlignment column_header_alignment(int column) const;
|
||||||
void set_column_header_alignment(int column, Gfx::TextAlignment);
|
void set_column_header_alignment(int column, Gfx::TextAlignment);
|
||||||
|
|
||||||
void set_cell_painting_delegate(int column, OwnPtr<TableCellPaintingDelegate>);
|
void set_column_painting_delegate(int column, OwnPtr<TableCellPaintingDelegate>);
|
||||||
|
|
||||||
int horizontal_padding() const { return m_horizontal_padding; }
|
int horizontal_padding() const { return m_horizontal_padding; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue