Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/widgets/KisLayerStyleAngleSelector.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (c) 2018 Anna Medonosova <anna.medonosova@gmail.com> | ||||
3 | * | ||||
4 | * This library is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU Lesser General Public License as published by | ||||
6 | * the Free Software Foundation; version 2.1 of the License. | ||||
7 | * | ||||
8 | * This library is distributed in the hope that it will be useful, | ||||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
11 | * GNU Lesser General Public License for more details. | ||||
12 | * | ||||
13 | * You should have received a copy of the GNU Lesser General Public License | ||||
14 | * along with this program; if not, write to the Free Software | ||||
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
16 | */ | ||||
17 | | ||||
18 | #ifndef KISLAYERSTYLEANGLESELECTOR_H | ||||
19 | #define KISLAYERSTYLEANGLESELECTOR_H | ||||
20 | | ||||
21 | #include <QObject> | ||||
22 | #include <QWidget> | ||||
23 | #include <QDial> | ||||
24 | | ||||
25 | #include <ui_wdgKisLayerStyleAngleSelector.h> | ||||
26 | | ||||
27 | class KisLayerStyleAngleSelector : public QWidget | ||||
28 | { | ||||
29 | Q_OBJECT | ||||
30 | | ||||
31 | public: | ||||
32 | KisLayerStyleAngleSelector(QWidget* parent); | ||||
33 | | ||||
34 | int value(); | ||||
35 | void setValue(int value); | ||||
36 | | ||||
37 | void enableGlobalLight(bool enable); | ||||
38 | | ||||
39 | bool useGlobalLight(); | ||||
40 | void setUseGlobalLight(bool state); | ||||
41 | | ||||
42 | Q_SIGNALS: | ||||
43 | void valueChanged(int); | ||||
44 | void configChanged(); | ||||
45 | void globalAngleChanged(int); | ||||
46 | | ||||
47 | private Q_SLOTS: | ||||
48 | void slotDialAngleChanged(int value); | ||||
49 | void slotIntAngleChanged(int value); | ||||
50 | void slotGlobalLightToggled(); | ||||
51 | | ||||
52 | private: | ||||
53 | void emitChangeSignals(); | ||||
54 | | ||||
55 | Ui_WdgKisLayerStyleAngleSelector* ui; | ||||
56 | | ||||
57 | // BUG: 372169 | ||||
58 | // Adobe's dial widget differs from QDial by 90 degrees, | ||||
59 | // therefore we need to apply this magic constant | ||||
60 | // to this widget's QDial for consistency between | ||||
61 | // the settings dialogs and on-canvas effects. | ||||
62 | // Wrapping is handled by QDial itself. | ||||
63 | const static int m_dialValueShift = 90; | ||||
64 | | ||||
65 | bool m_enableGlobalLight; | ||||
66 | }; | ||||
67 | | ||||
68 | #endif // KISLAYERSTYLEANGLESELECTOR_H |