QmlMaterial 0.1.0
Loading...
Searching...
No Matches
rail_item_state.hpp
1#pragma once
2#include "qml_material/style/button_interaction_state.hpp"
3Q_MOC_INCLUDE("qml_material/control/selection_button.hpp")
4namespace qml_material
5{
6class SelectionButton;
7class QML_MATERIAL_API RailItemState : public ButtonInteractionState {
8 Q_OBJECT
9 QML_NAMED_ELEMENT(StateRailItem)
10 Q_PROPERTY(qml_material::SelectionButton* item READ item WRITE setItem NOTIFY itemChanged FINAL)
11 Q_PROPERTY(QColor collapsedLabelColor READ collapsedLabelColor NOTIFY collapsedLabelColorChanged
12 BINDABLE bindableCollapsedLabelColor FINAL)
13 Q_PROPERTY(QColor expandedLabelColor READ expandedLabelColor NOTIFY expandedLabelColorChanged
14 BINDABLE bindableExpandedLabelColor FINAL)
15 Q_PROPERTY(QColor selectedIndicatorColor READ selectedIndicatorColor NOTIFY
16 selectedIndicatorColorChanged BINDABLE bindableSelectedIndicatorColor FINAL)
17public:
18 explicit RailItemState(QObject* parent = nullptr);
19 SelectionButton* item() const;
20 void setItem(SelectionButton*);
21 QColor collapsedLabelColor() const;
22 QColor expandedLabelColor() const;
23 QBindable<QColor> bindableCollapsedLabelColor() const;
24 QBindable<QColor> bindableExpandedLabelColor() const;
25 QColor selectedIndicatorColor() const;
26 QBindable<QColor> bindableSelectedIndicatorColor() const;
27 Q_SIGNAL void collapsedLabelColorChanged();
28 Q_SIGNAL void expandedLabelColorChanged();
29 Q_SIGNAL void selectedIndicatorColorChanged();
30
31private:
32 Q_OBJECT_BINDABLE_PROPERTY(RailItemState, QColor, m_collapsedLabelColor,
33 &RailItemState::collapsedLabelColorChanged)
34 Q_OBJECT_BINDABLE_PROPERTY(RailItemState, QColor, m_expandedLabelColor,
35 &RailItemState::expandedLabelColorChanged)
36 Q_OBJECT_BINDABLE_PROPERTY(RailItemState, QColor, m_selectedIndicatorColor,
37 &RailItemState::selectedIndicatorColorChanged)
38 BindingLifetime m_bindingLifetime { bindingSet().lifetime() };
39};
40} // namespace qml_material