summaryrefslogtreecommitdiffstats
path: root/src/part/toolbar.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2020-06-13 22:45:28 +0900
committerMichele Calgaro <[email protected]>2020-06-13 22:45:28 +0900
commit5f44f7b187093ef290315b7f8766b540a31de35f (patch)
tree27ffb7b218199ca04f240c390c52426c65f45dce /src/part/toolbar.cpp
downloadcodeine-5f44f7b187093ef290315b7f8766b540a31de35f.tar.gz
codeine-5f44f7b187093ef290315b7f8766b540a31de35f.zip
Initial code import from debian snapshot
https://snapshot.debian.org/package/codeine/1.0.1-3.dfsg-3.1/ Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'src/part/toolbar.cpp')
-rw-r--r--src/part/toolbar.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/part/toolbar.cpp b/src/part/toolbar.cpp
new file mode 100644
index 0000000..8939074
--- /dev/null
+++ b/src/part/toolbar.cpp
@@ -0,0 +1,44 @@
+// (C) 2005 Max Howell ([email protected])
+// See COPYING file for licensing information
+
+#include <kpushbutton.h>
+#include <qapplication.h>
+#include <qevent.h>
+#include "toolbar.h"
+
+
+MouseOverToolBar::MouseOverToolBar( QWidget *parent )
+ : KToolBar( parent )
+{
+ parent->installEventFilter( this );
+ move( 0, 0 ); //TODO necessary?
+ hide();
+
+ setPalette( QApplication::palette() ); //videoWindow palette has a black background
+}
+
+bool
+MouseOverToolBar::eventFilter( QObject *o, QEvent *e )
+{
+ Q_ASSERT( o == parent() );
+
+ switch( e->type() )
+ {
+ case QEvent::Resize:
+ resize( static_cast<QResizeEvent*>(e)->size().width(), sizeHint().height() );
+ break;
+
+ case QEvent::Enter:
+ show();
+ break;
+
+ case QEvent::Leave:
+ hide();
+ break;
+
+ default:
+ ;
+ }
+
+ return false;
+} \ No newline at end of file