1 // Copyright 2010 Jochen Becher
3 // This file is part of MovieSchedule.
5 // MovieSchedule is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // MovieSchedule is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with MovieSchedule. If not, see <http://www.gnu.org/licenses/>.
18 #include "styleutils.h"
21 #include <QMaemo5Style>
26 StyleUtils::StyleUtils()
30 QColor StyleUtils::GetColor(const QPalette &palette, StandardColor standard_color)
34 switch (standard_color)
36 case DefaultBackgroundColor:
37 return QMaemo5Style::standardColor("DefaultBackgroundColor");
38 case DefaultTextColor:
39 return QMaemo5Style::standardColor("DefaultTextColor");
40 case SecondaryTextColor:
41 return QMaemo5Style::standardColor("ActiveTextColor");
47 switch (standard_color)
49 case DefaultBackgroundColor:
50 return palette.color(QPalette::Window);
51 case DefaultTextColor:
52 return palette.color(QPalette::WindowText);
53 case SecondaryTextColor:
54 color = palette.color(QPalette::WindowText);
58 return palette.color(QPalette::WindowText);
63 QColor StyleUtils::GetScheduleTimeColor(const QPalette &palette, QTime time)
68 return QMaemo5Style::standardColor("DefaultTextColor");
70 QColor color = palette.color(QPalette::WindowText);
75 QColor StyleUtils::GetDayTextColor(const QPalette &palette, const QDate &date)
80 QColor color = QMaemo5Style::standardColor("DefaultTextColor");
84 QColor color = palette.color(QPalette::WindowText);
90 QColor StyleUtils::GetDayBackgroundColor(const QPalette &palette, const QDate &date)
95 QColor color = QMaemo5Style::standardColor("DefaultTextColor");
99 QColor color = palette.color(QPalette::WindowText);
105 StyleUtils *StyleUtils::_instance = 0;
107 StyleUtilsSingleton::StyleUtilsSingleton()
109 StyleUtils::_instance = &_instance;