summaryrefslogtreecommitdiff
authoralwin <alwin>2005-03-02 12:05:55 (UTC)
committer alwin <alwin>2005-03-02 12:05:55 (UTC)
commitb9d921e98946ee787ec995f44eb1b937d669b430 (patch) (unidiff)
tree7136aa32ca3d90c0b03ec21f855f32b7536eb339
parent374cb9f45664c307ab7d0ed88fea5e76631518d9 (diff)
downloadopie-b9d921e98946ee787ec995f44eb1b937d669b430.zip
opie-b9d921e98946ee787ec995f44eb1b937d669b430.tar.gz
opie-b9d921e98946ee787ec995f44eb1b937d669b430.tar.bz2
fixed some problems in bigscreen mode and when rotating
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp37
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.h7
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp22
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 @@
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>
@@ -29,3 +31,31 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name
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
47void 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}
@@ -181,3 +211,3 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e)
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;
@@ -215,6 +245,7 @@ void ImageView::setFullScreen(bool how,bool force)
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 }
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;
11 11
12class QCopChannel;
13
12namespace Opie { 14namespace Opie {
@@ -59,2 +61,4 @@ protected:
59 bool m_ignore_next_in:1; 61 bool m_ignore_next_in:1;
62 bool m_Rotated:1;
63
60 int focus_in_count; 64 int focus_in_count;
@@ -65,2 +69,4 @@ protected:
65 bool closeIfHide:1; 69 bool closeIfHide:1;
70 QCopChannel* m_sysChannel;
71 int m_rotation;
66 72
@@ -70,2 +76,3 @@ public slots:
70 virtual void nextSlide(); 76 virtual void nextSlide();
77 virtual void systemMessage( const QCString&, const QByteArray& );
71 78
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() {
257 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { 257 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
258 m_disp->setMinimumSize(QApplication::desktop()->size()/2); 258 //m_disp->setMinimumSize(QApplication::desktop()->size()/2);
259 } 259 }
@@ -296,3 +296,5 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay)
296{ 296{
297 if (!m_disp) return; 297 if (!m_disp) {
298 return;
299 }
298 if (current) { 300 if (current) {
@@ -303,2 +305,3 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay)
303 m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); 305 m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height());
306 m_disp->setFullScreen(current,forceDisplay);
304 } else { 307 } else {
@@ -306,8 +309,9 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay)
306 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { 309 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
307 m_disp->setMinimumSize(QApplication::desktop()->size()/2); 310
311 //m_disp->setMinimumSize(QApplication::desktop()->size()/2);
308 } else { 312 } else {
309 m_disp->setMinimumSize(10,10); 313 //m_disp->setMinimumSize(10,10);
310 } 314 }
311 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { 315 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
312 m_disp->reparent(0,QPoint(50,50)); 316 m_disp->reparent(0,QPoint(10,10));
313 } else { 317 } else {
@@ -319,6 +323,8 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay)
319 m_disp->setHScrollBarMode(QScrollView::Auto); 323 m_disp->setHScrollBarMode(QScrollView::Auto);
320 if (forceDisplay || m_disp->isVisible())
321 m_stack->raiseWidget(m_disp);
322 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { 324 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
323 m_disp->resize(m_disp->minimumSize()); 325 m_disp->setGeometry(30,30,QApplication::desktop()->width()-60,QApplication::desktop()->height()-60);
326 }
327 if (forceDisplay || m_disp->isVisible()) {
328 m_stack->raiseWidget(m_disp);
329 m_disp->setFocus();
324 } 330 }