summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/imageview.cpp
authoralwin <alwin>2004-04-21 09:56:14 (UTC)
committer alwin <alwin>2004-04-21 09:56:14 (UTC)
commitf4ab243362a9b93f17e92bbf3189324f66c8f686 (patch) (side-by-side diff)
tree85fc40502c8a6fb76efb3ad2f2cf3f80c5af2cf6 /noncore/graphics/opie-eye/gui/imageview.cpp
parentc61b410ba0051c266501933f7f675291684613f8 (diff)
downloadopie-f4ab243362a9b93f17e92bbf3189324f66c8f686.zip
opie-f4ab243362a9b93f17e92bbf3189324f66c8f686.tar.gz
opie-f4ab243362a9b93f17e92bbf3189324f66c8f686.tar.bz2
polish on fullscreen mode
Diffstat (limited to 'noncore/graphics/opie-eye/gui/imageview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp53
1 files changed, 41 insertions, 12 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
@@ -105,27 +105,56 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e)
if (e->button()==1) {
return OImageScrollView::contentsMousePressEvent(e);
}
- if (!fullScreen()) return;
-#if 0
- // doesn't work right (repainting problems)
+// if (!fullScreen()) return;
odebug << "Popup " << oendl;
QPopupMenu *m = new QPopupMenu(0);
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();
m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
delete m;
- parentWidget()->showFullScreen();
-#endif
+ /* if we were fullScreen() and must overlap the taskbar again */
+ if (fullScreen() && old) {
+ enableFullscreen();
+// parentWidget()->hide();
+// parentWidget()->show();
+ }
}
void ImageView::setFullScreen(bool how)
{
m_isFullScreen = 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();
+}
+