mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 06:02:07 +03:00
6a0011dcea
Implemented this by letting GAbstractViews provide a GModelEditingDelegate for a given index, which then knows how to create and setup a custom widget appropriate for the data type being edited.
34 lines
1.0 KiB
C++
34 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <LibGUI/GModel.h>
|
|
|
|
class VBWidget;
|
|
class VBProperty;
|
|
|
|
class VBWidgetPropertyModel : public GModel {
|
|
public:
|
|
enum Column {
|
|
Name = 0,
|
|
Value,
|
|
Type,
|
|
__Count
|
|
};
|
|
|
|
static NonnullRefPtr<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 { did_update(); }
|
|
virtual bool is_editable(const GModelIndex&) const override;
|
|
virtual void set_data(const GModelIndex&, const GVariant&) override;
|
|
|
|
private:
|
|
explicit VBWidgetPropertyModel(VBWidget&);
|
|
|
|
VBWidget& m_widget;
|
|
};
|