mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
GAbstractView: Add function for adding all to selection
This commit is contained in:
parent
00596296c4
commit
7cf15bcb75
Notes:
sideshowbarker
2024-07-19 10:17:49 +09:00
Author: https://github.com/shannonbooth
Commit: 7cf15bcb75
Pull-request: https://github.com/SerenityOS/serenity/pull/1033
2 changed files with 13 additions and 0 deletions
|
@ -95,6 +95,18 @@ void GAbstractView::stop_editing()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GAbstractView::select_all()
|
||||||
|
{
|
||||||
|
ASSERT(model());
|
||||||
|
int rows = model()->row_count();
|
||||||
|
int columns = model()->column_count();
|
||||||
|
|
||||||
|
for (int i = 0; i < rows; ++i) {
|
||||||
|
for (int j = 0; j < columns; ++j)
|
||||||
|
selection().add(model()->index(i, j));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GAbstractView::activate(const GModelIndex& index)
|
void GAbstractView::activate(const GModelIndex& index)
|
||||||
{
|
{
|
||||||
if (on_activation)
|
if (on_activation)
|
||||||
|
|
|
@ -18,6 +18,7 @@ public:
|
||||||
|
|
||||||
GModelSelection& selection() { return m_selection; }
|
GModelSelection& selection() { return m_selection; }
|
||||||
const GModelSelection& selection() const { return m_selection; }
|
const GModelSelection& selection() const { return m_selection; }
|
||||||
|
void select_all();
|
||||||
|
|
||||||
bool is_editable() const { return m_editable; }
|
bool is_editable() const { return m_editable; }
|
||||||
void set_editable(bool editable) { m_editable = editable; }
|
void set_editable(bool editable) { m_editable = editable; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue