1
// $Id: kitsystemtray.cpp,v 1.5 2000/12/13 14:51:34 malte Exp $
5
// Copyright (C) 1999 Neil Stevens <multivac@fcmail.com>
7
// Permission is hereby granted, free of charge, to any person obtaining a copy
8
// of this software and associated documentation files (the "Software"), to deal
9
// in the Software without restriction, including without limitation the rights
10
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
// copies of the Software, and to permit persons to whom the Software is
12
// furnished to do so, subject to the following conditions:
14
// The above copyright notice and this permission notice shall be included in
15
// all copies or substantial portions of the Software.
17
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21
// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
// Except as contained in this notice, the name(s) of the author(s) shall not be
25
// used in advertising or otherwise to promote the sale, use or other dealings
26
// in this Software without prior written authorization from the author(s).
32
#include "noatunapp.h"
34
#include "kitsystemtray.h"
35
#include "kmainwindow.h"
36
#include "kpopupmenu.h"
38
#include "kiconloader.h"
40
KitSystemTray::KitSystemTray(const QString &contextMenu, KMainWindow *parent, const char *name)
41
: KSystemTray(parent, name)
43
setAlignment(AlignHCenter | AlignVCenter);
44
menu = (KPopupMenu *)parent->guiFactory()->container(contextMenu, parent);
45
menu->insertTitle(SmallIcon("noatun"), QString::null, 0, 0);
48
void KitSystemTray::changeTitle(const QPixmap &pixmap, const QString &title)
50
menu->changeTitle(0, pixmap, title);
53
void KitSystemTray::showEvent(QShowEvent *)
58
void KitSystemTray::mousePressEvent(QMouseEvent *event)
60
if(event->button() == LeftButton)
61
napp->player()->toggleInterfaces();
63
menu->popup(event->globalPos());
66
#include "kitsystemtray.moc"