UI: Add setter function for grid view item tile size

No user visible change expected.

Needed in #104831 (not worth polluting the PR with such minor changes,
so committing this to main already).
This commit is contained in:
Julian Eisel
2023-06-13 18:16:30 +02:00
parent ff44e376ce
commit 256146a454
2 changed files with 8 additions and 0 deletions

View File

@@ -131,6 +131,8 @@ class AbstractGridView : public AbstractView {
int get_item_count() const;
int get_item_count_filtered() const;
void set_tile_size(int tile_width, int tile_height);
protected:
virtual void build_items() = 0;

View File

@@ -109,6 +109,12 @@ int AbstractGridView::get_item_count_filtered() const
return i;
}
void AbstractGridView::set_tile_size(int tile_width, int tile_height)
{
style_.tile_width = tile_width;
style_.tile_height = tile_height;
}
GridViewStyle::GridViewStyle(int width, int height) : tile_width(width), tile_height(height) {}
/* ---------------------------------------------------------------------- */