1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:37:35 +00:00

LibGUI: Teach ColumnsView where indexes are placed (and scroll to them)

This makes the view to scroll when pressing arrow keys! :^)
This commit is contained in:
Karol Kosek 2022-12-28 00:36:34 +01:00 committed by Andreas Kling
parent 7e52daa542
commit 35e3df7f13
2 changed files with 22 additions and 0 deletions

View file

@ -22,6 +22,8 @@ public:
virtual Gfx::IntRect content_rect(ModelIndex const&) const override;
virtual Gfx::IntRect paint_invalidation_rect(ModelIndex const&) const override;
virtual void scroll_into_view(ModelIndex const&, bool scroll_horizontally, bool scroll_vertically) override;
private:
ColumnsView();
virtual ~ColumnsView() override = default;
@ -54,6 +56,7 @@ private:
Optional<Column> column_at_event_position(Gfx::IntPoint) const;
ModelIndex index_at_event_position_in_column(Gfx::IntPoint, Column const&) const;
Gfx::IntRect index_content_rect(ModelIndex const&);
bool m_rubber_banding { false };
int m_rubber_band_origin { 0 };