Changeset View
Changeset View
Standalone View
Standalone View
src/swipeaction.h
- This file was added.
1 | #pragma once | ||||
---|---|---|---|---|---|
2 | | ||||
3 | #include <QColor> | ||||
4 | #include <QObject> | ||||
5 | #include <QQmlEngine> | ||||
6 | | ||||
7 | class SwipeAction : public QObject | ||||
8 | { | ||||
9 | Q_OBJECT | ||||
10 | /** | ||||
11 | * backgroundColor: QColor | ||||
12 | * | ||||
13 | * If set, this color is used by the action's radial fill to indicate | ||||
14 | * when it will trigger on release. | ||||
15 | */ | ||||
16 | Q_PROPERTY(QColor backgroundColor MEMBER m_backgroundColor NOTIFY backgroundColorChanged) | ||||
17 | | ||||
18 | /** | ||||
19 | * foregroundColor: QColor | ||||
20 | * | ||||
21 | * If set, this color is used by the action's text to indicate | ||||
22 | * when it will trigger on release. | ||||
23 | */ | ||||
24 | Q_PROPERTY(QColor foregroundColor MEMBER m_foregroundColor NOTIFY foregroundColorChanged) | ||||
25 | | ||||
26 | /** | ||||
27 | * isDelete: bool | ||||
28 | * | ||||
29 | * If set to true, this action will collapse on trigger. | ||||
30 | */ | ||||
31 | Q_PROPERTY(bool isDelete MEMBER m_isDelete NOTIFY isDeleteChanged) | ||||
32 | | ||||
33 | public: | ||||
34 | explicit SwipeAction(QObject *parent = nullptr); | ||||
35 | static SwipeAction *qmlAttachedProperties(QObject *object); | ||||
36 | | ||||
37 | private: | ||||
38 | QColor m_backgroundColor; | ||||
39 | QColor m_foregroundColor; | ||||
40 | bool m_isDelete; | ||||
41 | | ||||
42 | Q_SIGNALS: | ||||
43 | void backgroundColorChanged(); | ||||
44 | void foregroundColorChanged(); | ||||
45 | void isDeleteChanged(); | ||||
46 | }; | ||||
47 | | ||||
48 | QML_DECLARE_TYPEINFO(SwipeAction, QML_HAS_ATTACHED_PROPERTIES) |