| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | /**************************************************************************
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-03-05 11:25:49 +01:00
										 |  |  | ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-06-17 00:01:27 +10:00
										 |  |  | ** Contact: Nokia Corporation (qt-info@nokia.com) | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** Commercial Usage | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** Licensees holding valid Qt Commercial licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the Qt Commercial License Agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							|  |  |  | ** a written agreement between you and Nokia. | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** GNU Lesser General Public License Usage | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
					
						
							|  |  |  | ** General Public License version 2.1 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation and appearing in the file LICENSE.LGPL included in the | 
					
						
							|  |  |  | ** packaging of this file.  Please review the following information to | 
					
						
							|  |  |  | ** ensure the GNU Lesser General Public License version 2.1 requirements | 
					
						
							|  |  |  | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** If you are unsure which license is appropriate for your use, please | 
					
						
							| 
									
										
										
										
											2009-08-14 09:30:56 +02:00
										 |  |  | ** contact the sales department at http://qt.nokia.com/contact.
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | **************************************************************************/ | 
					
						
							| 
									
										
										
										
											2008-12-02 15:08:31 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | #ifndef STYLEHELPER_H
 | 
					
						
							|  |  |  | #define STYLEHELPER_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-15 12:38:45 +02:00
										 |  |  | #include "utils_global.h"
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <QtGui/QColor>
 | 
					
						
							| 
									
										
										
										
											2010-02-17 17:09:00 +01:00
										 |  |  | #include <QtGui/QStyle>
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-01 16:38:08 +02:00
										 |  |  | QT_BEGIN_NAMESPACE | 
					
						
							|  |  |  | class QPalette; | 
					
						
							|  |  |  | class QPainter; | 
					
						
							|  |  |  | class QRect; | 
					
						
							|  |  |  | QT_END_NAMESPACE | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | // Helper class holding all custom color values
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-05 11:06:05 +02:00
										 |  |  | namespace Utils { | 
					
						
							| 
									
										
										
										
											2009-07-15 12:38:45 +02:00
										 |  |  | class QTCREATOR_UTILS_EXPORT StyleHelper | 
					
						
							| 
									
										
										
										
											2008-12-02 15:08:31 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | public: | 
					
						
							|  |  |  |     // Height of the project explorer navigation bar
 | 
					
						
							|  |  |  |     static int navigationWidgetHeight() { return 24; } | 
					
						
							|  |  |  |     static qreal sidebarFontSize(); | 
					
						
							|  |  |  |     static QPalette sidebarFontPalette(const QPalette &original); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // This is our color table, all colors derive from baseColor
 | 
					
						
							| 
									
										
										
										
											2010-03-03 11:02:13 +01:00
										 |  |  |     static QColor requestedBaseColor() { return m_requestedBaseColor; } | 
					
						
							| 
									
										
										
										
											2010-02-19 09:54:29 +01:00
										 |  |  |     static QColor baseColor(bool lightColored = false); | 
					
						
							|  |  |  |     static QColor panelTextColor(bool lightColored = false); | 
					
						
							|  |  |  |     static QColor highlightColor(bool lightColored = false); | 
					
						
							|  |  |  |     static QColor shadowColor(bool lightColored = false); | 
					
						
							|  |  |  |     static QColor borderColor(bool lightColored = false); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     static QColor buttonTextColor() { return QColor(0x4c4c4c); } | 
					
						
							| 
									
										
										
										
											2009-06-05 13:59:10 +02:00
										 |  |  |     static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-18 11:41:58 +01:00
										 |  |  |     static QColor sidebarHighlight() { return QColor(255, 255, 255, 40); } | 
					
						
							|  |  |  |     static QColor sidebarShadow() { return QColor(0, 0, 0, 40); } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     // Sets the base color and makes sure all top level widgets are updated
 | 
					
						
							|  |  |  |     static void setBaseColor(const QColor &color); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-17 17:09:00 +01:00
										 |  |  |     // Draws a shaded anti-aliased arrow
 | 
					
						
							|  |  |  |     static void drawArrow(QStyle::PrimitiveElement element, QPainter *painter, const QStyleOption *option); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     // Gradients used for panels
 | 
					
						
							| 
									
										
										
										
											2010-02-19 09:54:29 +01:00
										 |  |  |     static void horizontalGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect, bool lightColored = false); | 
					
						
							|  |  |  |     static void verticalGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect, bool lightColored = false); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     static void menuGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // Pixmap cache should only be enabled for X11 due to slow gradients
 | 
					
						
							| 
									
										
										
										
											2009-01-26 15:27:04 +01:00
										 |  |  |     static bool usePixmapCache() { return true; } | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-24 19:23:40 +01:00
										 |  |  |     static void drawCornerImage(const QImage &img, QPainter *painter, QRect rect, | 
					
						
							|  |  |  |                          int left = 0, int top = 0, int right = 0, int bottom = 0); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | private: | 
					
						
							|  |  |  |     static QColor m_baseColor; | 
					
						
							| 
									
										
										
										
											2010-03-03 11:02:13 +01:00
										 |  |  |     static QColor m_requestedBaseColor; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-05 11:06:05 +02:00
										 |  |  | } // namespace Utils
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | #endif // STYLEHELPER_H
 |