2
* This file is part of unity-2d
4
* Copyright 2011 Canonical Ltd.
7
* - Alberto Mardegan <mardy@users.sourceforge.net>
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/>.
23
#include "homebutton.h"
29
#include <QApplication>
31
HomeButton::HomeButton(QWidget *parent)
35
setIconSize(QSize(24, 24));
36
QString themeIconName = QIcon::hasThemeIcon("start-here") ? "start-here" : "distributor-logo";
37
setIcon(QIcon::fromTheme(themeIconName));
41
"QToolButton { border: none; margin: 0; padding: 0; width: 61 }"
42
"QToolButton:checked, QToolButton:pressed {"
45
" padding-right: -1px;"
46
" padding-bottom: -1px;"
51
void HomeButton::mousePressEvent(QMouseEvent *event)
53
if (lastClickTime.isValid() &&
54
lastClickTime.elapsed() < QApplication::doubleClickInterval()) {
55
/* ignore this click */
59
QToolButton::mousePressEvent(event);
60
lastClickTime.restart();
63
#include "homebutton.moc"