summaryrefslogtreecommitdiff
path: root/Applications/Spreadsheet/SpreadsheetView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Applications/Spreadsheet/SpreadsheetView.cpp')
-rw-r--r--Applications/Spreadsheet/SpreadsheetView.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Applications/Spreadsheet/SpreadsheetView.cpp b/Applications/Spreadsheet/SpreadsheetView.cpp
index 7361258cc0..2148b9281f 100644
--- a/Applications/Spreadsheet/SpreadsheetView.cpp
+++ b/Applications/Spreadsheet/SpreadsheetView.cpp
@@ -62,10 +62,15 @@ void InfinitelyScrollableTableView::did_scroll()
{
TableView::did_scroll();
auto& vscrollbar = vertical_scrollbar();
+ auto& hscrollbar = horizontal_scrollbar();
if (vscrollbar.is_visible() && vscrollbar.value() == vscrollbar.max()) {
if (on_reaching_vertical_end)
on_reaching_vertical_end();
}
+ if (hscrollbar.is_visible() && hscrollbar.value() == hscrollbar.max()) {
+ if (on_reaching_horizontal_end)
+ on_reaching_horizontal_end();
+ }
}
void SpreadsheetView::update_with_model()
@@ -92,6 +97,15 @@ SpreadsheetView::SpreadsheetView(Sheet& sheet)
};
update_with_model();
};
+ m_table_view->on_reaching_horizontal_end = [&]() {
+ for (size_t i = 0; i < 10; ++i) {
+ m_sheet->add_column();
+ auto last_column_index = m_sheet->column_count() - 1;
+ m_table_view->set_column_width(last_column_index, 50);
+ m_table_view->set_column_header_alignment(last_column_index, Gfx::TextAlignment::Center);
+ }
+ update_with_model();
+ };
set_focus_proxy(m_table_view);