All Classes Namespaces Functions Variables Enumerations Properties Pages
displayoptionwidget.h
1 /*
2 
3 Pencil2D - Traditional Animation Software
4 Copyright (C) 2012-2020 Matthew Chiawen Chang
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; version 2 of the License.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 */
16 
17 #ifndef DISPLAYOPTIONDOCKWIDGET_H
18 #define DISPLAYOPTIONDOCKWIDGET_H
19 
20 #include "basedockwidget.h"
21 
22 namespace Ui
23 {
24  class DisplayOption;
25 }
26 class Editor;
27 class QToolButton;
28 class ViewManager;
29 class QTimer;
30 
32 {
33  Q_OBJECT
34 public:
36  virtual ~DisplayOptionWidget() override;
37 
38  void initUI() override;
39  void updateUI() override;
40 
41 public slots:
42  void prepareOverlayManager();
43 
44 protected:
45  int getMinHeightForWidth(int width) override;
46 
47 private slots:
48  void toggleMirror(bool);
49  void toggleMirrorV(bool);
50  void toggleOverlayCenter(bool isOn);
51  void toggleOverlayThirds(bool isOn);
52  void toggleOverlayGoldenRatio(bool isOn);
53  void toggleOverlaySafeAreas(bool isOn);
54  void toggleOverlayPerspective1(bool isOn);
55  void toggleOverlayPerspective2(bool isOn);
56  void toggleOverlayPerspective3(bool isOn);
57  void anglePreferences();
58  void angle2degrees(bool);
59  void angle3degrees(bool);
60  void angle5degrees(bool);
61  void angle7_5degrees(bool);
62  void angle10degrees(bool);
63  void angle15degrees(bool);
64  void angle20degrees(bool);
65  void angle30degrees(bool);
66 
67 private:
68  void makeConnections();
69  void clearPreviousAngle(int angle);
70  void changeAngle(int angle);
71  Ui::DisplayOption* ui = nullptr;
72 
73  QString buttonStylesheet;
74 
75  // vars for perspective overlays
76  int mOverlayAngle = 15;
77  int mPerspectiveX = -1;
78  int mPerspectiveY = 1;
79 };
80 
81 #endif // DISPLAYOPTIONDOCKWIDGET_H
int width() const const
Q_OBJECTQ_OBJECT
Definition: editor.h:55
QObject * parent() const const