Diffstat (limited to 'noncore/graphics/opie-eye/gui/imageview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index 6c3f9cb..994fe12 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp @@ -31,2 +31,3 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name m_hGroup = 0; + m_gBright = 0; m_Rotated = false; @@ -41,2 +42,5 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name } + connect(this,SIGNAL(incBrightness()),this,SLOT(slotIncBrightness())); + connect(this,SIGNAL(decBrightness()),this,SLOT(slotDecBrightness())); + m_sysChannel = new QCopChannel( "QPE/System", this ); @@ -46,2 +50,16 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name +void ImageView::slotIncBrightness() +{ + int lb = Intensity()+5; + if (lb>100) lb=100; + setIntensity(lb,true); +} + +void ImageView::slotDecBrightness() +{ + int lb = Intensity()-5; + if (lb<-100) lb=-100; + setIntensity(lb,true); +} + void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) @@ -62,3 +80,3 @@ void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) -void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup) +void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup,QActionGroup*brightGroup) { @@ -67,2 +85,3 @@ void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, Q m_hGroup = hGroup; + m_gBright = brightGroup; } @@ -176,2 +195,11 @@ void ImageView::initKeys() this, SIGNAL(toggleZoomer()))); + + m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Increase brightness"), "incbrightness", + Resource::loadPixmap("up"), Incbrightness, + Opie::Core::OKeyPair(Qt::Key_B,0), + this, SIGNAL(incBrightness()))); + m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Decrease brightness"), "decbrightness", + Resource::loadPixmap("down"), Decbrightness, + Opie::Core::OKeyPair(Qt::Key_D,0), + this, SIGNAL(decBrightness()))); m_viewManager->handleWidget( this ); @@ -225,2 +253,6 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) } + if (m_gBright) { + m->insertSeparator(); + m_gBright->addTo(m); + } } @@ -237,2 +269,5 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) } + if (m_gBright) { + m_gBright->removeFrom(m); + } delete m; |