blob: cdf85c36ae365ed218efd5236cf7a34fe062b926 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// (C) 2005 Max Howell ([email protected])
// See COPYING file for licensing information
#include <kpushbutton.h>
#include <tqapplication.h>
#include <tqevent.h>
#include "toolbar.h"
MouseOverToolBar::MouseOverToolBar( TQWidget *parent )
: TDEToolBar( parent )
{
parent->installEventFilter( this );
move( 0, 0 ); //TODO necessary?
hide();
setPalette( TQApplication::palette() ); //videoWindow palette has a black background
}
bool
MouseOverToolBar::eventFilter( TQObject *o, TQEvent *e )
{
Q_ASSERT( o == parent() );
switch( e->type() )
{
case TQEvent::Resize:
resize( static_cast<TQResizeEvent*>(e)->size().width(), sizeHint().height() );
break;
case TQEvent::Enter:
show();
break;
case TQEvent::Leave:
hide();
break;
default:
;
}
return false;
}
|