mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:57:35 +00:00
LibGUI: Add GAbstractView base class for GTableView.
This is in preparation for adding a new view class.
This commit is contained in:
parent
994cf10b3e
commit
5707d7f547
7 changed files with 100 additions and 64 deletions
|
@ -9,7 +9,7 @@
|
|||
#include <SharedGraphics/TextAlignment.h>
|
||||
|
||||
class Font;
|
||||
class GTableView;
|
||||
class GAbstractView;
|
||||
|
||||
enum class GSortOrder { None, Ascending, Descending };
|
||||
|
||||
|
@ -70,8 +70,8 @@ public:
|
|||
virtual GSortOrder sort_order() const { return GSortOrder::None; }
|
||||
virtual void set_key_column_and_sort_order(int, GSortOrder) { }
|
||||
|
||||
void register_view(Badge<GTableView>, GTableView&);
|
||||
void unregister_view(Badge<GTableView>, GTableView&);
|
||||
void register_view(Badge<GAbstractView>, GAbstractView&);
|
||||
void unregister_view(Badge<GAbstractView>, GAbstractView&);
|
||||
|
||||
Function<void(GModel&)> on_model_update;
|
||||
Function<void(const GModelIndex&)> on_selection_changed;
|
||||
|
@ -79,11 +79,11 @@ public:
|
|||
protected:
|
||||
GModel();
|
||||
|
||||
void for_each_view(Function<void(GTableView&)>);
|
||||
void for_each_view(Function<void(GAbstractView&)>);
|
||||
void did_update();
|
||||
|
||||
private:
|
||||
HashTable<GTableView*> m_views;
|
||||
HashTable<GAbstractView*> m_views;
|
||||
GModelIndex m_selected_index;
|
||||
bool m_activates_on_selection { false };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue