All Classes Namespaces Functions Variables Enumerations Properties Pages
toolbox.h
1 /*
2 
3 Pencil2D - Traditional Animation Software
4 Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5 Copyright (C) 2012-2020 Matthew Chiawen Chang
6 
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; version 2 of the License.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 */
17 #ifndef TOOLBOXWIDGET_H
18 #define TOOLBOXWIDGET_H
19 
20 #include "pencildef.h"
21 #include "basedockwidget.h"
22 
23 class QToolButton;
24 class QGridLayout;
25 class QIcon;
26 class SpinSlider;
28 class ToolOptionWidget;
29 class Editor;
30 
31 namespace Ui {
32 class ToolBoxWidget;
33 }
34 
36 {
37  Q_OBJECT
38 
39 public:
41  ~ToolBoxWidget() override;
42 
43  void initUI() override;
44  void updateUI() override;
45 
46 public slots:
47  void onToolSetActive(ToolType toolType);
48  void pencilOn();
49  void eraserOn();
50  void selectOn();
51  void moveOn();
52  void penOn();
53  void handOn();
54  void polylineOn();
55  void bucketOn();
56  void eyedropperOn();
57  void brushOn();
58  void smudgeOn();
59 
60 protected:
61  int getMinHeightForWidth(int width) override;
62 
63 signals:
64  void clearButtonClicked();
65 
66 private:
67  void deselectAllTools();
68  bool toolOn(ToolType toolType, QToolButton* toolButton);
69 
70  Ui::ToolBoxWidget* ui = nullptr;
71 };
72 
73 #endif
int width() const const
Q_OBJECTQ_OBJECT
Definition: editor.h:55
QObject * parent() const const