5 Rik Hemsley <rik@kde.org>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
23 #include "MaximiseButton.h"
28 #include <QMouseEvent>
34 static const char * const maximise_xpm
[] = {
53 static const char * const unmaximise_xpm
[] = {
71 MaximiseButton::MaximiseButton(QWidget
* parent
)
72 : Button(parent
, i18n("Maximize"),
73 (Qt::ButtonState
)(Qt::LeftButton
|Qt::MidButton
|Qt::RightButton
)),
76 setPixmap(QPixmap((const char **)maximise_xpm
));
79 void MaximiseButton::setOn(bool on
)
82 setPixmap(on_
? QPixmap((const char **)unmaximise_xpm
)
83 : QPixmap((const char **)maximise_xpm
));
85 QToolTip::remove(this);
86 this->setToolTip( on_
? i18n("Restore") : i18n("Maximize"));
89 void MaximiseButton::mouseReleaseEvent(QMouseEvent
*e
)
91 Button::mouseReleaseEvent(e
);
93 if (!rect().contains(e
->pos()))
95 emit(maximizeClicked(lastButton_
));
100 // vim:ts=2:sw=2:tw=78
101 #include "MaximiseButton.moc"