diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-02-28 11:27:04 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-02-28 11:27:04 +0100 |
commit | b4c20789fb82639b5bc679cc17af90a65f721aeb (patch) | |
tree | 76f6e0d59c82ada4fb49473cb556a6ffbe12ad25 /LibGUI/GTableModel.h | |
parent | ce7019f38c8ad5f4adfe9ea0baa5cdf3ecb5e8e7 (diff) | |
download | serenity-b4c20789fb82639b5bc679cc17af90a65f721aeb.zip |
LibGUI: Allow specifying per-column text alignment.
Diffstat (limited to 'LibGUI/GTableModel.h')
-rw-r--r-- | LibGUI/GTableModel.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/LibGUI/GTableModel.h b/LibGUI/GTableModel.h index c1548718da..7a5d71e815 100644 --- a/LibGUI/GTableModel.h +++ b/LibGUI/GTableModel.h @@ -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(); } |