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 | |||
29 | m_gDisplayType = 0; | 29 | m_gDisplayType = 0; |
30 | m_gPrevNext = 0; | 30 | m_gPrevNext = 0; |
31 | m_hGroup = 0; | 31 | m_hGroup = 0; |
32 | m_gBright = 0; | ||
32 | m_Rotated = false; | 33 | m_Rotated = false; |
33 | closeIfHide = false; | 34 | closeIfHide = false; |
34 | int min = QApplication::desktop()->size().width()>QApplication::desktop()->size().height()? | 35 | 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 | |||
39 | } else { | 40 | } else { |
40 | setMinimumSize(10,10); | 41 | setMinimumSize(10,10); |
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 ); |
43 | connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), | 47 | connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), |
44 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); | 48 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); |
45 | } | 49 | } |
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 ) |
48 | { | 66 | { |
49 | int _newrotation; | 67 | int _newrotation; |
@@ -60,11 +78,12 @@ void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) | |||
60 | } | 78 | } |
61 | } | 79 | } |
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 | { |
65 | m_gDisplayType = disptypeGroup; | 83 | m_gDisplayType = disptypeGroup; |
66 | m_gPrevNext = nextprevGroup; | 84 | m_gPrevNext = nextprevGroup; |
67 | m_hGroup = hGroup; | 85 | m_hGroup = hGroup; |
86 | m_gBright = brightGroup; | ||
68 | } | 87 | } |
69 | 88 | ||
70 | ImageView::~ImageView() | 89 | ImageView::~ImageView() |
@@ -174,6 +193,15 @@ void ImageView::initKeys() | |||
174 | Resource::loadPixmap("mag"), Zoomer, | 193 | Resource::loadPixmap("mag"), Zoomer, |
175 | Opie::Core::OKeyPair(Qt::Key_T,0), | 194 | Opie::Core::OKeyPair(Qt::Key_T,0), |
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 ); |
178 | m_viewManager->load(); | 206 | m_viewManager->load(); |
179 | } | 207 | } |
@@ -223,6 +251,10 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) | |||
223 | m->insertSeparator(); | 251 | m->insertSeparator(); |
224 | m_gDisplayType->addTo(m); | 252 | m_gDisplayType->addTo(m); |
225 | } | 253 | } |
254 | if (m_gBright) { | ||
255 | m->insertSeparator(); | ||
256 | m_gBright->addTo(m); | ||
257 | } | ||
226 | } | 258 | } |
227 | m->setFocus(); | 259 | m->setFocus(); |
228 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 260 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
@@ -235,6 +267,9 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) | |||
235 | if (m_gDisplayType) { | 267 | if (m_gDisplayType) { |
236 | m_gDisplayType->removeFrom(m); | 268 | m_gDisplayType->removeFrom(m); |
237 | } | 269 | } |
270 | if (m_gBright) { | ||
271 | m_gBright->removeFrom(m); | ||
272 | } | ||
238 | delete m; | 273 | delete m; |
239 | } | 274 | } |
240 | 275 | ||