QmlMaterial 0.1.0
Loading...
Searching...
No Matches
tab_button.hpp
1#pragma once
2#include "qml_material/control/radio_button.hpp"
3
4namespace qml_material
5{
6class QML_MATERIAL_API TabButton : public RadioButton {
7 Q_OBJECT
8 QML_NAMED_ELEMENT(TabButtonBase)
9 Q_PROPERTY(bool fillWidth READ fillWidth WRITE setFillWidth NOTIFY fillWidthChanged FINAL)
10 Q_PROPERTY(bool fillHeight READ fillHeight WRITE setFillHeight NOTIFY fillHeightChanged FINAL)
11public:
12 explicit TabButton(QQuickItem* parent = nullptr): RadioButton(parent) {}
13 bool fillWidth() const { return m_fill_width; }
14 bool fillHeight() const { return m_fill_height; }
15 void setFillWidth(bool value) {
16 if (m_fill_width == value) return;
17 m_fill_width = value;
18 Q_EMIT fillWidthChanged();
19 }
20 void setFillHeight(bool value) {
21 if (m_fill_height == value) return;
22 m_fill_height = value;
23 Q_EMIT fillHeightChanged();
24 }
25 Q_SIGNAL void fillWidthChanged();
26 Q_SIGNAL void fillHeightChanged();
27
28private:
29 bool m_fill_width = true;
30 bool m_fill_height = true;
31};
32} // namespace qml_material