[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdegraphics/kpdf
From: Albert Astals Cid <tsdgeos () terra ! es>
Date: 2005-04-12 23:20:42
Message-ID: 20050412232042.1690C633 () office ! kde ! org
[Download RAW message or body]
CVS commit by aacid:
Presentation is now a dialog child of part so that get get only 1 entry on taskbar
To fix presentationwidget wanting to be always on top, even when it does not has the \
focus, we drop the staysontop on windowdeactivation and get it again \
on actiovation
BUGS: 103718
M +1 -1 part.cpp 1.36
M +10 -3 ui/presentationwidget.cpp 1.27
M +4 -3 ui/presentationwidget.h 1.13
--- kdegraphics/kpdf/part.cpp #1.35:1.36
@@ -743,5 +743,5 @@ void Part::slotShowPresentation()
{
if ( !m_presentationWidget )
- m_presentationWidget = new PresentationWidget( m_document );
+ m_presentationWidget = new PresentationWidget( widget(), m_document );
}
--- kdegraphics/kpdf/ui/presentationwidget.cpp #1.26:1.27
@@ -21,4 +21,5 @@
#include <kiconloader.h>
#include <kimageeffect.h>
+#include <kwin.h>
// system includes
@@ -47,7 +48,6 @@ struct PresentationFrame
-PresentationWidget::PresentationWidget( KPDFDocument * doc )
- : QWidget( 0, "presentationWidget", WDestructiveClose | WStyle_NoBorder |
- WStyle_StaysOnTop | WShowModal ), m_document( doc ), m_frameIndex( -1 )
+PresentationWidget::PresentationWidget( QWidget * parent, KPDFDocument * doc )
+ : QDialog( parent, "presentationWidget", true, WDestructiveClose | \
WStyle_NoBorder), m_document( doc ), m_frameIndex( -1 ) {
// set look and geometry
@@ -169,4 +169,11 @@ bool PresentationWidget::canUnloadPixmap
// <widget events>
+bool PresentationWidget::event ( QEvent * e )
+{
+ if (e -> type() == QEvent::WindowDeactivate) KWin::clearState(winId(), \
NET::StaysOnTop); + else if (e -> type() == QEvent::WindowActivate) \
KWin::setState(winId(), NET::StaysOnTop); + return QDialog::event(e);
+}
+
void PresentationWidget::keyPressEvent( QKeyEvent * e )
{
--- kdegraphics/kpdf/ui/presentationwidget.h #1.12:1.13
@@ -11,5 +11,5 @@
#define _KPDF_PRESENTATIONWIDGET_H_
-#include <qwidget.h>
+#include <qdialog.h>
#include <qpixmap.h>
#include <qstringlist.h>
@@ -30,9 +30,9 @@ class PresentationFrame;
* This is a fullscreen widget that displays
*/
-class PresentationWidget : public QWidget, public DocumentObserver
+class PresentationWidget : public QDialog, public DocumentObserver
{
Q_OBJECT
public:
- PresentationWidget( KPDFDocument * doc );
+ PresentationWidget( QWidget * parent, KPDFDocument * doc );
~PresentationWidget();
@@ -46,4 +46,5 @@ class PresentationWidget : public QWidge
protected:
// widget events
+ bool event( QEvent * e );
void keyPressEvent( QKeyEvent * e );
void wheelEvent( QWheelEvent * e );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic