author | alwin <alwin> | 2005-03-24 12:16:23 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-24 12:16:23 (UTC) |
commit | 4fbd94e2fd6432bb15e24e40be59426b309cbb9d (patch) (side-by-side diff) | |
tree | b78ecad37012bb66d956e22dbaa8cfcdb8cf67fc /noncore/graphics/opie-eye/gui/imageview.cpp | |
parent | c635023dd68edd0cb0cbb2827b926f33e27e0404 (diff) | |
download | opie-4fbd94e2fd6432bb15e24e40be59426b309cbb9d.zip opie-4fbd94e2fd6432bb15e24e40be59426b309cbb9d.tar.gz opie-4fbd94e2fd6432bb15e24e40be59426b309cbb9d.tar.bz2 |
- increased max-thumbnail-size
- shortcuts for inc/dec brightness
- make max thumbnail size as a static so there is one point in code
where it is stored and not 4 time over the whole code
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 @@ -29,6 +29,7 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name m_gDisplayType = 0; m_gPrevNext = 0; m_hGroup = 0; + m_gBright = 0; m_Rotated = false; closeIfHide = false; int min = QApplication::desktop()->size().width()>QApplication::desktop()->size().height()? @@ -39,11 +40,28 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name } else { setMinimumSize(10,10); } + connect(this,SIGNAL(incBrightness()),this,SLOT(slotIncBrightness())); + connect(this,SIGNAL(decBrightness()),this,SLOT(slotDecBrightness())); + 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::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 ) { int _newrotation; @@ -60,11 +78,12 @@ 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) { m_gDisplayType = disptypeGroup; m_gPrevNext = nextprevGroup; m_hGroup = hGroup; + m_gBright = brightGroup; } ImageView::~ImageView() @@ -174,6 +193,15 @@ void ImageView::initKeys() Resource::loadPixmap("mag"), Zoomer, Opie::Core::OKeyPair(Qt::Key_T,0), 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 ); m_viewManager->load(); } @@ -223,6 +251,10 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) m->insertSeparator(); m_gDisplayType->addTo(m); } + if (m_gBright) { + m->insertSeparator(); + m_gBright->addTo(m); + } } m->setFocus(); m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); @@ -235,6 +267,9 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) if (m_gDisplayType) { m_gDisplayType->removeFrom(m); } + if (m_gBright) { + m_gBright->removeFrom(m); + } delete m; } |