summaryrefslogtreecommitdiff
path: root/LibGUI/GTableModel.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-28 11:27:04 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-28 11:27:04 +0100
commitb4c20789fb82639b5bc679cc17af90a65f721aeb (patch)
tree76f6e0d59c82ada4fb49473cb556a6ffbe12ad25 /LibGUI/GTableModel.h
parentce7019f38c8ad5f4adfe9ea0baa5cdf3ecb5e8e7 (diff)
downloadserenity-b4c20789fb82639b5bc679cc17af90a65f721aeb.zip
LibGUI: Allow specifying per-column text alignment.
Diffstat (limited to 'LibGUI/GTableModel.h')
-rw-r--r--LibGUI/GTableModel.h8
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(); }