Changeset View
Changeset View
Standalone View
Standalone View
kcms/workspaceoptions/workspaceoptions.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2018 <furkantokac34@gmail.com> | 2 | * Copyright (C) 2018 <furkantokac34@gmail.com> | ||
3 | * Copyright (C) 2019 Nate Graham <nate@kde.org> | ||||
3 | * | 4 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | 8 | * (at your option) any later version. | ||
8 | * | 9 | * | ||
9 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
Show All 11 Lines | |||||
22 | 23 | | |||
23 | class KCMWorkspaceOptions : public KQuickAddons::ConfigModule | 24 | class KCMWorkspaceOptions : public KQuickAddons::ConfigModule | ||
24 | { | 25 | { | ||
25 | Q_OBJECT | 26 | Q_OBJECT | ||
26 | Q_PROPERTY(bool toolTip READ getToolTip WRITE setToolTip NOTIFY toolTipChanged) | 27 | Q_PROPERTY(bool toolTip READ getToolTip WRITE setToolTip NOTIFY toolTipChanged) | ||
27 | Q_PROPERTY(bool visualFeedback READ getVisualFeedback WRITE setVisualFeedback NOTIFY visualFeedbackChanged) | 28 | Q_PROPERTY(bool visualFeedback READ getVisualFeedback WRITE setVisualFeedback NOTIFY visualFeedbackChanged) | ||
28 | Q_PROPERTY(bool singleClick READ getSingleClick WRITE setSingleClick NOTIFY singleClickChanged) | 29 | Q_PROPERTY(bool singleClick READ getSingleClick WRITE setSingleClick NOTIFY singleClickChanged) | ||
29 | Q_PROPERTY(qreal animationDurationFactor READ getAnimationDurationFactor WRITE setAnimationDurationFactor NOTIFY animationDurationFactorChanged) | 30 | Q_PROPERTY(qreal animationDurationFactor READ getAnimationDurationFactor WRITE setAnimationDurationFactor NOTIFY animationDurationFactorChanged) | ||
31 | Q_PROPERTY(bool leftClickNavigatesByPage READ getLeftClickNavigatesByPage WRITE setLeftClickNavigatesByPage NOTIFY leftClickNavigatesByPageChanged) | ||||
30 | 32 | | |||
31 | public: | 33 | public: | ||
32 | KCMWorkspaceOptions(QObject* parent, const QVariantList& args); | 34 | KCMWorkspaceOptions(QObject* parent, const QVariantList& args); | ||
33 | ~KCMWorkspaceOptions() override {} | 35 | ~KCMWorkspaceOptions() override {} | ||
34 | 36 | | |||
35 | // QML Properties | 37 | // QML Properties | ||
36 | bool getToolTip() const; | 38 | bool getToolTip() const; | ||
37 | void setToolTip(bool state); | 39 | void setToolTip(bool state); | ||
38 | 40 | | |||
39 | bool getVisualFeedback() const; | 41 | bool getVisualFeedback() const; | ||
40 | void setVisualFeedback(bool state); | 42 | void setVisualFeedback(bool state); | ||
41 | 43 | | |||
42 | bool getSingleClick() const; | 44 | bool getSingleClick() const; | ||
43 | void setSingleClick(bool state); | 45 | void setSingleClick(bool state); | ||
44 | 46 | | |||
45 | qreal getAnimationDurationFactor() const; | 47 | qreal getAnimationDurationFactor() const; | ||
46 | void setAnimationDurationFactor(qreal speed); | 48 | void setAnimationDurationFactor(qreal speed); | ||
47 | 49 | | |||
50 | bool getLeftClickNavigatesByPage() const; | ||||
51 | void setLeftClickNavigatesByPage(bool state); | ||||
52 | | ||||
48 | public Q_SLOTS: | 53 | public Q_SLOTS: | ||
49 | void load() override; | 54 | void load() override; | ||
50 | void save() override; | 55 | void save() override; | ||
51 | void defaults() override; | 56 | void defaults() override; | ||
52 | 57 | | |||
53 | Q_SIGNALS: | 58 | Q_SIGNALS: | ||
54 | void toolTipChanged(); | 59 | void toolTipChanged(); | ||
55 | void visualFeedbackChanged(); | 60 | void visualFeedbackChanged(); | ||
56 | void singleClickChanged(); | 61 | void singleClickChanged(); | ||
57 | void animationDurationFactorChanged(); | 62 | void animationDurationFactorChanged(); | ||
63 | void leftClickNavigatesByPageChanged(); | ||||
58 | 64 | | |||
59 | private: | 65 | private: | ||
60 | void loadPlasmarc(); | 66 | void loadPlasmarc(); | ||
61 | void loadKdeglobals(); | 67 | void loadKdeglobals(); | ||
62 | 68 | | |||
63 | void savePlasmarc(); | 69 | void savePlasmarc(); | ||
64 | void saveKdeglobals(); | 70 | void saveKdeglobals(); | ||
65 | 71 | | |||
66 | void handleNeedsSave(); | 72 | void handleNeedsSave(); | ||
67 | 73 | | |||
68 | // QML variables | 74 | // QML variables | ||
69 | bool m_toolTipOriginalState; | 75 | bool m_toolTipOriginalState; | ||
70 | bool m_toolTipCurrentState; | 76 | bool m_toolTipCurrentState; | ||
71 | 77 | | |||
72 | bool m_visualFeedbackOriginalState; | 78 | bool m_visualFeedbackOriginalState; | ||
73 | bool m_visualFeedbackCurrentState; | 79 | bool m_visualFeedbackCurrentState; | ||
74 | 80 | | |||
75 | bool m_singleClickOriginalState; | 81 | bool m_singleClickOriginalState; | ||
76 | bool m_singleClickCurrentState; | 82 | bool m_singleClickCurrentState; | ||
77 | 83 | | |||
78 | qreal m_animationDurationFactor = 1.0; | 84 | qreal m_animationDurationFactor = 1.0; | ||
79 | qreal m_animationOriginalDurationFactor = 1.0; | 85 | qreal m_animationOriginalDurationFactor = 1.0; | ||
86 | | ||||
87 | bool m_leftClickNavigatesByPage; | ||||
88 | bool m_leftClickNavigatesByPageOriginalState; | ||||
80 | }; | 89 | }; | ||
81 | 90 | | |||
82 | #endif // _KCM_WORKSPACEOPTIONS_H | 91 | #endif // _KCM_WORKSPACEOPTIONS_H |