summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/iconview.cpp
Unidiff
Diffstat (limited to 'noncore/graphics/opie-eye/gui/iconview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index b3f0006..ed9fc9c 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -13,4 +13,5 @@
13#include <opie2/oconfig.h> 13#include <opie2/oconfig.h>
14#include <opie2/okeyconfigwidget.h> 14#include <opie2/okeyconfigwidget.h>
15#include <opie2/odebug.h>
15 16
16#include <qpe/resource.h> 17#include <qpe/resource.h>
@@ -43,5 +44,6 @@ namespace {
43 bool isDir()const { return m_isDir; } 44 bool isDir()const { return m_isDir; }
44 void setText( const QString& ); 45 void setText( const QString& );
45 void reCalc(); 46
47
46 private: 48 private:
47 mutable QPixmap* m_pix; 49 mutable QPixmap* m_pix;
@@ -71,4 +73,8 @@ namespace {
71 } 73 }
72 inline QPixmap* IconViewItem::pixmap()const { 74 inline QPixmap* IconViewItem::pixmap()const {
75 qWarning( "Name is " + m_path.right( 15 ) + " rect is %d %d %d %d | %d %d",
76 rect().x(),rect().y(),rect().width(),rect().height(),
77 iconView()->contentsX(), iconView()->contentsY());
78
73 if ( m_isDir ) 79 if ( m_isDir )
74 return _dirPix; 80 return _dirPix;
@@ -91,10 +97,4 @@ namespace {
91 m_noInfo = true; 97 m_noInfo = true;
92 QIconViewItem::setText( text ); 98 QIconViewItem::setText( text );
93 reCalc();
94 }
95
96 inline void IconViewItem::reCalc()
97 {
98 calcRect();
99 } 99 }
100} 100}
@@ -123,9 +123,8 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
123 m_view->setArrangement( QIconView::LeftToRight ); 123 m_view->setArrangement( QIconView::LeftToRight );
124 m_view->setItemTextPos( QIconView::Right ); 124 m_view->setItemTextPos( QIconView::Right );
125 m_view->setResizeMode(QIconView::Adjust);
126 125
127 int dw = QApplication::desktop()->width(); 126 int dw = QApplication::desktop()->width();
128 int viewerWidth = dw-style().scrollBarExtent().width(); 127 int viewerWidth = dw-style().scrollBarExtent().width();
129 m_view->setGridX( viewerWidth-2*m_view->spacing() ); 128 m_view->setGridX( viewerWidth-3*m_view->spacing());
130 m_view->setGridY( fontMetrics().height()*2+40 ); 129 m_view->setGridY( fontMetrics().height()*2+40 );
131 130
@@ -197,9 +196,9 @@ void PIconView::slotChangeDir(const QString& path) {
197 m_path = lister->currentPath(); 196 m_path = lister->currentPath();
198 197
199 m_view->setUpdatesEnabled( false ); 198 m_view->viewport()->setUpdatesEnabled( false );
200 m_view->clear(); 199 m_view->clear();
201 addFolders( lister->folders() ); 200 addFolders( lister->folders() );
202 addFiles( lister->files() ); 201 addFiles( lister->files() );
203 m_view->setUpdatesEnabled( true ); 202 m_view->viewport()->setUpdatesEnabled( true );
204 203
205 // Also invalidate the cache. We can't cancel the operations anyway 204 // Also invalidate the cache. We can't cancel the operations anyway
@@ -315,5 +314,4 @@ void PIconView::slotThumbInfo( const QString& _path, const QString& str ) {
315 I dont know how to fix the format of displayed text :(*/ 314 I dont know how to fix the format of displayed text :(*/
316 item->setText( str ); 315 item->setText( str );
317 item->repaint();
318 g_stringInf.remove( _path ); 316 g_stringInf.remove( _path );
319 } 317 }
@@ -326,9 +324,7 @@ void PIconView::slotThumbNail(const QString& _path, const QPixmap &pix) {
326 PPixmapCache::self()->insertImage( _path, pix, 64, 64 ); 324 PPixmapCache::self()->insertImage( _path, pix, 64, 64 );
327 /* required for a recalculated rectangle. otherwise the view show nonsense! */ 325 /* required for a recalculated rectangle. otherwise the view show nonsense! */
328 item->reCalc();
329 } else { 326 } else {
330 PPixmapCache::self()->insertImage(_path,Resource::loadPixmap( "UnknownDocument" ),64,64 ); 327 PPixmapCache::self()->insertImage(_path,Resource::loadPixmap( "UnknownDocument" ),64,64 );
331 } 328 }
332 item->repaint();
333 g_stringPix.remove( _path ); 329 g_stringPix.remove( _path );
334 } 330 }
@@ -358,9 +354,10 @@ void PIconView::slotBeamDone( Ir* ir) {
358 354
359void PIconView::slotStart() { 355void PIconView::slotStart() {
360 m_view->setUpdatesEnabled( false ); 356 m_view->viewport()->setUpdatesEnabled( false );
361} 357}
362 358
363void PIconView::slotEnd() { 359void PIconView::slotEnd() {
364 m_view->setUpdatesEnabled( true ); 360 m_view->arrangeItemsInGrid( );
361 m_view->viewport()->setUpdatesEnabled( true );
365} 362}
366 363