24 #include <tqptrlist.h>
26 #include "kpanelapplet.h"
27 #include "kpanelapplet.moc"
28 #include <kapplication.h>
31 class KPanelApplet::KPanelAppletPrivate
41 TQPtrList<TQObject> watchedForFocus;
46 int actions, TQWidget *parent,
const char *name, WFlags f)
47 : TQFrame(parent, name, f)
49 , _position( pBottom )
50 , _alignment( LeftTop )
55 setFrameStyle(NoFrame);
56 TQPalette pal(palette());
57 if(pal.active().mid() != pal.inactive().mid()){
58 pal.setInactive(pal.active());
61 setBackgroundOrigin( AncestorOrigin );
64 _config = d->sharedConfig;
69 d->watchedForFocus.clear();
76 if( _position == p )
return;
83 if( _alignment == a )
return;
92 TQResizeEvent e( size(), size() );
99 if( _position == pTop || _position == pBottom ) {
100 return Qt::Horizontal;
109 switch( _position ) {
110 case pTop:
return Down;
111 case pRight:
return Left;
112 case pLeft:
return Right;
114 case pBottom:
return Up;
124 if ( (a & Preferences) )
126 if ( (a & ReportBug) )
132 return d->customMenu;
137 d->customMenu = menu;
149 if (d->watchedForFocus.find(TQT_TQOBJECT(widget)) == -1)
151 d->watchedForFocus.append(TQT_TQOBJECT(widget));
152 widget->installEventFilter(
this);
155 else if (d->watchedForFocus.find(TQT_TQOBJECT(widget)) != -1)
157 d->watchedForFocus.remove(TQT_TQOBJECT(widget));
158 widget->removeEventFilter(
this);
164 if (focus == d->hasFocus)
173 bool KPanelApplet::eventFilter(TQObject *o, TQEvent * e)
175 if (d->watchedForFocus.find(o) != -1)
177 if (e->type() == TQEvent::MouseButtonRelease ||
178 e->type() == TQEvent::FocusIn)
182 else if (e->type() == TQEvent::FocusOut)
188 return TQFrame::eventFilter(o, e);
193 return d->sharedConfig;
196 void KPanelApplet::virtual_hook(
int,
void* )