summaryrefslogtreecommitdiff
authoralwin <alwin>2004-04-16 20:35:35 (UTC)
committer alwin <alwin>2004-04-16 20:35:35 (UTC)
commit217d387def6d97f912352899fd83908b28d75dfc (patch) (unidiff)
tree14135801a52bbbfca4395a4cbf4b7fdffdeb45ad
parentcc56768485c3785439883dd1c456493f7ece2d84 (diff)
downloadopie-217d387def6d97f912352899fd83908b28d75dfc.zip
opie-217d387def6d97f912352899fd83908b28d75dfc.tar.gz
opie-217d387def6d97f912352899fd83908b28d75dfc.tar.bz2
Implemented fullscreen mode (f-key)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp11
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.h8
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp26
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.h1
4 files changed, 38 insertions, 8 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp
index fbc4494..8e7f982 100644
--- a/noncore/graphics/opie-eye/gui/imageview.cpp
+++ b/noncore/graphics/opie-eye/gui/imageview.cpp
@@ -15,2 +15,3 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name
15 m_cfg = cfg; 15 m_cfg = cfg;
16 m_isFullScreen = false;
16 initKeys(); 17 initKeys();
@@ -47,2 +48,3 @@ void ImageView::initKeys()
47 lst.append( Opie::Core::OKeyPair(Qt::Key_P,0)); 48 lst.append( Opie::Core::OKeyPair(Qt::Key_P,0));
49 lst.append( Opie::Core::OKeyPair(Qt::Key_F,0));
48 50
@@ -52,10 +54,4 @@ void ImageView::initKeys()
52 Resource::loadPixmap("1to1"), ViewInfo, 54 Resource::loadPixmap("1to1"), ViewInfo,
53 Opie::Core::OKeyPair(Qt::Key_I,Qt::ShiftButton), 55 Opie::Core::OKeyPair(Qt::Key_I,0),
54 this, SLOT(slotShowImageInfo()))); 56 this, SLOT(slotShowImageInfo())));
55#if 0
56 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Next image"), "nextimage",
57 Resource::loadPixmap("next"), ViewInfo,
58 Opie::Core::OKeyPair(Qt::Key_N,0),
59 this, SLOT(slotDispNext())));
60#endif
61 m_viewManager->handleWidget( this ); 57 m_viewManager->handleWidget( this );
@@ -71,2 +67,3 @@ void ImageView::keyReleaseEvent(QKeyEvent * e)
71 if (e->key()==Qt::Key_P) slotDispPrev(); 67 if (e->key()==Qt::Key_P) slotDispPrev();
68 if (e->key()==Qt::Key_F) emit toggleFullScreen();
72} 69}
diff --git a/noncore/graphics/opie-eye/gui/imageview.h b/noncore/graphics/opie-eye/gui/imageview.h
index f467f00..32f7e11 100644
--- a/noncore/graphics/opie-eye/gui/imageview.h
+++ b/noncore/graphics/opie-eye/gui/imageview.h
@@ -17,3 +17,4 @@ class ImageView:public Opie::MM::OImageScrollView
17 enum ActionIds { 17 enum ActionIds {
18 ViewInfo 18 ViewInfo,
19 FullScreen
19 }; 20 };
@@ -24,2 +25,4 @@ public:
24 Opie::Core::OKeyConfigManager* manager(); 25 Opie::Core::OKeyConfigManager* manager();
26 void setFullScreen(bool how){m_isFullScreen = how;}
27 bool fullScreen(){return m_isFullScreen;}
25 28
@@ -29,2 +32,3 @@ signals:
29 void dispPrev(); 32 void dispPrev();
33 void toggleFullScreen();
30 34
@@ -34,2 +38,4 @@ protected:
34 void initKeys(); 38 void initKeys();
39 bool m_isFullScreen:1;
40
35protected slots: 41protected slots:
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 4852bf6..9b929a1 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -281,2 +281,3 @@ void PMainWindow::initDisp() {
281 m_disp->setShowZoomer(zoomerOn); 281 m_disp->setShowZoomer(zoomerOn);
282 m_disp->setBackgroundColor(white);
282 connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); 283 connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&)));
@@ -284,2 +285,27 @@ void PMainWindow::initDisp() {
284 connect(m_disp,SIGNAL(dispPrev()),m_view,SLOT(slotShowPrev())); 285 connect(m_disp,SIGNAL(dispPrev()),m_view,SLOT(slotShowPrev()));
286 connect(m_disp,SIGNAL(toggleFullScreen()),this,SLOT(slotToggleFullScreen()));
287 }
288}
289
290void PMainWindow::slotToggleFullScreen()
291{
292 odebug << "Toggle full " << oendl;
293 if (!m_disp) return;
294 bool current = !m_disp->fullScreen();
295 m_disp->setFullScreen(current);
296 odebug << "Current = " << current << oendl;
297 if (current) {
298 odebug << "full" << oendl;
299 m_disp->setBackgroundColor(black);
300 m_disp->reparent(0,QPoint(0,0));
301 m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height());
302 m_disp->showFullScreen();
303 } else {
304 odebug << "window" << oendl;
305 m_disp->setBackgroundColor(white);
306 m_stack->addWidget(m_disp,ImageDisplay);
307 m_stack->raiseWidget(m_disp);
308 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
309 m_disp->resize(m_disp->minimumSize());
310 }
285 } 311 }
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h
index 1967ef7..4cfc39c 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.h
+++ b/noncore/graphics/opie-eye/gui/mainwindow.h
@@ -46,2 +46,3 @@ public slots:
46 void setDocument( const QString& ); 46 void setDocument( const QString& );
47 virtual void slotToggleFullScreen();
47 48