mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
VisualBuilder: Add a table view with the selected widget's properties.
This commit is contained in:
parent
c57cf9834b
commit
707bfe848d
11 changed files with 113 additions and 6 deletions
30
Applications/VisualBuilder/VBWidgetPropertyModel.h
Normal file
30
Applications/VisualBuilder/VBWidgetPropertyModel.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GModel.h>
|
||||
|
||||
class VBWidget;
|
||||
class VBProperty;
|
||||
|
||||
class VBWidgetPropertyModel : public GModel {
|
||||
public:
|
||||
enum Column {
|
||||
Name = 0,
|
||||
Value,
|
||||
__Count
|
||||
};
|
||||
|
||||
static Retained<VBWidgetPropertyModel> create(VBWidget& widget) { return adopt(*new VBWidgetPropertyModel(widget)); }
|
||||
virtual ~VBWidgetPropertyModel() override;
|
||||
|
||||
virtual int row_count(const GModelIndex&) const override;
|
||||
virtual int column_count(const GModelIndex&) const override { return Column::__Count; }
|
||||
virtual String column_name(int column) const override;
|
||||
virtual ColumnMetadata column_metadata(int column) const override;
|
||||
virtual GVariant data(const GModelIndex&, Role = Role::Display) const override;
|
||||
virtual void update() override { }
|
||||
|
||||
private:
|
||||
explicit VBWidgetPropertyModel(VBWidget&);
|
||||
|
||||
VBWidget& m_widget;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue