File indexing completed on 2024-04-28 15:39:43

0001 // SPDX-FileCopyrightText: 2014-2022 Jesper K. Pedersen <blackie@kde.org>
0002 //
0003 // SPDX-License-Identifier: GPL-2.0-or-later
0004 
0005 #ifndef REMOTECONTROL_SETTINGS_H
0006 #define REMOTECONTROL_SETTINGS_H
0007 
0008 #include <QColor>
0009 #include <QObject>
0010 
0011 namespace RemoteControl
0012 {
0013 
0014 class Settings : public QObject
0015 {
0016     Q_OBJECT
0017     Q_PROPERTY(int thumbnailSize READ thumbnailSize WRITE setThumbnailSize NOTIFY thumbnailSizeChanged)
0018     Q_PROPERTY(int categoryItemSize READ categoryItemSize WRITE setCategoryItemSize NOTIFY categoryItemSizeChanged)
0019     Q_PROPERTY(double overviewIconSize READ overviewIconSize WRITE setOverviewIconSize NOTIFY overviewIconSizeChanged)
0020     Q_PROPERTY(QColor backgroundColor READ backgroundColor NOTIFY backgroundColorChanged)
0021     Q_PROPERTY(QColor textColor READ textColor NOTIFY foregroundColorChanged)
0022 
0023     double m_thumbnailScale;
0024 
0025 public:
0026     static Settings &instance();
0027     int thumbnailSize() const;
0028     void setThumbnailSize(int size);
0029     int categoryItemSize() const;
0030     double overviewIconSize() const;
0031 
0032     QColor backgroundColor() const;
0033 
0034     QColor textColor() const;
0035 
0036 public Q_SLOTS:
0037     void setCategoryItemSize(int size);
0038     void setOverviewIconSize(double size);
0039 
0040 Q_SIGNALS:
0041     void thumbnailSizeChanged();
0042     void categoryItemSizeChanged();
0043     void overviewIconSizeChanged();
0044     void backgroundColorChanged();
0045     void foregroundColorChanged();
0046 
0047 private:
0048     explicit Settings() = default;
0049     int m_categoryItemSize;
0050 };
0051 
0052 } // namespace RemoteControl
0053 
0054 #endif // REMOTECONTROL_SETTINGS_H