Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ColorSet.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_COLORSET_H_
21 #define OMNI_UI_COLORSET_H_
22 
23 #include <QWidget>
24 #include <QPalette>
25 
26 namespace omni {
27  namespace ui {
28  /// Simplies color access from a palette for a widget
29  struct ColorSet
30  {
31  /**@brief Default constructor
32  @param _parent Pointer to parent widget
33  **/
34  ColorSet(QWidget *_parent);
35 
36  QColor color(QPalette::ColorRole) const;
37  QPalette::ColorGroup colorGroup() const;
38 
39  /// Window aka Background color
40  QColor window() const;
41 
42  /// Window text aka Foreground color
43  QColor windowText() const;
44 
45  /**@brief Base color
46  * @param _alternate Returns alternate color (used for alternted rows)
47  **/
48  QColor base(bool _alternate = false) const;
49 
50  /// Button color (ColorRole = QPalette::Button)
51  QColor button() const;
52 
53  /// Tooltip color (ColorRole = QPalette::ToolTipBase)
54  QColor toolTipBase() const;
55 
56  /// Tooltip text color (ColorRole = QPalette::ToolTipText)
57  QColor toolTipText() const;
58 
59  /// Text color (ColorRole = QPalette::Text)
60  QColor text() const;
61 
62  /// Button text color (ColorRole = QPalette::ButtonText)
63  QColor buttonText() const;
64 
65  /// Bright text color (ColorRole = QPalette::BrightText)
66  QColor brightText() const;
67 
68  /// Light color (ColorRole = QPalette::Light)
69  QColor light() const;
70 
71  /// Mid light color (ColorRole = QPalette::Midlight)
72  QColor midlight() const;
73 
74  /// Dark color (ColorRole = QPalette::Dark)
75  QColor dark() const;
76 
77  /// Shadow color (ColorRole = QPalette::Shadow)
78  QColor shadow() const;
79 
80  /// Highlight color (ColorRole = QPalette::Highlight)
81  QColor highlight() const;
82 
83  /// HighlightText color (ColorRole = QPalette::HighlightText)
84  QColor highlightedText() const;
85 
86  /// Link color (ColorRole = QPalette::Link)
87  QColor link() const;
88 
89  /// Visited link color (ColorRole = QPalette::LinkVisited)
90  QColor linkVisited() const;
91 
92  private:
93  /// Pointer to parent widget
94  QWidget *parent_;
95  };
96  }
97 }
98 
99 #endif /* OMNI_UI_COLORSET_H_ */
QColor midlight() const
Mid light color (ColorRole = QPalette::Midlight)
QColor windowText() const
Window text aka Foreground color.
Simplies color access from a palette for a widget.
Definition: ColorSet.h:29
QColor shadow() const
Shadow color (ColorRole = QPalette::Shadow)
QWidget * parent_
Pointer to parent widget.
Definition: ColorSet.h:94
QColor brightText() const
Bright text color (ColorRole = QPalette::BrightText)
QColor button() const
Button color (ColorRole = QPalette::Button)
ColorSet(QWidget *_parent)
Default constructor.
Definition: ColorSet.cpp:24
QColor base(bool _alternate=false) const
Base color.
Definition: ColorSet.cpp:63
QColor light() const
Light color (ColorRole = QPalette::Light)
QColor linkVisited() const
Visited link color (ColorRole = QPalette::LinkVisited)
QColor highlight() const
Highlight color (ColorRole = QPalette::Highlight)
QColor link() const
Link color (ColorRole = QPalette::Link)
QColor toolTipText() const
Tooltip text color (ColorRole = QPalette::ToolTipText)
QColor toolTipBase() const
Tooltip color (ColorRole = QPalette::ToolTipBase)
QPalette::ColorGroup colorGroup() const
Definition: ColorSet.cpp:33
QColor buttonText() const
Button text color (ColorRole = QPalette::ButtonText)
QColor highlightedText() const
HighlightText color (ColorRole = QPalette::HighlightText)
QColor window() const
Window aka Background color.
QColor color(QPalette::ColorRole) const
Definition: ColorSet.cpp:28
QColor dark() const
Dark color (ColorRole = QPalette::Dark)
QColor text() const
Text color (ColorRole = QPalette::Text)