summaryrefslogtreecommitdiff
authoralwin <alwin>2005-03-24 12:16:23 (UTC)
committer alwin <alwin>2005-03-24 12:16:23 (UTC)
commit4fbd94e2fd6432bb15e24e40be59426b309cbb9d (patch) (unidiff)
treeb78ecad37012bb66d956e22dbaa8cfcdb8cf67fc
parentc635023dd68edd0cb0cbb2827b926f33e27e0404 (diff)
downloadopie-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 (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/basesetup.cpp11
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp22
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.h4
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp37
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.h12
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp16
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.h3
7 files changed, 84 insertions, 21 deletions
diff --git a/noncore/graphics/opie-eye/gui/basesetup.cpp b/noncore/graphics/opie-eye/gui/basesetup.cpp
index b0fefbf..fe51321 100644
--- a/noncore/graphics/opie-eye/gui/basesetup.cpp
+++ b/noncore/graphics/opie-eye/gui/basesetup.cpp
@@ -49,4 +49,4 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
49 m_Intensity->setButtonSymbols( QSpinBox::PlusMinus ); 49 m_Intensity->setButtonSymbols( QSpinBox::PlusMinus );
50 m_Intensity->setMaxValue( 255 ); 50 m_Intensity->setMaxValue( 100 );
51 m_Intensity->setMinValue(-255); 51 m_Intensity->setMinValue(-100);
52 m_Intensity->setValue( 0 ); 52 m_Intensity->setValue( 0 );
@@ -76,8 +76,9 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
76 stime = m_cfg->readNumEntry("iconsize", 32); 76 stime = m_cfg->readNumEntry("iconsize", 32);
77 /* must equal to s(MAX/MIN_ICONSIZE) in iconview.cpp! */
77 if (stime<12)stime = 12; 78 if (stime<12)stime = 12;
78 if (stime>64)stime = 64; 79 if (stime>128)stime = 128;
79 m_Iconsize->setValue(stime); 80 m_Iconsize->setValue(stime);
80 stime = m_cfg->readNumEntry("intensity",0); 81 stime = m_cfg->readNumEntry("intensity",0);
81 if (stime<-255) stime = -255; 82 if (stime<-100) stime = -100;
82 if (stime>255) stime = 255; 83 if (stime>100) stime = 100;
83 m_Intensity->setValue(stime); 84 m_Intensity->setValue(stime);
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index b2443e8..59091a8 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -38,2 +38,6 @@ using Opie::Core::OKeyConfigItem;
38 38
39const int PIconView::sMAX_ICON_SIZE = 128;
40const int PIconView::sMIN_ICON_SIZE = 12;
41const int PIconView::sDEF_ICON_SIZE = 64;
42
39/* 43/*
@@ -224,4 +228,4 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
224 m_iconsize = m_cfg->readNumEntry("iconsize", 32); 228 m_iconsize = m_cfg->readNumEntry("iconsize", 32);
225 if (m_iconsize<12)m_iconsize = 12; 229 if (m_iconsize<sMIN_ICON_SIZE)m_iconsize = sMIN_ICON_SIZE;
226 if (m_iconsize>64)m_iconsize = 64; 230 if (m_iconsize>sMAX_ICON_SIZE)m_iconsize = sMAX_ICON_SIZE;
227 231
@@ -410,4 +414,4 @@ void PIconView::resetView() {
410 m_iconsize = m_cfg->readNumEntry("iconsize", 32); 414 m_iconsize = m_cfg->readNumEntry("iconsize", 32);
411 if (m_iconsize<12)m_iconsize = 12; 415 if (m_iconsize<sMIN_ICON_SIZE)m_iconsize = sMIN_ICON_SIZE;
412 if (m_iconsize>64)m_iconsize = 64; 416 if (m_iconsize>sMAX_ICON_SIZE)m_iconsize = sMAX_ICON_SIZE;
413 if (osize != m_iconsize) { 417 if (osize != m_iconsize) {
@@ -424,3 +428,3 @@ void PIconView::resetView() {
424 } else { 428 } else {
425 m_iconsize = 64; 429 m_iconsize = sDEF_ICON_SIZE;
426 } 430 }
@@ -835,7 +839,7 @@ void PIconView::slotChangeMode( int mode ) {
835 if (m_mode==1) { 839 if (m_mode==1) {
836 m_iconsize = 64; 840 m_iconsize = sDEF_ICON_SIZE;
837 } else { 841 } else {
838 m_iconsize = m_cfg->readNumEntry("iconsize", 32); 842 m_iconsize = m_cfg->readNumEntry("iconsize", 32);
839 if (m_iconsize<12)m_iconsize = 12; 843 if (m_iconsize<sMIN_ICON_SIZE)m_iconsize = sMIN_ICON_SIZE;
840 if (m_iconsize>64)m_iconsize = 64; 844 if (m_iconsize>sMAX_ICON_SIZE)m_iconsize = sMAX_ICON_SIZE;
841 } 845 }
@@ -890,3 +894,3 @@ void PIconView::calculateGrid(QResizeEvent* re)
890 m_view->setGridY(-1); 894 m_view->setGridY(-1);
891 cache = (int)((double)64/(double)m_iconsize*40.0); 895 cache = (int)((double)sDEF_ICON_SIZE/(double)m_iconsize*80.0);
892 odebug << "cache size: " << cache << oendl; 896 odebug << "cache size: " << cache << oendl;
diff --git a/noncore/graphics/opie-eye/gui/iconview.h b/noncore/graphics/opie-eye/gui/iconview.h
index 6e08fd8..a546b88 100644
--- a/noncore/graphics/opie-eye/gui/iconview.h
+++ b/noncore/graphics/opie-eye/gui/iconview.h
@@ -39,2 +39,6 @@ public:
39 39
40 static const int sMAX_ICON_SIZE;
41 static const int sMIN_ICON_SIZE;
42 static const int sDEF_ICON_SIZE;
43
40signals: 44signals:
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
51void ImageView::slotIncBrightness()
52{
53 int lb = Intensity()+5;
54 if (lb>100) lb=100;
55 setIntensity(lb,true);
56}
57
58void ImageView::slotDecBrightness()
59{
60 int lb = Intensity()-5;
61 if (lb<-100) lb=-100;
62 setIntensity(lb,true);
63}
64
47void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) 65void ImageView::systemMessage( const QCString& msg, const QByteArray& data )
@@ -62,3 +80,3 @@ void ImageView::systemMessage( const QCString& msg, const QByteArray& data )
62 80
63void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup) 81void 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;
diff --git a/noncore/graphics/opie-eye/gui/imageview.h b/noncore/graphics/opie-eye/gui/imageview.h
index e8c8df7..b5801a6 100644
--- a/noncore/graphics/opie-eye/gui/imageview.h
+++ b/noncore/graphics/opie-eye/gui/imageview.h
@@ -31,3 +31,5 @@ class ImageView:public Opie::MM::OImageScrollView
31 Autorotate, 31 Autorotate,
32 Autoscale 32 Autoscale,
33 Incbrightness,
34 Decbrightness
33 }; 35 };
@@ -42,3 +44,3 @@ public:
42 void stopSlide(); 44 void stopSlide();
43 void setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup); 45 void setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup,QActionGroup*brightGroup);
44 void setCloseIfHide(bool); 46 void setCloseIfHide(bool);
@@ -54,2 +56,4 @@ signals:
54 void toggleAutorotate(); 56 void toggleAutorotate();
57 void incBrightness();
58 void decBrightness();
55 59
@@ -67,3 +71,3 @@ protected:
67 virtual void focusInEvent ( QFocusEvent * ); 71 virtual void focusInEvent ( QFocusEvent * );
68 QActionGroup *m_gDisplayType,*m_gPrevNext,*m_hGroup; 72 QActionGroup *m_gDisplayType,*m_gPrevNext,*m_hGroup,*m_gBright;
69 bool closeIfHide:1; 73 bool closeIfHide:1;
@@ -77,2 +81,4 @@ public slots:
77 virtual void systemMessage( const QCString&, const QByteArray& ); 81 virtual void systemMessage( const QCString&, const QByteArray& );
82 virtual void slotIncBrightness();
83 virtual void slotDecBrightness();
78 84
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index d11e4e1..4ee252f 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -267,3 +267,3 @@ void PMainWindow::initDisp() {
267// } 267// }
268 m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType); 268 m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType,m_hBright);
269 m_disp->setAutoScale(!m_aUnscaled->isOn()); 269 m_disp->setAutoScale(!m_aUnscaled->isOn());
@@ -281,2 +281,4 @@ void PMainWindow::initDisp() {
281 connect(m_view,SIGNAL(sig_startslide(int)),m_disp,SLOT(startSlide(int))); 281 connect(m_view,SIGNAL(sig_startslide(int)),m_disp,SLOT(startSlide(int)));
282 connect(m_IncBrightness,SIGNAL(activated()),m_disp,SLOT(slotIncBrightness()));
283 connect(m_DecBrightness,SIGNAL(activated()),m_disp,SLOT(slotDecBrightness()));
282 slotFullScreenToggled(m_aFullScreen->isOn()); 284 slotFullScreenToggled(m_aFullScreen->isOn());
@@ -382,2 +384,3 @@ void PMainWindow::slotDisplay( const QString& inf ) {
382 m_setCurrentBrightness->setEnabled(true); 384 m_setCurrentBrightness->setEnabled(true);
385 m_hBright->setEnabled(true);
383 } 386 }
@@ -645,2 +648,7 @@ void PMainWindow::setupActions()
645 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);
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),
652 m_hBright->insert(m_IncBrightness);
653 m_hBright->insert(m_DecBrightness);
646} 654}
@@ -653,3 +661,3 @@ void PMainWindow::setupBrightness()
653 int lb = m_disp->Intensity(); 661 int lb = m_disp->Intensity();
654 if (Valuebox(0,-255,255,lb,lb)) { 662 if (Valuebox(0,-100,100,lb,lb)) {
655 m_disp->setIntensity(lb,true); 663 m_disp->setIntensity(lb,true);
@@ -726,2 +734,6 @@ void PMainWindow::setupMenu()
726 m_setCurrentBrightness->setEnabled(false); 734 m_setCurrentBrightness->setEnabled(false);
735 dispMenu->insertSeparator();
736 m_hBright->addTo(dispMenu);
737 m_hBright->setEnabled(false);
738
727 if (m_aForceSmall) { 739 if (m_aForceSmall) {
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h
index 62b446b..c3b51f6 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.h
+++ b/noncore/graphics/opie-eye/gui/mainwindow.h
@@ -93,5 +93,6 @@ private:
93 QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong; 93 QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong;
94 QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup; 94 QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup,*m_hBright;
95 QAction *m_aNext,*m_aPrevious,*m_aFullScreen; 95 QAction *m_aNext,*m_aPrevious,*m_aFullScreen;
96 QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer,*m_aForceSmall,*m_setCurrentBrightness; 96 QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer,*m_aForceSmall,*m_setCurrentBrightness;
97 QAction *m_IncBrightness,*m_DecBrightness;
97 98