summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/imageview.cpp
authoralwin <alwin>2004-04-20 22:58:27 (UTC)
committer alwin <alwin>2004-04-20 22:58:27 (UTC)
commitc61b410ba0051c266501933f7f675291684613f8 (patch) (side-by-side diff)
tree2bdb8278bb271bcb305652dea528709735b0a08d /noncore/graphics/opie-eye/gui/imageview.cpp
parent4348554f74290f477af9a338cdabf363883c9472 (diff)
downloadopie-c61b410ba0051c266501933f7f675291684613f8.zip
opie-c61b410ba0051c266501933f7f675291684613f8.tar.gz
opie-c61b410ba0051c266501933f7f675291684613f8.tar.bz2
some gui stuff - fullscreen now works better on smallscreen, bigscreen
has some more problems...
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.cpp46
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
@@ -5,6 +5,8 @@
#include <opie2/okeyconfigwidget.h>
#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
+#include <qpopupmenu.h>
using namespace Opie::Core;
@@ -14,11 +16,13 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name
m_viewManager = 0;
m_cfg = cfg;
m_isFullScreen = false;
+ QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold);
initKeys();
}
ImageView::~ImageView()
{
+ odebug << "Delete Imageview" << oendl;
if (m_viewManager) {
delete m_viewManager;
}
@@ -48,14 +52,24 @@ void ImageView::initKeys()
m_viewManager = new Opie::Core::OKeyConfigManager(m_cfg, "image_view_keys",
lst, false,this, "image_view_keys" );
+
m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("View Image Info"), "imageviewinfo",
Resource::loadPixmap("1to1"), ViewInfo,
Opie::Core::OKeyPair(Qt::Key_I,0),
this, SLOT(slotShowImageInfo())));
+ 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())));
m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Switch to previous image"), "imageshowprev",
Resource::loadPixmap("back"), ShowPrevious,
@@ -85,3 +99,33 @@ void ImageView::slotShowImageInfo()
{
emit dispImageInfo(m_lastName);
}
+
+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;
+}