1 | #pragma once |
2 | |
3 | /**************************************************************************************** |
4 | ** GitQlient is an application to manage and operate one or several Git repositories. With |
5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. |
6 | ** Copyright (C) 2021 Francesc Martinez |
7 | ** |
8 | ** LinkedIn: www.linkedin.com/in/cescmm/ |
9 | ** Web: www.francescmm.com |
10 | ** |
11 | ** This program is free software; you can redistribute it and/or |
12 | ** modify it under the terms of the GNU Lesser General Public |
13 | ** License as published by the Free Software Foundation; either |
14 | ** version 2 of the License, or (at your option) any later version. |
15 | ** |
16 | ** This program is distributed in the hope that it will be useful, |
17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
19 | ** Lesser General Public License for more details. |
20 | ** |
21 | ** You should have received a copy of the GNU Lesser General Public |
22 | ** License along with this library; if not, write to the Free Software |
23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
24 | ***************************************************************************************/ |
25 | |
26 | #include <QColor> |
27 | #include <QScopedPointer> |
28 | #include <QString> |
29 | |
30 | #include <array> |
31 | |
32 | class GitQlientSettings; |
33 | |
34 | /*! |
35 | \brief GitQlientStyles contains the information shared between all the instances of GitQlientWidget. This is a general |
36 | GitQlient styles configuration. |
37 | |
38 | */ |
39 | class GitQlientStyles |
40 | { |
41 | private: |
42 | static const int kBranchColors = 8; /*!< Total of branch colors. */ |
43 | |
44 | public: |
45 | /*! |
46 | \brief Gets the singleton instance. |
47 | |
48 | \return GitQlientStyles The instance for the styles. |
49 | */ |
50 | static GitQlientStyles *getInstance(); |
51 | /*! |
52 | \brief Gets the current stylesheet. |
53 | |
54 | \return QString The stylesheet. |
55 | */ |
56 | static QString getStyles(); |
57 | /*! |
58 | \brief Gets the text color. |
59 | |
60 | \return QColor Current text color. |
61 | */ |
62 | static QColor getTextColor(); |
63 | |
64 | /** |
65 | * @brief Gets the row selection color |
66 | * @return QColor Current row selection color |
67 | */ |
68 | static QColor getGraphSelectionColor(); |
69 | |
70 | /** |
71 | * @brief Gets the row hover color |
72 | * @return QColor Current row hover color |
73 | */ |
74 | static QColor getGraphHoverColor(); |
75 | |
76 | /** |
77 | * @brief Gets the background color |
78 | * @return QColor Current background color |
79 | */ |
80 | static QColor getBackgroundColor(); |
81 | |
82 | /** |
83 | * @brief Gets the tabs color |
84 | * @return QColor Current tab color |
85 | */ |
86 | static QColor getTabColor(); |
87 | |
88 | /*! |
89 | \brief Gets the GitQlient blue color. |
90 | |
91 | \return QColor |
92 | */ |
93 | static QColor getBlue(); |
94 | /*! |
95 | \brief Gets the GitQlient red color. |
96 | |
97 | \return QColor |
98 | */ |
99 | static QColor getRed(); |
100 | /*! |
101 | \brief Gets the GitQlient green color. |
102 | |
103 | \return QColor |
104 | */ |
105 | static QColor getGreen(); |
106 | /*! |
107 | \brief Gets the GitQlient orange color. |
108 | |
109 | \return QColor |
110 | */ |
111 | static QColor getOrange(); |
112 | /*! |
113 | \brief Gets the total count of branch colors. |
114 | |
115 | \return int |
116 | */ |
117 | static int getTotalBranchColors() { return kBranchColors; } |
118 | /*! |
119 | \brief Gets all the branch colors. |
120 | |
121 | \return std::array<QColor, kBranchColors> |
122 | */ |
123 | static std::array<QColor, kBranchColors> getBranchColors(); |
124 | /*! |
125 | \brief Gets the branch color for a given \p index. |
126 | |
127 | \param index The position of the color in the array. |
128 | \return QColor Returns the color. |
129 | */ |
130 | static QColor getBranchColorAt(int index); |
131 | |
132 | private: |
133 | static GitQlientStyles *INSTANCE; |
134 | |
135 | /*! |
136 | \brief Default constructor. |
137 | |
138 | */ |
139 | GitQlientStyles() = default; |
140 | }; |
141 | |