From da6a98dbc555018a29bf140ed8e890015240b322 Mon Sep 17 00:00:00 2001 From: alwin Date: Fri, 23 Apr 2004 13:22:22 +0000 Subject: 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. --- (limited to 'noncore/graphics/opie-eye/gui/imageview.cpp') 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 @@ -110,7 +110,6 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) odebug << "Popup " << oendl; QPopupMenu *m = new QPopupMenu(0); if (!m) return; - bool old = fullScreen(); m->insertItem(tr("Toggle fullscreen"),this, SIGNAL(toggleFullScreen())); if (fullScreen()) { m->insertSeparator(); @@ -129,6 +128,13 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) void ImageView::setFullScreen(bool how) { m_isFullScreen = how; + if (how) { + m_ignore_next_in = true; + setFixedSize(qApp->desktop()->size()); + showFullScreen(); + } else { + setMinimumSize(10,10); + } } void ImageView::focusInEvent(QFocusEvent *) @@ -140,29 +146,29 @@ void ImageView::focusInEvent(QFocusEvent *) if (fullScreen()) enableFullscreen(); } +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; if (m_ignore_next_in) {m_ignore_next_in = false;return;} 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. /* this is the trick - I don't now why, but after a showFullScreen QTE toggles the focus * so we must block it here! */ 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()); } + -- cgit v0.9.0.2