author | alwin <alwin> | 2005-03-02 12:05:55 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-02 12:05:55 (UTC) |
commit | b9d921e98946ee787ec995f44eb1b937d669b430 (patch) (side-by-side diff) | |
tree | 7136aa32ca3d90c0b03ec21f855f32b7536eb339 | |
parent | 374cb9f45664c307ab7d0ed88fea5e76631518d9 (diff) | |
download | opie-b9d921e98946ee787ec995f44eb1b937d669b430.zip opie-b9d921e98946ee787ec995f44eb1b937d669b430.tar.gz opie-b9d921e98946ee787ec995f44eb1b937d669b430.tar.bz2 |
fixed some problems in bigscreen mode and when rotating
-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 @@ -7,4 +7,6 @@ #include <qpe/resource.h> #include <qpe/qpeapplication.h> +#include <qpe/qcopenvelope_qws.h> + #include <qpopupmenu.h> #include <qtimer.h> @@ -28,5 +30,33 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name m_gPrevNext = 0; 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; + } + } } @@ -180,5 +210,5 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) } odebug << "Popup " << oendl; - QPopupMenu *m = new QPopupMenu(0); + QPopupMenu *m = new QPopupMenu(this); if (!m) return; if (m_hGroup) { @@ -214,8 +244,9 @@ void ImageView::setFullScreen(bool how,bool force) if (how) { 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 @@ -10,4 +10,6 @@ class QActionGroup; class QAction; +class QCopChannel; + namespace Opie { namespace Core { @@ -58,4 +60,6 @@ protected: bool m_isFullScreen:1; bool m_ignore_next_in:1; + bool m_Rotated:1; + int focus_in_count; QTimer*m_slideTimer; @@ -64,4 +68,6 @@ protected: QActionGroup *m_gDisplayType,*m_gPrevNext,*m_hGroup; bool closeIfHide:1; + QCopChannel* m_sysChannel; + int m_rotation; public slots: @@ -69,4 +75,5 @@ public slots: virtual void startSlide(int); virtual void nextSlide(); + virtual void systemMessage( const QCString&, const QByteArray& ); protected slots: 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 @@ -256,5 +256,5 @@ void PMainWindow::initDisp() { if (m_disp) { if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { - m_disp->setMinimumSize(QApplication::desktop()->size()/2); + //m_disp->setMinimumSize(QApplication::desktop()->size()/2); } m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType); @@ -295,5 +295,7 @@ void PMainWindow::slotFullScreenButton(bool current) void PMainWindow::setupViewWindow(bool current, bool forceDisplay) { - if (!m_disp) return; + if (!m_disp) { + return; + } if (current) { m_disp->setBackgroundColor(black); @@ -302,13 +304,15 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay) m_disp->setHScrollBarMode(QScrollView::AlwaysOff); m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); + m_disp->setFullScreen(current,forceDisplay); } else { setUpdatesEnabled(false); 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 { m_disp->reparent(0,QPoint(0,0)); @@ -318,8 +322,10 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay) m_disp->setVScrollBarMode(QScrollView::Auto); 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(); } setUpdatesEnabled(true); |