2 * Copyright (C) 2013 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * Author: Pete Woods <pete.woods@canonical.com>
19#include "ColorTheme.h"
22#include <QtCore/QString>
26using namespace UserMetricsOutput;
28namespace UserMetricsOutput
31class ColorThemePrivate: QObject
36 explicit ColorThemePrivate(ColorTheme *parent = 0);
38 ColorThemePrivate(const QColor &start, const QColor &main,
39 const QColor &end, ColorTheme *parent = 0);
43 ColorTheme * const q_ptr;
52 int calculateLength();
55 Q_DECLARE_PUBLIC(ColorTheme)
60ColorThemePrivate::ColorThemePrivate(
66ColorThemePrivate::ColorThemePrivate(const QColor &start,
67 const QColor &main, const QColor &end, ColorTheme *parent) :
68 q_ptr(parent), m_start(start), m_main(main), m_end(end)
72ColorThemePrivate::~ColorThemePrivate()
76ColorTheme::ColorTheme(QObject *parent) :
77 QObject(parent), d_ptr(new ColorThemePrivate(this))
81ColorTheme::ColorTheme(QColor &first, QColor &main,
82 QColor &end, QObject *parent) :
83 QObject(parent), d_ptr(
84 new ColorThemePrivate(first, main, end, this))
89ColorTheme & ColorTheme::operator=(
90 const ColorTheme & other)
92 if (d_ptr->m_start != other.d_ptr->m_start)
94 d_ptr->m_start = other.d_ptr->m_start;
95 startChanged(d_ptr->m_start);
97 if (d_ptr->m_main != other.d_ptr->m_main)
99 d_ptr->m_main = other.d_ptr->m_main;
100 mainChanged(d_ptr->m_main);
103 if (d_ptr->m_end != other.d_ptr->m_end)
105 d_ptr->m_end = other.d_ptr->m_end;
106 endChanged(d_ptr->m_end);
112ColorTheme::~ColorTheme()
117QColor ColorTheme::start() const
119 return d_ptr->m_start;
122QColor ColorTheme::main() const
124 return d_ptr->m_main;
127QColor ColorTheme::end() const
132#include "ColorTheme.moc"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list