summaryrefslogtreecommitdiffstats
path: root/src/part/toolbar.cpp
blob: e998244770e374ceb86362f6e355f1defbc2f37e (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 (max.howell@methylblue.com)
// See COPYING file for licensing information

#include <kpushbutton.h>
#include <ntqapplication.h>
#include <ntqevent.h>
#include "toolbar.h"


MouseOverToolBar::MouseOverToolBar( TQWidget *parent )
      : KToolBar( 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;
}