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/>.
21
#ifndef INDICATORENTRYWIDGET_H
22
#define INDICATORENTRYWIDGET_H
27
#include <UnityCore/IndicatorEntry.h>
32
struct _GtkWidgetPath;
37
class IndicatorEntryWidget : public QWidget, public sigc::trackable
41
IndicatorEntryWidget(const unity::indicator::Entry::Ptr& entry);
42
~IndicatorEntryWidget();
44
QSize minimumSizeHint() const;
45
QSize sizeHint() const;
51
unity::indicator::Entry::Ptr entry() const;
56
* When this method is called because of a click, button
57
* must be set to Qt::LeftButton.
59
* When it is called because user previously clicked an indicator and moved the
60
* mouse to another indicator, button must be set to Qt::NoButton.
62
void showMenu(Qt::MouseButton button);
65
void isEmptyChanged();
68
void resizeEvent(QResizeEvent*);
69
void paintEvent(QPaintEvent*);
70
void mousePressEvent(QMouseEvent*);
71
void mouseReleaseEvent(QMouseEvent*);
72
void wheelEvent(QWheelEvent*);
76
unity::indicator::Entry::Ptr m_entry;
81
struct _GtkWidgetPath* m_gtkWidgetPath;
84
void paintActiveBackground(QImage*);
86
struct _PangoLayout* createPangoLayout();
87
void paintLabel(QImage*, struct _PangoLayout*, int labelX);
90
#endif /* INDICATORENTRYWIDGET_H */