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 | |||
31 | m_hGroup = 0; | 31 | m_hGroup = 0; |
32 | m_gBright = 0; | ||
32 | m_Rotated = false; | 33 | m_Rotated = false; |
@@ -41,2 +42,5 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name | |||
41 | } | 42 | } |
43 | connect(this,SIGNAL(incBrightness()),this,SLOT(slotIncBrightness())); | ||
44 | connect(this,SIGNAL(decBrightness()),this,SLOT(slotDecBrightness())); | ||
45 | |||
42 | m_sysChannel = new QCopChannel( "QPE/System", this ); | 46 | m_sysChannel = new QCopChannel( "QPE/System", this ); |
@@ -46,2 +50,16 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name | |||
46 | 50 | ||
51 | void ImageView::slotIncBrightness() | ||
52 | { | ||
53 | int lb = Intensity()+5; | ||
54 | if (lb>100) lb=100; | ||
55 | setIntensity(lb,true); | ||
56 | } | ||
57 | |||
58 | void ImageView::slotDecBrightness() | ||
59 | { | ||
60 | int lb = Intensity()-5; | ||
61 | if (lb<-100) lb=-100; | ||
62 | setIntensity(lb,true); | ||
63 | } | ||
64 | |||
47 | void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) | 65 | void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) |
@@ -62,3 +80,3 @@ void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) | |||
62 | 80 | ||
63 | void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup) | 81 | void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup,QActionGroup*brightGroup) |
64 | { | 82 | { |
@@ -67,2 +85,3 @@ void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, Q | |||
67 | m_hGroup = hGroup; | 85 | m_hGroup = hGroup; |
86 | m_gBright = brightGroup; | ||
68 | } | 87 | } |
@@ -176,2 +195,11 @@ void ImageView::initKeys() | |||
176 | this, SIGNAL(toggleZoomer()))); | 195 | this, SIGNAL(toggleZoomer()))); |
196 | |||
197 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Increase brightness"), "incbrightness", | ||
198 | Resource::loadPixmap("up"), Incbrightness, | ||
199 | Opie::Core::OKeyPair(Qt::Key_B,0), | ||
200 | this, SIGNAL(incBrightness()))); | ||
201 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Decrease brightness"), "decbrightness", | ||
202 | Resource::loadPixmap("down"), Decbrightness, | ||
203 | Opie::Core::OKeyPair(Qt::Key_D,0), | ||
204 | this, SIGNAL(decBrightness()))); | ||
177 | m_viewManager->handleWidget( this ); | 205 | m_viewManager->handleWidget( this ); |
@@ -225,2 +253,6 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) | |||
225 | } | 253 | } |
254 | if (m_gBright) { | ||
255 | m->insertSeparator(); | ||
256 | m_gBright->addTo(m); | ||
257 | } | ||
226 | } | 258 | } |
@@ -237,2 +269,5 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) | |||
237 | } | 269 | } |
270 | if (m_gBright) { | ||
271 | m_gBright->removeFrom(m); | ||
272 | } | ||
238 | delete m; | 273 | delete m; |