Diffstat (limited to 'noncore/graphics/opie-eye/gui/imageview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index ac6474c..03df321 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp | |||
@@ -3,12 +3,14 @@ | |||
3 | #include <opie2/odebug.h> | 3 | #include <opie2/odebug.h> |
4 | #include <opie2/oconfig.h> | 4 | #include <opie2/oconfig.h> |
5 | #include <opie2/okeyconfigwidget.h> | 5 | #include <opie2/okeyconfigwidget.h> |
6 | 6 | ||
7 | #include <qpe/resource.h> | 7 | #include <qpe/resource.h> |
8 | #include <qpe/qpeapplication.h> | 8 | #include <qpe/qpeapplication.h> |
9 | #include <qpe/qcopenvelope_qws.h> | ||
10 | |||
9 | #include <qpopupmenu.h> | 11 | #include <qpopupmenu.h> |
10 | #include <qtimer.h> | 12 | #include <qtimer.h> |
11 | #include <qaction.h> | 13 | #include <qaction.h> |
12 | 14 | ||
13 | using namespace Opie::Core; | 15 | using namespace Opie::Core; |
14 | 16 | ||
@@ -24,13 +26,41 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name | |||
24 | QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold); | 26 | QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold); |
25 | initKeys(); | 27 | initKeys(); |
26 | m_slideValue = 5; | 28 | m_slideValue = 5; |
27 | m_gDisplayType = 0; | 29 | m_gDisplayType = 0; |
28 | m_gPrevNext = 0; | 30 | m_gPrevNext = 0; |
29 | m_hGroup = 0; | 31 | m_hGroup = 0; |
32 | m_Rotated = false; | ||
30 | closeIfHide = false; | 33 | closeIfHide = false; |
34 | int min = QApplication::desktop()->size().width()>QApplication::desktop()->size().height()? | ||
35 | QApplication::desktop()->size().height():QApplication::desktop()->size().width(); | ||
36 | if (min>320) { | ||
37 | // bigscreen | ||
38 | setMinimumSize(min/3,min/3); | ||
39 | } else { | ||
40 | setMinimumSize(10,10); | ||
41 | } | ||
42 | m_sysChannel = new QCopChannel( "QPE/System", this ); | ||
43 | connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), | ||
44 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); | ||
45 | } | ||
46 | |||
47 | void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) | ||
48 | { | ||
49 | int _newrotation; | ||
50 | QDataStream stream( data, IO_ReadOnly ); | ||
51 | odebug << "received system message: " << msg << oendl; | ||
52 | if ( msg == "setCurrentRotation(int)" ) | ||
53 | { | ||
54 | stream >> _newrotation; | ||
55 | odebug << "received setCurrentRotation(" << _newrotation << ")" << oendl; | ||
56 | if (!fullScreen()) { | ||
57 | m_rotation = _newrotation; | ||
58 | return; | ||
59 | } | ||
60 | } | ||
31 | } | 61 | } |
32 | 62 | ||
33 | void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup) | 63 | void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup) |
34 | { | 64 | { |
35 | m_gDisplayType = disptypeGroup; | 65 | m_gDisplayType = disptypeGroup; |
36 | m_gPrevNext = nextprevGroup; | 66 | m_gPrevNext = nextprevGroup; |
@@ -176,13 +206,13 @@ void ImageView::slotShowImageInfo() | |||
176 | void ImageView::contentsMousePressEvent ( QMouseEvent * e) | 206 | void ImageView::contentsMousePressEvent ( QMouseEvent * e) |
177 | { | 207 | { |
178 | if (e->button()==1) { | 208 | if (e->button()==1) { |
179 | return OImageScrollView::contentsMousePressEvent(e); | 209 | return OImageScrollView::contentsMousePressEvent(e); |
180 | } | 210 | } |
181 | odebug << "Popup " << oendl; | 211 | odebug << "Popup " << oendl; |
182 | QPopupMenu *m = new QPopupMenu(0); | 212 | QPopupMenu *m = new QPopupMenu(this); |
183 | if (!m) return; | 213 | if (!m) return; |
184 | if (m_hGroup) { | 214 | if (m_hGroup) { |
185 | m_hGroup->addTo(m); | 215 | m_hGroup->addTo(m); |
186 | } | 216 | } |
187 | if (fullScreen()) { | 217 | if (fullScreen()) { |
188 | if (m_gPrevNext) { | 218 | if (m_gPrevNext) { |
@@ -210,16 +240,17 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) | |||
210 | 240 | ||
211 | void ImageView::setFullScreen(bool how,bool force) | 241 | void ImageView::setFullScreen(bool how,bool force) |
212 | { | 242 | { |
213 | m_isFullScreen = how; | 243 | m_isFullScreen = how; |
214 | if (how) { | 244 | if (how) { |
215 | m_ignore_next_in = true; | 245 | m_ignore_next_in = true; |
216 | setFixedSize(qApp->desktop()->size()); | 246 | // setFixedSize(qApp->desktop()->size()); |
247 | setGeometry(0,0,qApp->desktop()->size().width(),qApp->desktop()->size().height()); | ||
217 | if (force) showFullScreen(); | 248 | if (force) showFullScreen(); |
218 | } else { | 249 | } else { |
219 | setMinimumSize(10,10); | 250 | // setMinimumSize(10,10); |
220 | } | 251 | } |
221 | } | 252 | } |
222 | 253 | ||
223 | void ImageView::focusInEvent(QFocusEvent *) | 254 | void ImageView::focusInEvent(QFocusEvent *) |
224 | { | 255 | { |
225 | // Always do it here, no matter the size. | 256 | // Always do it here, no matter the size. |