mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 18:15:07 +00:00
LibGUI: Move editing logic from GTableView up to GAbstractView.
GAbstractView should be able to manage the high-level editing logic, as long as subclasses implement content_rect(GModelIndex) so we know where to put the editing widgets. :^)
This commit is contained in:
parent
9cab7a0707
commit
18785ba5c3
5 changed files with 46 additions and 39 deletions
|
@ -30,8 +30,7 @@ public:
|
|||
bool is_column_hidden(int) const;
|
||||
void set_column_hidden(int, bool);
|
||||
|
||||
void begin_editing(const GModelIndex&);
|
||||
void stop_editing();
|
||||
virtual Rect content_rect(const GModelIndex&) const override;
|
||||
|
||||
virtual const char* class_name() const override { return "GTableView"; }
|
||||
|
||||
|
@ -42,14 +41,13 @@ private:
|
|||
virtual void doubleclick_event(GMouseEvent&) override;
|
||||
virtual void keydown_event(GKeyEvent&) override;
|
||||
|
||||
Rect content_rect(int row, int column) const;
|
||||
void paint_headers(Painter&);
|
||||
int item_count() const;
|
||||
Rect row_rect(int item_index) const;
|
||||
Rect header_rect(int) const;
|
||||
int column_width(int) const;
|
||||
void update_content_size();
|
||||
Rect cell_content_rect(const GModelIndex&) const;
|
||||
Rect cell_content_rect(int row, int column) const;
|
||||
|
||||
Vector<bool> m_column_visibility;
|
||||
int m_horizontal_padding { 5 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue