summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp53
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.h2
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp7
3 files changed, 49 insertions, 13 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp
index 5b34ca2..53376c0 100644
--- a/noncore/graphics/opie-eye/gui/imageview.cpp
+++ b/noncore/graphics/opie-eye/gui/imageview.cpp
@@ -107,5 +107,3 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e)
}
- if (!fullScreen()) return;
-#if 0
- // doesn't work right (repainting problems)
+// if (!fullScreen()) return;
odebug << "Popup " << oendl;
@@ -113,9 +111,13 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e)
if (!m) return;
- m->insertItem(tr("Previous image"),ShowPrevious);
- m->insertItem(tr("Next image"),ShowNext);
- m->insertSeparator();
- m->insertItem(tr("Toggle fullscreen"),FullScreen);
- m->insertItem(tr("Toggle autoscale"),Autoscale);
- m->insertItem(tr("Toggle autorotate"),Autorotate);
- m->insertItem(tr("Toggle thumbnail"),Zoomer);
+ bool old = fullScreen();
+ m->insertItem(tr("Toggle fullscreen"),this, SIGNAL(toggleFullScreen()));
+ if (fullScreen()) {
+ m->insertSeparator();
+ m->insertItem(tr("Previous image"),this,SIGNAL(dispPrev()));
+ m->insertItem(tr("Next image"),this,SIGNAL(dispNext()));
+ m->insertSeparator();
+ m->insertItem(tr("Toggle autoscale"),this, SIGNAL(toggleAutoscale()));
+ m->insertItem(tr("Toggle autorotate"),this, SIGNAL(toggleAutorotate()));
+ m->insertItem(tr("Toggle thumbnail"),this, SIGNAL(toggleZoomer()));
+ }
m->setFocus();
@@ -123,4 +125,8 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e)
delete m;
- parentWidget()->showFullScreen();
-#endif
+ /* if we were fullScreen() and must overlap the taskbar again */
+ if (fullScreen() && old) {
+ enableFullscreen();
+// parentWidget()->hide();
+// parentWidget()->show();
+ }
}
@@ -131 +137,24 @@ void ImageView::setFullScreen(bool how)
}
+
+void ImageView::focusInEvent(QFocusEvent *)
+{
+ // Always do it here, no matter the size.
+ /* result in an endless loop */
+// if (fullScreen()) enableFullscreen();
+}
+
+void ImageView::enableFullscreen()
+{
+ if (!fullScreen()) return;
+ // Make sure size is correct
+ parentWidget()->setFixedSize(qApp->desktop()->size());
+ // This call is needed because showFullScreen won't work
+ // correctly if the widget already considers itself to be fullscreen.
+ 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));
+ // Enable fullscreen.
+ parentWidget()->showFullScreen();
+}
+
diff --git a/noncore/graphics/opie-eye/gui/imageview.h b/noncore/graphics/opie-eye/gui/imageview.h
index 445bee9..4d2405f 100644
--- a/noncore/graphics/opie-eye/gui/imageview.h
+++ b/noncore/graphics/opie-eye/gui/imageview.h
@@ -48,2 +48,3 @@ protected:
bool m_isFullScreen:1;
+ void enableFullscreen();
@@ -53,2 +54,3 @@ protected slots:
virtual void contentsMousePressEvent ( QMouseEvent * e);
+ virtual void focusInEvent ( QFocusEvent * );
};
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index a784f5b..58f02ef 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -331,3 +331,3 @@ void PMainWindow::slotToggleFullScreen()
if (!tFrame) {
- tFrame = new QWidget(0,0,WType_TopLevel|WStyle_NoBorder|WStyle_StaysOnTop);
+ tFrame = new QWidget(0,0,WStyle_Customize|WStyle_NoBorder);
tFrame->resize(qApp->desktop()->width(), qApp->desktop()->height());
@@ -341,2 +341,3 @@ void PMainWindow::slotToggleFullScreen()
} else {
+ setUpdatesEnabled(false);
odebug << "window" << oendl;
@@ -354,2 +355,3 @@ void PMainWindow::slotToggleFullScreen()
}
+ setUpdatesEnabled(true);
}
@@ -429,2 +431,3 @@ void PMainWindow::closeEvent( QCloseEvent* ev ) {
void PMainWindow::raiseIconView() {
+ setUpdatesEnabled(false);
if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) {
@@ -440,2 +443,4 @@ void PMainWindow::raiseIconView() {
m_stack->raiseWidget( IconView );
+ setUpdatesEnabled(true);
+ repaint();
}