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.cpp | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index 88a8bc6..5b34ca2 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp @@ -7,2 +7,4 @@ #include <qpe/resource.h> +#include <qpe/qpeapplication.h> +#include <qpopupmenu.h> @@ -16,2 +18,3 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name m_isFullScreen = false; + QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold); initKeys(); @@ -21,2 +24,3 @@ ImageView::~ImageView() { + odebug << "Delete Imageview" << oendl; if (m_viewManager) { @@ -50,2 +54,3 @@ void ImageView::initKeys() lst, false,this, "image_view_keys" ); + m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", @@ -55,5 +60,14 @@ void ImageView::initKeys() + m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle autorotate"), "imageautorotate", + Resource::loadPixmap("rotate"), Autorotate, + Opie::Core::OKeyPair(Qt::Key_R,0), + this, SIGNAL(toggleAutorotate()))); + m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle autoscale"), "imageautoscale", + Resource::loadPixmap("1to1"), Autoscale, + Opie::Core::OKeyPair(Qt::Key_S,0), + this, SIGNAL(toggleAutoscale()))); + m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Switch to next image"), "imageshownext", Resource::loadPixmap("forward"), ShowNext, - Opie::Core::OKeyPair(Qt::Key_N,0), + Opie::Core::OKeyPair(Qt::Key_Return,0), this, SIGNAL(dispNext()))); @@ -87 +101,31 @@ void ImageView::slotShowImageInfo() } + +void ImageView::contentsMousePressEvent ( QMouseEvent * e) +{ + if (e->button()==1) { + return OImageScrollView::contentsMousePressEvent(e); + } + if (!fullScreen()) return; +#if 0 + // doesn't work right (repainting problems) + 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); + m->setFocus(); + m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); + delete m; + parentWidget()->showFullScreen(); +#endif +} + +void ImageView::setFullScreen(bool how) +{ + m_isFullScreen = how; +} |