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
34 explicit ColorThemePrivate(ColorTheme *parent = 0);
36 ColorThemePrivate(const QColor &start, const QColor &main,
37 const QColor &end, ColorTheme *parent = 0);
41 ColorTheme * const q_ptr;
50 int calculateLength();
53 Q_DECLARE_PUBLIC(ColorTheme)
58ColorThemePrivate::ColorThemePrivate(
64ColorThemePrivate::ColorThemePrivate(const QColor &start,
65 const QColor &main, const QColor &end, ColorTheme *parent) :
66 q_ptr(parent), m_start(start), m_main(main), m_end(end)
70ColorThemePrivate::~ColorThemePrivate()
74ColorTheme::ColorTheme(QObject *parent) :
75 QObject(parent), d_ptr(new ColorThemePrivate(this))
79ColorTheme::ColorTheme(QColor &first, QColor &main,
80 QColor &end, QObject *parent) :
81 QObject(parent), d_ptr(
82 new ColorThemePrivate(first, main, end, this))
87ColorTheme & ColorTheme::operator=(
88 const ColorTheme & other)
90 if (d_ptr->m_start != other.d_ptr->m_start)
92 d_ptr->m_start = other.d_ptr->m_start;
93 startChanged(d_ptr->m_start);
95 if (d_ptr->m_main != other.d_ptr->m_main)
97 d_ptr->m_main = other.d_ptr->m_main;
98 mainChanged(d_ptr->m_main);
101 if (d_ptr->m_end != other.d_ptr->m_end)
103 d_ptr->m_end = other.d_ptr->m_end;
104 endChanged(d_ptr->m_end);
110ColorTheme::~ColorTheme()
115QColor ColorTheme::start() const
117 return d_ptr->m_start;
120QColor ColorTheme::main() const
122 return d_ptr->m_main;
125QColor ColorTheme::end() const
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