Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TitleBar.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2015 "Omnidome" by cr8tr
2  * Dome Mapping Projection Software (http://omnido.me).
3  * Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
4  *
5  * This file is part of Omnidome.
6  *
7  * Omnidome is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Affero General Public License for more details.
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OMNI_UI_PROJ_TITLEBAR_H
21 #define OMNI_UI_PROJ_TITLEBAR_H
22 
23 #include <QToolButton>
24 #include <QMenu>
25 #include <omni/ui/Widget.h>
27 #include <omni/util.h>
28 
29 namespace omni {
30  namespace ui {
31  namespace proj {
32  class Tuning;
33 
34  /**@brief TitleBar for projector tuning widget
35  * @detail Has four buttons:
36  * * projector setup selection and resetting
37  * * Fullscreen display toggle options
38  * * Minimizing/Maximizing tuning widget
39  * * Close tuning widget for deleting a projector tuning
40  **/
41  class TitleBar :
42  public omni::ui::Widget {
43  Q_OBJECT
44 
45  public:
46  /// Construct with tuning widget as parent (is mandatory)
47  TitleBar(Tuning *);
48 
49  /// Construct with label and tuning widget as parent
50  TitleBar(QString const& _label,
51  Tuning *);
52  ~TitleBar();
53 
54  /// Return color
55  QColor color() const;
56 
57  /// Returns true if close button is visible
58  bool closeButtonVisible() const;
59 
60  public slots:
61  /// Set color from gradient pos (between 0.0 and 1.0)
62  void setColor(QColor const&);
63 
64  /// Select color from color picker
65  void selectColor();
66 
67  /// Toggle visibility of close button
68  void setCloseButtonVisible(bool);
69 
70  /// Update State for display button when fullscreen has been toggled
71  void fullscreenToggle(bool);
72 
73  signals:
74  void closeButtonClicked();
75  void maximizeButtonClicked();
76  void colorChanged(QColor const&);
77  void freeSetupSelected();
79 
80  protected:
81  void paintEvent(QPaintEvent *);
82 
83  private:
84  void setup();
85 
86  /// Set moving flag to value and handle visibility of buttons
88 
89  /// Button for resetting and projector setup selection
90  QUniquePtr<QToolButton> menuButton_;
91 
92  /// Button for toggling fullscreen display
93  QUniquePtr<QToolButton> displayButton_;
94 
95  /// Button for Minimizing/Maximizing widget
96  QUniquePtr<QToolButton> maximizeButton_;
97 
98  /// Button for closing widget
99  QUniquePtr<QToolButton> closeButton_;
100 
101  /// Context menu widget
102  QUniquePtr<QMenu> menu_;
103 
104  /// Parent tuning widget
105  Tuning *tuningWidget_ = nullptr;
106 
107  QColor color_;
108  };
109  }
110  }
111 }
112 
113 #endif /* OMNI_UI_PROJ_TITLEBAR_H */
QUniquePtr< QToolButton > displayButton_
Button for toggling fullscreen display.
Definition: TitleBar.h:93
void paintEvent(QPaintEvent *)
Definition: TitleBar.cpp:88
void fullscreenToggle(bool)
Update State for display button when fullscreen has been toggled.
Definition: TitleBar.cpp:80
QUniquePtr< QToolButton > closeButton_
Button for closing widget.
Definition: TitleBar.h:99
void selectColor()
Select color from color picker.
Definition: TitleBar.cpp:56
Tuning * tuningWidget_
Parent tuning widget.
Definition: TitleBar.h:105
QUniquePtr< QMenu > menu_
Context menu widget.
Definition: TitleBar.h:102
QUniquePtr< QToolButton > menuButton_
Button for resetting and projector setup selection.
Definition: TitleBar.h:90
void colorChanged(QColor const &)
A single parameter widget with a label and color set.
Definition: Widget.h:31
bool closeButtonVisible() const
Returns true if close button is visible.
Definition: TitleBar.cpp:68
TitleBar for projector tuning widget Has four buttons:
Definition: TitleBar.h:41
void setup()
Definition: TitleBar.cpp:100
TitleBar(Tuning *)
Construct with tuning widget as parent (is mandatory)
Definition: TitleBar.cpp:32
Tuning * tuningWidget()
Set moving flag to value and handle visibility of buttons.
Definition: TitleBar.cpp:179
void setColor(QColor const &)
Set color from gradient pos (between 0.0 and 1.0)
Definition: TitleBar.cpp:49
QColor color() const
Return color.
Definition: TitleBar.cpp:63
Widget for manipulating projector parameters Also holds a preview OpenGL widget. ...
Definition: Tuning.h:46
~TitleBar()
Definition: TitleBar.cpp:46
QColor color_
Definition: TitleBar.h:107
QUniquePtr< QToolButton > maximizeButton_
Button for Minimizing/Maximizing widget.
Definition: TitleBar.h:96
void setCloseButtonVisible(bool)
Toggle visibility of close button.
Definition: TitleBar.cpp:73