~ubuntu-branches/ubuntu/raring/recorditnow/raring

« back to all changes in this revision

Viewing changes to src/timeline/topic.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-09 14:54:01 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110109145401-gyckb4airz4fio50
Tags: 0.8.1-0ubuntu1
* New upstream release. (LP: #681270)
  - Update debian/copyright.
* Build-depend on recordmydesktop.
* Add a watch file.
* Drop 01_fix_ftbfs_kwarning_call.diff, fixed upstream.
* Add 01_joschy_install_to_usr_lib.diff.
* Add 02_fix_ftbfs_no-add-needed.diff.
* Add 03_dont_install_header_files.diff.
* Replace dependency on libpolkit-qt-1-0 with policykit-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *   Copyright (C) 2009 by Kai Dombrowe <just89@gmx.de>                    *
 
2
 *   Copyright (C) 2010 by Kai Dombrowe <just89@gmx.de>                    *
3
3
 *                                                                         *
4
4
 *   This program is free software; you can redistribute it and/or modify  *
5
5
 *   it under the terms of the GNU General Public License as published by  *
41
41
{
42
42
 
43
43
    m_currentSecond = 0;
44
 
    m_icon = icon;
45
 
 
46
 
    setTextVisible(false);
47
 
 
48
 
    m_button = new QToolButton(this);
49
 
    m_button->setAutoRaise(true);
50
 
    m_titleLabel = new QLabel(this);
51
 
    m_timeLabel = new QLabel(this);
52
 
 
53
 
    QHBoxLayout *layout = new QHBoxLayout;
54
 
    layout->addWidget(m_button);
55
 
    layout->addWidget(m_titleLabel);
56
 
    layout->addWidget(m_timeLabel);
57
 
    setLayout(layout);
58
44
 
59
45
    setTitle(title);
60
46
    setIcon(icon);
63
49
    setMaximum(durationToSeconds());
64
50
    setValue(0);
65
51
 
66
 
    updateSize();
67
52
 
68
53
}
69
54
 
94
79
QString Topic::title() const
95
80
{
96
81
 
97
 
    return m_titleLabel->text();
 
82
    return m_title;
98
83
 
99
84
}
100
85
 
161
146
void Topic::setIcon(const QString &icon)
162
147
{
163
148
 
164
 
    m_button->setIcon(KIcon(icon));
 
149
    m_icon = icon;
165
150
 
166
151
}
167
152
 
169
154
void Topic::setTitle(const QString &title)
170
155
{
171
156
 
172
 
    m_titleLabel->setText(title);
173
 
 
174
 
}
175
 
 
176
 
 
177
 
void Topic::updateSize()
178
 
{
179
 
 
180
 
    QStyleOptionProgressBarV2 option;
181
 
    initStyleOption(&option);
182
 
 
183
 
    const QRect rect = style()->subElementRect(QStyle::SE_ProgressBarContents, &option, this);
184
 
 
185
 
    setMinimumHeight(rect.height());
186
 
 
187
 
}
188
 
 
189
 
 
190
 
bool Topic::event(QEvent *event)
191
 
{
192
 
 
193
 
    if (event->type() == QEvent::StyleChange || event->type() == QEvent::FontChange) {
194
 
        updateSize();
195
 
    }
196
 
 
197
 
    return QProgressBar::event(event);
198
 
 
199
 
}
 
157
    m_title = title;
 
158
 
 
159
}
 
160
 
200
161
 
201
162
 
202
163
#include "topic.moc"