2
* This file is part of unity-2d
4
* Copyright 2011 Canonical Ltd.
7
* - Aurélien Gâteau <aurelien.gateau@canonical.com>
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; version 3.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
#include "indicatorwidget.h"
26
#include <indicatorentrywidget.h>
27
#include <indicatorsmanager.h>
30
#include <QHBoxLayout>
32
using namespace unity::indicator;
34
IndicatorWidget::IndicatorWidget(const Indicator::Ptr& indicator, IndicatorsManager* manager)
35
: m_layout(new QHBoxLayout(this))
36
, m_indicatorsManager(manager)
37
, m_indicator(indicator)
39
m_layout->setMargin(0);
40
m_layout->setSpacing(0);
42
m_indicator->on_entry_added.connect(sigc::mem_fun(this, &IndicatorWidget::onEntryAdded));
45
void IndicatorWidget::onEntryAdded(const Entry::Ptr& entry)
47
IndicatorEntryWidget* widget = new IndicatorEntryWidget(entry);
48
m_indicatorsManager->addIndicatorEntryWidget(widget);
49
m_layout->addWidget(widget);
53
#include "indicatorwidget.moc"