author | alwin <alwin> | 2004-04-23 13:22:22 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-23 13:22:22 (UTC) |
commit | da6a98dbc555018a29bf140ed8e890015240b322 (patch) (side-by-side diff) | |
tree | 3b8b05451fcd2c653982e1cd63b92eb0fb8b9a72 /noncore/graphics/opie-eye/gui | |
parent | 33666eb31ae6d35aa527cf7bf22c2c2e0dcd6824 (diff) | |
download | opie-da6a98dbc555018a29bf140ed8e890015240b322.zip opie-da6a98dbc555018a29bf140ed8e890015240b322.tar.gz opie-da6a98dbc555018a29bf140ed8e890015240b322.tar.bz2 |
ok, I think I have all tried to reduce flicker in fullscreen when opie-eye
get focus back. But as long I must repaint the fullScreenwidget my self when
taskbar comes visible I can not do anymore.
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 30 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.h | 16 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 24 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.h | 1 |
4 files changed, 27 insertions, 44 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index 03f3c1c..b4f3110 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp @@ -112,3 +112,2 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) if (!m) return; - bool old = fullScreen(); m->insertItem(tr("Toggle fullscreen"),this, SIGNAL(toggleFullScreen())); @@ -131,2 +130,9 @@ void ImageView::setFullScreen(bool how) m_isFullScreen = how; + if (how) { + m_ignore_next_in = true; + setFixedSize(qApp->desktop()->size()); + showFullScreen(); + } else { + setMinimumSize(10,10); + } } @@ -142,6 +148,12 @@ void ImageView::focusInEvent(QFocusEvent *) +void ImageView::hide() +{ + if (fullScreen()) { + m_ignore_next_in = true; + showNormal(); + } + QWidget::hide(); +} void ImageView::enableFullscreen() { - // This call is needed because showFullScreen won't work - // correctly if the widget already considers itself to be fullscreen. if (!fullScreen()) return; @@ -150,6 +162,5 @@ void ImageView::enableFullscreen() setUpdatesEnabled(false); - parentWidget()->showNormal(); // This is needed because showNormal() forcefully changes the window // style to WSTyle_TopLevel. - parentWidget()->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); + reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); // Enable fullscreen. @@ -158,11 +169,6 @@ void ImageView::enableFullscreen() m_ignore_next_in = true; - parentWidget()->showFullScreen(); + showFullScreen(); setUpdatesEnabled(true); -} -ImageWidget::ImageWidget(QWidget * parent, const char * name, WFlags f) - : QWidget(parent,name,f) -{ - // Make sure size is correct - setFixedSize(qApp->desktop()->size()); } + diff --git a/noncore/graphics/opie-eye/gui/imageview.h b/noncore/graphics/opie-eye/gui/imageview.h index f3c37b5..18697e0 100644 --- a/noncore/graphics/opie-eye/gui/imageview.h +++ b/noncore/graphics/opie-eye/gui/imageview.h @@ -55,2 +55,4 @@ protected: +public slots: + virtual void hide(); @@ -62,16 +64,2 @@ protected slots: -class ImageWidget:public QWidget -{ - Q_OBJECT -public: - ImageWidget(QWidget * parent=0, const char * name=0, WFlags f = WStyle_Customize | WStyle_NoBorder); - virtual ~ImageWidget(){}; - -protected: - -public slots: - -protected slots: -}; - #endif diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index cdaf34c..274a22a 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp @@ -35,3 +35,2 @@ - //OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) @@ -45,3 +44,2 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) m_cfg->setGroup("Zecke_view" ); - tFrame = 0; // qDebug( "Process-wide OApplication object @ %0x", oApp ); @@ -148,5 +146,2 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) PMainWindow::~PMainWindow() { - odebug << "Shutting down" << oendl; - if (tFrame) delete tFrame; - odebug << "Shutting down done" << oendl; } @@ -327,3 +322,2 @@ void PMainWindow::slotToggleFullScreen() bool current = !m_disp->fullScreen(); - m_disp->setFullScreen(current); odebug << "Current = " << current << oendl; @@ -332,8 +326,3 @@ void PMainWindow::slotToggleFullScreen() m_disp->setBackgroundColor(black); - if (!tFrame) { - tFrame = new ImageWidget(0,0,WStyle_Customize|WStyle_NoBorder); - tFrame->resize(qApp->desktop()->width(), qApp->desktop()->height()); - tFrame->setMinimumSize(qApp->desktop()->width(), qApp->desktop()->height()); - } - m_disp->reparent(tFrame,QPoint(0,0)); + m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); m_disp->setVScrollBarMode(QScrollView::AlwaysOff); @@ -341,3 +330,4 @@ void PMainWindow::slotToggleFullScreen() m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); - tFrame->showFullScreen(); + //m_disp->showFullScreen(); + //qwsDisplay()->requestFocus( m_disp->winId(), TRUE); } else { @@ -347,4 +337,2 @@ void PMainWindow::slotToggleFullScreen() m_disp->showNormal(); - /* don't forget it! */ - tFrame->hide(); m_disp->setBackgroundColor(white); @@ -359,2 +347,3 @@ void PMainWindow::slotToggleFullScreen() } + m_disp->setFullScreen(current); } @@ -400,3 +389,4 @@ void PMainWindow::slotDisplay( const QString& inf ) { if (m_disp->fullScreen()) { - tFrame->show();//FullScreen(); + //m_disp->showFullScreen(); + qwsDisplay()->requestFocus( m_disp->winId(), TRUE); } else { @@ -441,3 +431,3 @@ void PMainWindow::raiseIconView() { if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { - tFrame->hide(); + m_disp->hide(); } diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h index 9e94c60..6fa1ab6 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.h +++ b/noncore/graphics/opie-eye/gui/mainwindow.h @@ -70,3 +70,2 @@ private: bool zoomerOn; - ImageWidget*tFrame; QToolButton*rotateButton,*upButton,*fsButton,*viewModeButton; |