author | alwin <alwin> | 2005-03-24 12:16:23 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-24 12:16:23 (UTC) |
commit | 4fbd94e2fd6432bb15e24e40be59426b309cbb9d (patch) (unidiff) | |
tree | b78ecad37012bb66d956e22dbaa8cfcdb8cf67fc /noncore/graphics/opie-eye/gui/iconview.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/iconview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
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 | |||
@@ -36,6 +36,10 @@ | |||
36 | 36 | ||
37 | using Opie::Core::OKeyConfigItem; | 37 | using Opie::Core::OKeyConfigItem; |
38 | 38 | ||
39 | const int PIconView::sMAX_ICON_SIZE = 128; | ||
40 | const int PIconView::sMIN_ICON_SIZE = 12; | ||
41 | const int PIconView::sDEF_ICON_SIZE = 64; | ||
42 | |||
39 | /* | 43 | /* |
40 | * The Icons, Request Cache and IconViewItem for the IconView | 44 | * The Icons, Request Cache and IconViewItem for the IconView |
41 | */ | 45 | */ |
@@ -222,8 +226,8 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | |||
222 | m_view->setResizeMode(QIconView::Fixed); | 226 | m_view->setResizeMode(QIconView::Fixed); |
223 | } | 227 | } |
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 | ||
228 | calculateGrid(); | 232 | calculateGrid(); |
229 | initKeys(); | 233 | initKeys(); |
@@ -408,8 +412,8 @@ void PIconView::resetView() { | |||
408 | if (m_mode>1) { | 412 | if (m_mode>1) { |
409 | int osize = m_iconsize; | 413 | int osize = m_iconsize; |
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) { |
414 | if (_dirPix){ | 418 | if (_dirPix){ |
415 | delete _dirPix; | 419 | delete _dirPix; |
@@ -422,7 +426,7 @@ void PIconView::resetView() { | |||
422 | calculateGrid(); | 426 | calculateGrid(); |
423 | } | 427 | } |
424 | } else { | 428 | } else { |
425 | m_iconsize = 64; | 429 | m_iconsize = sDEF_ICON_SIZE; |
426 | } | 430 | } |
427 | slotViewChanged(m_views->currentItem()); | 431 | slotViewChanged(m_views->currentItem()); |
428 | m_internalReset = false; | 432 | m_internalReset = false; |
@@ -833,11 +837,11 @@ void PIconView::slotChangeMode( int mode ) { | |||
833 | m_view->setResizeMode(QIconView::Fixed); | 837 | m_view->setResizeMode(QIconView::Fixed); |
834 | } | 838 | } |
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 | } |
842 | if (_dirPix){ | 846 | if (_dirPix){ |
843 | delete _dirPix; | 847 | delete _dirPix; |
@@ -888,7 +892,7 @@ void PIconView::calculateGrid(QResizeEvent* re) | |||
888 | m_view->setSpacing(2); | 892 | m_view->setSpacing(2); |
889 | m_view->setGridX(m_iconsize); | 893 | m_view->setGridX(m_iconsize); |
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; |
893 | PPixmapCache::self()->setMaxImages(cache); | 897 | PPixmapCache::self()->setMaxImages(cache); |
894 | break; | 898 | break; |