author | alwin <alwin> | 2004-11-07 15:08:59 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-11-07 15:08:59 (UTC) |
commit | cf8bdb2fe272ca0ecf96aae479df9e1d357ae8a4 (patch) (side-by-side diff) | |
tree | 6c55d20ded81c17b5ed772776f333cc7c3ac36bc | |
parent | e11d189bfd48ab072da4753240a4ab0bbf81296f (diff) | |
download | opie-cf8bdb2fe272ca0ecf96aae479df9e1d357ae8a4.zip opie-cf8bdb2fe272ca0ecf96aae479df9e1d357ae8a4.tar.gz opie-cf8bdb2fe272ca0ecf96aae479df9e1d357ae8a4.tar.bz2 |
fixed up the icon display, imagecache size depends on size of icons
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index c037d0d..f173ecc 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp @@ -98,6 +98,2 @@ namespace { if ( isDir ) { - if (_dirPix && _dirPix->width()!=m_iconsize) { - delete _dirPix; - _dirPix = 0; - } if (!_dirPix ) { @@ -115,6 +111,2 @@ namespace { { - if (_cpyPix && _cpyPix->width()!=m_iconsize) { - delete _cpyPix; - _cpyPix = 0; - } if (_dirPix && _dirPix->width()>m_iconsize) { @@ -425,2 +417,3 @@ void PIconView::resetView() { if (m_mode>1) { + int osize = m_iconsize; m_iconsize = m_cfg->readNumEntry("iconsize", 32); @@ -428,2 +421,13 @@ void PIconView::resetView() { if (m_iconsize>64)m_iconsize = 64; + if (osize != m_iconsize) { + if (_dirPix){ + delete _dirPix; + _dirPix = 0; + } + if (_cpyPix){ + delete _cpyPix; + _cpyPix = 0; + } + calculateGrid(); + } } else { @@ -809,3 +813,10 @@ void PIconView::slotChangeMode( int mode ) { } - + if (_dirPix){ + delete _dirPix; + _dirPix = 0; + } + if (_cpyPix){ + delete _cpyPix; + _cpyPix = 0; + } calculateGrid(); @@ -844,2 +855,3 @@ void PIconView::calculateGrid(QResizeEvent* re) } + int cache = 0; m_view->setItemTextPos( pos ); @@ -847,7 +859,11 @@ void PIconView::calculateGrid(QResizeEvent* re) case 2: + m_view->setSpacing(2); m_view->setGridX(m_iconsize); m_view->setGridY(-1); - PPixmapCache::self()->setMaxImages(40); + cache = (int)((double)64/(double)m_iconsize*40.0); + odebug << "cache size: " << cache << oendl; + PPixmapCache::self()->setMaxImages(cache); break; case 3: + m_view->setSpacing(10); m_view->setGridX( fontMetrics().width("testimage.jpg")+20); @@ -858,2 +874,3 @@ void PIconView::calculateGrid(QResizeEvent* re) default: + m_view->setSpacing(10); m_view->setGridX( viewerWidth-3*m_view->spacing()); @@ -863,3 +880,2 @@ void PIconView::calculateGrid(QResizeEvent* re) } - m_view->setSpacing(10); } |