1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibGUI: Start working on GTableView inline editing.

This is pretty shaky still, but the basic idea is that you subclass GModel
and return true for editable indices. The table view also needs to have its
editable flag set.
This commit is contained in:
Andreas Kling 2019-04-18 22:27:14 +02:00
parent 9ef06e2117
commit 0e6b273620
9 changed files with 95 additions and 6 deletions

View file

@ -30,6 +30,9 @@ public:
bool is_column_hidden(int) const;
void set_column_hidden(int, bool);
void begin_editing(const GModelIndex&);
void stop_editing();
virtual const char* class_name() const override { return "GTableView"; }
private:
@ -45,6 +48,8 @@ private:
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 };