-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 37 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.h | 7 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 22 |
3 files changed, 55 insertions, 11 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 @@ -8,2 +8,4 @@ #include <qpe/qpeapplication.h> +#include <qpe/qcopenvelope_qws.h> + #include <qpopupmenu.h> @@ -29,3 +31,31 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name m_hGroup = 0; + m_Rotated = false; closeIfHide = false; + int min = QApplication::desktop()->size().width()>QApplication::desktop()->size().height()? + QApplication::desktop()->size().height():QApplication::desktop()->size().width(); + if (min>320) { + // bigscreen + setMinimumSize(min/3,min/3); + } else { + setMinimumSize(10,10); + } + m_sysChannel = new QCopChannel( "QPE/System", this ); + connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), + this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); +} + +void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) +{ + int _newrotation; + QDataStream stream( data, IO_ReadOnly ); + odebug << "received system message: " << msg << oendl; + if ( msg == "setCurrentRotation(int)" ) + { + stream >> _newrotation; + odebug << "received setCurrentRotation(" << _newrotation << ")" << oendl; + if (!fullScreen()) { + m_rotation = _newrotation; + return; + } + } } @@ -181,3 +211,3 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) odebug << "Popup " << oendl; - QPopupMenu *m = new QPopupMenu(0); + QPopupMenu *m = new QPopupMenu(this); if (!m) return; @@ -215,6 +245,7 @@ void ImageView::setFullScreen(bool how,bool force) m_ignore_next_in = true; - setFixedSize(qApp->desktop()->size()); +// setFixedSize(qApp->desktop()->size()); + setGeometry(0,0,qApp->desktop()->size().width(),qApp->desktop()->size().height()); if (force) showFullScreen(); } else { - setMinimumSize(10,10); +// setMinimumSize(10,10); } diff --git a/noncore/graphics/opie-eye/gui/imageview.h b/noncore/graphics/opie-eye/gui/imageview.h index f1067bb..e8c8df7 100644 --- a/noncore/graphics/opie-eye/gui/imageview.h +++ b/noncore/graphics/opie-eye/gui/imageview.h @@ -11,2 +11,4 @@ class QAction; +class QCopChannel; + namespace Opie { @@ -59,2 +61,4 @@ protected: bool m_ignore_next_in:1; + bool m_Rotated:1; + int focus_in_count; @@ -65,2 +69,4 @@ protected: bool closeIfHide:1; + QCopChannel* m_sysChannel; + int m_rotation; @@ -70,2 +76,3 @@ public slots: virtual void nextSlide(); + virtual void systemMessage( const QCString&, const QByteArray& ); diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 7570ee3..90e2e99 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp @@ -257,3 +257,3 @@ void PMainWindow::initDisp() { if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { - m_disp->setMinimumSize(QApplication::desktop()->size()/2); + //m_disp->setMinimumSize(QApplication::desktop()->size()/2); } @@ -296,3 +296,5 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay) { - if (!m_disp) return; + if (!m_disp) { + return; + } if (current) { @@ -303,2 +305,3 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay) m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); + m_disp->setFullScreen(current,forceDisplay); } else { @@ -306,8 +309,9 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay) if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { - m_disp->setMinimumSize(QApplication::desktop()->size()/2); + + //m_disp->setMinimumSize(QApplication::desktop()->size()/2); } else { - m_disp->setMinimumSize(10,10); + //m_disp->setMinimumSize(10,10); } if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { - m_disp->reparent(0,QPoint(50,50)); + m_disp->reparent(0,QPoint(10,10)); } else { @@ -319,6 +323,8 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay) m_disp->setHScrollBarMode(QScrollView::Auto); - if (forceDisplay || m_disp->isVisible()) - m_stack->raiseWidget(m_disp); if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { - m_disp->resize(m_disp->minimumSize()); + m_disp->setGeometry(30,30,QApplication::desktop()->width()-60,QApplication::desktop()->height()-60); + } + if (forceDisplay || m_disp->isVisible()) { + m_stack->raiseWidget(m_disp); + m_disp->setFocus(); } |