summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/imageview.cpp
Unidiff
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.cpp41
1 files changed, 33 insertions, 8 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp
index 53376c0..5b00dea 100644
--- a/noncore/graphics/opie-eye/gui/imageview.cpp
+++ b/noncore/graphics/opie-eye/gui/imageview.cpp
@@ -11,12 +11,14 @@
11using namespace Opie::Core; 11using namespace Opie::Core;
12 12
13ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl ) 13ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl )
14 : Opie::MM::OImageScrollView(parent,name,fl) 14 : Opie::MM::OImageScrollView(parent,name,fl)
15{ 15{
16 m_viewManager = 0; 16 m_viewManager = 0;
17 m_focus_out = false;
18 block_next_focus = true;
17 m_cfg = cfg; 19 m_cfg = cfg;
18 m_isFullScreen = false; 20 m_isFullScreen = false;
19 QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold); 21 QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold);
20 initKeys(); 22 initKeys();
21} 23}
22 24
@@ -123,38 +125,61 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e)
123 m->setFocus(); 125 m->setFocus();
124 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); 126 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
125 delete m; 127 delete m;
126 /* if we were fullScreen() and must overlap the taskbar again */ 128 /* if we were fullScreen() and must overlap the taskbar again */
127 if (fullScreen() && old) { 129 if (fullScreen() && old) {
128 enableFullscreen(); 130 enableFullscreen();
129// parentWidget()->hide();
130// parentWidget()->show();
131 } 131 }
132} 132}
133 133
134void ImageView::setFullScreen(bool how) 134void ImageView::setFullScreen(bool how)
135{ 135{
136 m_isFullScreen = how; 136 m_isFullScreen = how;
137} 137}
138 138
139void ImageView::focusInEvent(QFocusEvent *) 139void ImageView::focusInEvent(QFocusEvent *)
140{ 140{
141 // Always do it here, no matter the size. 141 // Always do it here, no matter the size.
142 /* result in an endless loop */ 142 odebug << "Focus in" << oendl;
143// if (fullScreen()) enableFullscreen(); 143}
144
145void ImageView::focusOutEvent(QFocusEvent *)
146{
147 odebug << "Focus out" << oendl;
144} 148}
145 149
146void ImageView::enableFullscreen() 150void ImageView::enableFullscreen()
147{ 151{
148 if (!fullScreen()) return;
149 // Make sure size is correct
150 parentWidget()->setFixedSize(qApp->desktop()->size());
151 // This call is needed because showFullScreen won't work 152 // This call is needed because showFullScreen won't work
152 // correctly if the widget already considers itself to be fullscreen. 153 // correctly if the widget already considers itself to be fullscreen.
154 setUpdatesEnabled(false);
155 odebug << "showNormal();" << oendl;
153 parentWidget()->showNormal(); 156 parentWidget()->showNormal();
157 odebug << "showNormal(); done " << oendl;
154 // This is needed because showNormal() forcefully changes the window 158 // This is needed because showNormal() forcefully changes the window
155 // style to WSTyle_TopLevel. 159 // style to WSTyle_TopLevel.
160 odebug << " reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0));" << oendl;
156 parentWidget()->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); 161 parentWidget()->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0));
162 odebug << " reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); done" << oendl;
157 // Enable fullscreen. 163 // Enable fullscreen.
164 odebug << "showFullScreen();" << oendl;
158 parentWidget()->showFullScreen(); 165 parentWidget()->showFullScreen();
166 odebug << "showFullScreen(); done" << oendl;
167 setUpdatesEnabled(true);
168}
169
170void ImageWidget::show()
171{
172 QWidget::show();
159} 173}
160 174
175void ImageWidget::hide()
176{
177 QWidget::hide();
178}
179
180ImageWidget::ImageWidget(QWidget * parent, const char * name, WFlags f)
181 : QWidget(parent,name,f)
182{
183 // Make sure size is correct
184 setFixedSize(qApp->desktop()->size());
185}