author | alwin <alwin> | 2005-03-24 21:13:40 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-24 21:13:40 (UTC) |
commit | b6fc9840f4fe9bad392167c49dbcfa2acda9ed21 (patch) (unidiff) | |
tree | 1d7d1225a9c440f5d0608d8901dfd151db8a6f1c | |
parent | 1e6c3181dcc7ec4edbe99db0d886ce7a9c483056 (diff) | |
download | opie-b6fc9840f4fe9bad392167c49dbcfa2acda9ed21.zip opie-b6fc9840f4fe9bad392167c49dbcfa2acda9ed21.tar.gz opie-b6fc9840f4fe9bad392167c49dbcfa2acda9ed21.tar.bz2 |
last bugfixes on opie-eye an imagescrollview. Seems that now all is working
as it should.
-rw-r--r-- | libopie2/opiemm/oimagescrollview.cpp | 5 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 5 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 13 |
3 files changed, 15 insertions, 8 deletions
diff --git a/libopie2/opiemm/oimagescrollview.cpp b/libopie2/opiemm/oimagescrollview.cpp index 10da823..76f50e1 100644 --- a/libopie2/opiemm/oimagescrollview.cpp +++ b/libopie2/opiemm/oimagescrollview.cpp | |||
@@ -204,8 +204,9 @@ void OImageScrollView::setAutoScale(bool how) | |||
204 | _image_data = QImage(); | 204 | _image_data = QImage(); |
205 | if (ImageIsJpeg() && how == false && ImageScaledLoaded()==true) { | 205 | if (ImageIsJpeg() && how == false && ImageScaledLoaded()==true) { |
206 | loadJpeg(true); | 206 | loadJpeg(true); |
207 | } | 207 | } |
208 | _newImage = true; | ||
208 | generateImage(); | 209 | generateImage(); |
209 | } | 210 | } |
210 | 211 | ||
211 | bool OImageScrollView::AutoScale()const | 212 | bool OImageScrollView::AutoScale()const |
@@ -347,10 +348,12 @@ void OImageScrollView::rotate_into_data(Rotation r) | |||
347 | 348 | ||
348 | // yes - sorry - it is NOT gamma it is just BRIGHTNESS. Alwin | 349 | // yes - sorry - it is NOT gamma it is just BRIGHTNESS. Alwin |
349 | void OImageScrollView::apply_gamma(int aValue) | 350 | void OImageScrollView::apply_gamma(int aValue) |
350 | { | 351 | { |
351 | if (!_image_data.size().isValid()) return; | 352 | if (aValue==0 || !_image_data.size().isValid()) return; |
352 | float percent = ((float)aValue/100.0); | 353 | float percent = ((float)aValue/100.0); |
354 | /* make sure working on a copy */ | ||
355 | _image_data.detach(); | ||
353 | 356 | ||
354 | int segColors = _image_data.depth() > 8 ? 256 : _image_data.numColors(); | 357 | int segColors = _image_data.depth() > 8 ? 256 : _image_data.numColors(); |
355 | /* must be - otherwise it displays some ... strange colors */ | 358 | /* must be - otherwise it displays some ... strange colors */ |
356 | if (segColors<256) segColors=256; | 359 | if (segColors<256) segColors=256; |
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index 994fe12..b919ca8 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp | |||
@@ -45,8 +45,9 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name | |||
45 | 45 | ||
46 | m_sysChannel = new QCopChannel( "QPE/System", this ); | 46 | m_sysChannel = new QCopChannel( "QPE/System", this ); |
47 | connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), | 47 | connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), |
48 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); | 48 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); |
49 | setKeyCompression(true); | ||
49 | } | 50 | } |
50 | 51 | ||
51 | void ImageView::slotIncBrightness() | 52 | void ImageView::slotIncBrightness() |
52 | { | 53 | { |
@@ -65,13 +66,11 @@ void ImageView::slotDecBrightness() | |||
65 | void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) | 66 | void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) |
66 | { | 67 | { |
67 | int _newrotation; | 68 | int _newrotation; |
68 | QDataStream stream( data, IO_ReadOnly ); | 69 | QDataStream stream( data, IO_ReadOnly ); |
69 | odebug << "received system message: " << msg << oendl; | ||
70 | if ( msg == "setCurrentRotation(int)" ) | 70 | if ( msg == "setCurrentRotation(int)" ) |
71 | { | 71 | { |
72 | stream >> _newrotation; | 72 | stream >> _newrotation; |
73 | odebug << "received setCurrentRotation(" << _newrotation << ")" << oendl; | ||
74 | if (!fullScreen()) { | 73 | if (!fullScreen()) { |
75 | m_rotation = _newrotation; | 74 | m_rotation = _newrotation; |
76 | return; | 75 | return; |
77 | } | 76 | } |
@@ -235,9 +234,8 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) | |||
235 | { | 234 | { |
236 | if (e->button()==1) { | 235 | if (e->button()==1) { |
237 | return OImageScrollView::contentsMousePressEvent(e); | 236 | return OImageScrollView::contentsMousePressEvent(e); |
238 | } | 237 | } |
239 | odebug << "Popup " << oendl; | ||
240 | QPopupMenu *m = new QPopupMenu(this); | 238 | QPopupMenu *m = new QPopupMenu(this); |
241 | if (!m) return; | 239 | if (!m) return; |
242 | if (m_hGroup) { | 240 | if (m_hGroup) { |
243 | m_hGroup->addTo(m); | 241 | m_hGroup->addTo(m); |
@@ -288,9 +286,8 @@ void ImageView::setFullScreen(bool how,bool force) | |||
288 | 286 | ||
289 | void ImageView::focusInEvent(QFocusEvent *) | 287 | void ImageView::focusInEvent(QFocusEvent *) |
290 | { | 288 | { |
291 | // Always do it here, no matter the size. | 289 | // Always do it here, no matter the size. |
292 | odebug << "Focus in (view)" << oendl; | ||
293 | //if (fullScreen()) parentWidget()->showNormal(); | 290 | //if (fullScreen()) parentWidget()->showNormal(); |
294 | if (m_ignore_next_in){m_ignore_next_in=false;return;} | 291 | if (m_ignore_next_in){m_ignore_next_in=false;return;} |
295 | if (fullScreen()) enableFullscreen(); | 292 | if (fullScreen()) enableFullscreen(); |
296 | } | 293 | } |
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 4ee252f..3efbb53 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -648,8 +648,9 @@ void PMainWindow::setupActions() | |||
648 | connect(m_setCurrentBrightness,SIGNAL(activated()),this,SLOT(setupBrightness())); | 648 | connect(m_setCurrentBrightness,SIGNAL(activated()),this,SLOT(setupBrightness())); |
649 | m_IncBrightness = new QAction(tr("Increase brightness by 5"),Resource::loadIconSet( "up" ),0, 0, this, 0, false); | 649 | m_IncBrightness = new QAction(tr("Increase brightness by 5"),Resource::loadIconSet( "up" ),0, 0, this, 0, false); |
650 | m_DecBrightness = new QAction(tr("Decrease brightness by 5"),Resource::loadIconSet( "down" ),0, 0, this, 0, false); | 650 | m_DecBrightness = new QAction(tr("Decrease brightness by 5"),Resource::loadIconSet( "down" ),0, 0, this, 0, false); |
651 | m_hBright = new QActionGroup(this,"actioncollection",false), | 651 | m_hBright = new QActionGroup(this,"actioncollection",false), |
652 | m_hBright->insert(m_setCurrentBrightness); | ||
652 | m_hBright->insert(m_IncBrightness); | 653 | m_hBright->insert(m_IncBrightness); |
653 | m_hBright->insert(m_DecBrightness); | 654 | m_hBright->insert(m_DecBrightness); |
654 | } | 655 | } |
655 | 656 | ||
@@ -657,12 +658,21 @@ void PMainWindow::setupBrightness() | |||
657 | { | 658 | { |
658 | if (!m_disp) { | 659 | if (!m_disp) { |
659 | return; | 660 | return; |
660 | } | 661 | } |
662 | bool reshow=false; | ||
663 | if (m_disp->isVisible()&&m_disp->fullScreen()) { | ||
664 | m_disp->hide(); | ||
665 | reshow = true; | ||
666 | } | ||
661 | int lb = m_disp->Intensity(); | 667 | int lb = m_disp->Intensity(); |
662 | if (Valuebox(0,-100,100,lb,lb)) { | 668 | if (Valuebox(0,-100,100,lb,lb)) { |
663 | m_disp->setIntensity(lb,true); | 669 | m_disp->setIntensity(lb,true); |
664 | } | 670 | } |
671 | if (reshow) { | ||
672 | m_disp->showFullScreen(); | ||
673 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); | ||
674 | } | ||
665 | } | 675 | } |
666 | 676 | ||
667 | void PMainWindow::setupToolbar() | 677 | void PMainWindow::setupToolbar() |
668 | { | 678 | { |
@@ -682,9 +692,8 @@ void PMainWindow::setupToolbar() | |||
682 | m_aBeam->addTo( toolBar ); | 692 | m_aBeam->addTo( toolBar ); |
683 | } | 693 | } |
684 | m_aShowInfo->addTo(toolBar); | 694 | m_aShowInfo->addTo(toolBar); |
685 | m_aTrash->addTo(toolBar); | 695 | m_aTrash->addTo(toolBar); |
686 | // m_aSetup->addTo(toolBar); | ||
687 | 696 | ||
688 | m_gDisplayType->addTo(toolBar); | 697 | m_gDisplayType->addTo(toolBar); |
689 | 698 | ||
690 | if (!m_SmallWindow) { | 699 | if (!m_SmallWindow) { |
@@ -729,10 +738,8 @@ void PMainWindow::setupMenu() | |||
729 | m_aFullScreen->addTo(dispMenu); | 738 | m_aFullScreen->addTo(dispMenu); |
730 | m_gDisplayType->addTo(dispMenu); | 739 | m_gDisplayType->addTo(dispMenu); |
731 | dispMenu->insertSeparator(); | 740 | dispMenu->insertSeparator(); |
732 | m_gPrevNext->addTo(dispMenu); | 741 | m_gPrevNext->addTo(dispMenu); |
733 | m_setCurrentBrightness->addTo(dispMenu); | ||
734 | m_setCurrentBrightness->setEnabled(false); | ||
735 | dispMenu->insertSeparator(); | 742 | dispMenu->insertSeparator(); |
736 | m_hBright->addTo(dispMenu); | 743 | m_hBright->addTo(dispMenu); |
737 | m_hBright->setEnabled(false); | 744 | m_hBright->setEnabled(false); |
738 | 745 | ||