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 @@ | |||
7 | #include <qpe/resource.h> | 7 | #include <qpe/resource.h> |
8 | #include <qpe/qpeapplication.h> | ||
9 | #include <qpopupmenu.h> | ||
8 | 10 | ||
@@ -16,2 +18,3 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name | |||
16 | m_isFullScreen = false; | 18 | m_isFullScreen = false; |
19 | QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold); | ||
17 | initKeys(); | 20 | initKeys(); |
@@ -21,2 +24,3 @@ ImageView::~ImageView() | |||
21 | { | 24 | { |
25 | odebug << "Delete Imageview" << oendl; | ||
22 | if (m_viewManager) { | 26 | if (m_viewManager) { |
@@ -50,2 +54,3 @@ void ImageView::initKeys() | |||
50 | lst, false,this, "image_view_keys" ); | 54 | lst, false,this, "image_view_keys" ); |
55 | |||
51 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", | 56 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", |
@@ -55,5 +60,14 @@ void ImageView::initKeys() | |||
55 | 60 | ||
61 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle autorotate"), "imageautorotate", | ||
62 | Resource::loadPixmap("rotate"), Autorotate, | ||
63 | Opie::Core::OKeyPair(Qt::Key_R,0), | ||
64 | this, SIGNAL(toggleAutorotate()))); | ||
65 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle autoscale"), "imageautoscale", | ||
66 | Resource::loadPixmap("1to1"), Autoscale, | ||
67 | Opie::Core::OKeyPair(Qt::Key_S,0), | ||
68 | this, SIGNAL(toggleAutoscale()))); | ||
69 | |||
56 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Switch to next image"), "imageshownext", | 70 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Switch to next image"), "imageshownext", |
57 | Resource::loadPixmap("forward"), ShowNext, | 71 | Resource::loadPixmap("forward"), ShowNext, |
58 | Opie::Core::OKeyPair(Qt::Key_N,0), | 72 | Opie::Core::OKeyPair(Qt::Key_Return,0), |
59 | this, SIGNAL(dispNext()))); | 73 | this, SIGNAL(dispNext()))); |
@@ -87 +101,31 @@ void ImageView::slotShowImageInfo() | |||
87 | } | 101 | } |
102 | |||
103 | void ImageView::contentsMousePressEvent ( QMouseEvent * e) | ||
104 | { | ||
105 | if (e->button()==1) { | ||
106 | return OImageScrollView::contentsMousePressEvent(e); | ||
107 | } | ||
108 | if (!fullScreen()) return; | ||
109 | #if 0 | ||
110 | // doesn't work right (repainting problems) | ||
111 | odebug << "Popup " << oendl; | ||
112 | QPopupMenu *m = new QPopupMenu(0); | ||
113 | if (!m) return; | ||
114 | m->insertItem(tr("Previous image"),ShowPrevious); | ||
115 | m->insertItem(tr("Next image"),ShowNext); | ||
116 | m->insertSeparator(); | ||
117 | m->insertItem(tr("Toggle fullscreen"),FullScreen); | ||
118 | m->insertItem(tr("Toggle autoscale"),Autoscale); | ||
119 | m->insertItem(tr("Toggle autorotate"),Autorotate); | ||
120 | m->insertItem(tr("Toggle thumbnail"),Zoomer); | ||
121 | m->setFocus(); | ||
122 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | ||
123 | delete m; | ||
124 | parentWidget()->showFullScreen(); | ||
125 | #endif | ||
126 | } | ||
127 | |||
128 | void ImageView::setFullScreen(bool how) | ||
129 | { | ||
130 | m_isFullScreen = how; | ||
131 | } | ||