summary refs log tree commit diff
path: root/src/timeline/DelegateChooser.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-04-09 00:07:04 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-04-10 08:48:30 +0200
commitd68b24188fd453bd8ca09e3035edc4faee74c6af (patch)
tree8ef4b507d59a59225b7d1573dc469516e952412e /src/timeline/DelegateChooser.h
parentMake Filemessage background size by content (diff)
downloadnheko-d68b24188fd453bd8ca09e3035edc4faee74c6af.tar.xz
Size reply background by contents
Diffstat (limited to 'src/timeline/DelegateChooser.h')
-rw-r--r--src/timeline/DelegateChooser.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/timeline/DelegateChooser.h b/src/timeline/DelegateChooser.h

index 68ebeb04..2524b068 100644 --- a/src/timeline/DelegateChooser.h +++ b/src/timeline/DelegateChooser.h
@@ -45,18 +45,22 @@ class DelegateChooser : public QQuickItem public: Q_PROPERTY(QQmlListProperty<DelegateChoice> choices READ choices CONSTANT) Q_PROPERTY(QVariant roleValue READ roleValue WRITE setRoleValue NOTIFY roleValueChanged) + Q_PROPERTY(QQuickItem *child READ child NOTIFY childChanged) QQmlListProperty<DelegateChoice> choices(); QVariant roleValue() const; void setRoleValue(const QVariant &value); + QQuickItem *child() const { return child_; } + void recalcChild(); void componentComplete() override; signals: void roleChanged(); void roleValueChanged(); + void childChanged(); private: struct DelegateIncubator : public QQmlIncubator @@ -72,7 +76,7 @@ private: QVariant roleValue_; QList<DelegateChoice *> choices_; - QQuickItem *child = nullptr; + QQuickItem *child_ = nullptr; DelegateIncubator incubator{*this}; static void appendChoice(QQmlListProperty<DelegateChoice> *, DelegateChoice *);