Changeset View
Changeset View
Standalone View
Standalone View
kcms/colors/colorsmodel.h
Show All 27 Lines | |||||
28 | #include <QPalette> | 28 | #include <QPalette> | ||
29 | #include <QVector> | 29 | #include <QVector> | ||
30 | 30 | | |||
31 | struct ColorsModelData | 31 | struct ColorsModelData | ||
32 | { | 32 | { | ||
33 | QString display; | 33 | QString display; | ||
34 | QString schemeName; | 34 | QString schemeName; | ||
35 | QPalette palette; | 35 | QPalette palette; | ||
36 | QColor activeTitleBarBackground; | ||||
37 | QColor activeTitleBarForeground; | ||||
36 | bool removable; | 38 | bool removable; | ||
37 | bool pendingDeletion; | 39 | bool pendingDeletion; | ||
38 | }; | 40 | }; | ||
39 | Q_DECLARE_TYPEINFO(ColorsModelData, Q_MOVABLE_TYPE); | 41 | Q_DECLARE_TYPEINFO(ColorsModelData, Q_MOVABLE_TYPE); | ||
40 | 42 | | |||
41 | class ColorsModel : public QAbstractListModel | 43 | class ColorsModel : public QAbstractListModel | ||
42 | { | 44 | { | ||
43 | Q_OBJECT | 45 | Q_OBJECT | ||
44 | 46 | | |||
45 | Q_PROPERTY(QString selectedScheme READ selectedScheme WRITE setSelectedScheme NOTIFY selectedSchemeChanged) | 47 | Q_PROPERTY(QString selectedScheme READ selectedScheme WRITE setSelectedScheme NOTIFY selectedSchemeChanged) | ||
46 | Q_PROPERTY(int selectedSchemeIndex READ selectedSchemeIndex NOTIFY selectedSchemeIndexChanged) | 48 | Q_PROPERTY(int selectedSchemeIndex READ selectedSchemeIndex NOTIFY selectedSchemeIndexChanged) | ||
47 | 49 | | |||
48 | public: | 50 | public: | ||
49 | ColorsModel(QObject *parent); | 51 | ColorsModel(QObject *parent); | ||
50 | ~ColorsModel() override; | 52 | ~ColorsModel() override; | ||
51 | 53 | | |||
52 | enum Roles { | 54 | enum Roles { | ||
53 | SchemeNameRole = Qt::UserRole + 1, | 55 | SchemeNameRole = Qt::UserRole + 1, | ||
54 | PaletteRole, | 56 | PaletteRole, | ||
57 | // Colors which aren't in QPalette | ||||
58 | ActiveTitleBarBackgroundRole, | ||||
59 | ActiveTitleBarForegroundRole, | ||||
55 | RemovableRole, | 60 | RemovableRole, | ||
56 | PendingDeletionRole | 61 | PendingDeletionRole | ||
57 | }; | 62 | }; | ||
58 | 63 | | |||
59 | int rowCount(const QModelIndex &parent) const override; | 64 | int rowCount(const QModelIndex &parent) const override; | ||
60 | QVariant data(const QModelIndex &index, int role) const override; | 65 | QVariant data(const QModelIndex &index, int role) const override; | ||
61 | bool setData(const QModelIndex &index, const QVariant &value, int role) override; | 66 | bool setData(const QModelIndex &index, const QVariant &value, int role) override; | ||
62 | QHash<int, QByteArray> roleNames() const override; | 67 | QHash<int, QByteArray> roleNames() const override; | ||
Show All 24 Lines |