mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +00:00
LibGUI: Allow specifying per-column text alignment.
This commit is contained in:
parent
ce7019f38c
commit
b4c20789fb
6 changed files with 35 additions and 23 deletions
|
@ -5,18 +5,24 @@
|
|||
#include <AK/Function.h>
|
||||
#include <AK/HashTable.h>
|
||||
#include <LibGUI/GModelIndex.h>
|
||||
#include <SharedGraphics/TextAlignment.h>
|
||||
|
||||
class GTableView;
|
||||
|
||||
class GTableModel {
|
||||
public:
|
||||
struct ColumnMetadata {
|
||||
int preferred_width { 0 };
|
||||
TextAlignment text_alignment { TextAlignment::CenterLeft };
|
||||
};
|
||||
|
||||
virtual ~GTableModel();
|
||||
|
||||
virtual int row_count() const = 0;
|
||||
virtual int column_count() const = 0;
|
||||
virtual String row_name(int) const { return { }; }
|
||||
virtual String column_name(int) const { return { }; }
|
||||
virtual int column_width(int) const { return 0; }
|
||||
virtual ColumnMetadata column_metadata(int) const { return { }; }
|
||||
virtual String data(int row, int column) const = 0;
|
||||
virtual void set_selected_index(GModelIndex) { }
|
||||
virtual GModelIndex selected_index() const { return GModelIndex(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue