summaryrefslogtreecommitdiff
path: root/noncore/graphics
authorzecke <zecke>2004-07-24 18:46:24 (UTC)
committer zecke <zecke>2004-07-24 18:46:24 (UTC)
commit69df55bd0b74c7e59ff40390e2f1d902f882491f (patch) (unidiff)
treeefb617312c1e77ca3990487d727bd283516a2702 /noncore/graphics
parent5a8963dff615da61611f5cc4bf410e7a6eeef55b (diff)
downloadopie-69df55bd0b74c7e59ff40390e2f1d902f882491f.zip
opie-69df55bd0b74c7e59ff40390e2f1d902f882491f.tar.gz
opie-69df55bd0b74c7e59ff40390e2f1d902f882491f.tar.bz2
Try to get the Keyup Event inside the IconView to not 'move'
forward later. Long Return press triggers autorepeat
Diffstat (limited to 'noncore/graphics') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp19
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index 211314b..652acc9 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -429,46 +429,65 @@ void PIconView::addFiles( const QStringList& lst) {
429 IconViewItem * _iv; 429 IconViewItem * _iv;
430 QPixmap*m_pix = 0; 430 QPixmap*m_pix = 0;
431 QString pre = ""; 431 QString pre = "";
432 if (!m_path.isEmpty()) { 432 if (!m_path.isEmpty()) {
433 pre = m_path+"/"; 433 pre = m_path+"/";
434 } 434 }
435 for (it=lst.begin(); it!= lst.end(); ++it ) { 435 for (it=lst.begin(); it!= lst.end(); ++it ) {
436 m_pix = PPixmapCache::self()->cachedImage( pre+(*it), 64, 64 ); 436 m_pix = PPixmapCache::self()->cachedImage( pre+(*it), 64, 64 );
437 _iv = new IconViewItem( m_view, pre+(*it), (*it) ); 437 _iv = new IconViewItem( m_view, pre+(*it), (*it) );
438 if (m_mode==3) { 438 if (m_mode==3) {
439 _iv->setTextOnly(true); 439 _iv->setTextOnly(true);
440 _iv->setPixmap(QPixmap()); 440 _iv->setPixmap(QPixmap());
441
442
443
441 } else { 444 } else {
442 if (m_pix) _iv->setPixmap(*m_pix); 445 if (m_pix) _iv->setPixmap(*m_pix);
443 } 446 }
444 } 447 }
445 448
446} 449}
447 450
448/* 451/*
449 * user clicked on the item. Change dir or view 452 * user clicked on the item. Change dir or view
450 */ 453 */
451void PIconView::slotClicked(QIconViewItem* _it) { 454void PIconView::slotClicked(QIconViewItem* _it) {
452 if(!_it ) 455 if(!_it )
453 return; 456 return;
454 457
455 IconViewItem* it = static_cast<IconViewItem*>(_it); 458 IconViewItem* it = static_cast<IconViewItem*>(_it);
456 if( it->isDir() ) 459 if( it->isDir() )
457 slotChangeDir( it->path() ); 460 slotChangeDir( it->path() );
458 else // view image 461 else // view image
459 slotShowImage(); 462 slotShowImage();
460} 463}
461 464
462/* 465/*
466 * Return was pressed. which is triggered by the keydown
467 * handler. The problem is that the key up will be handled
468 * by the ImageDisplayer and goes to the next image
469 */
470void PIconView::slotRetrun( QIconViewItem *_it ) {
471 if(!_it )
472 return;
473
474 IconViewItem* it = static_cast<IconViewItem*>(_it);
475 if( it->isDir() )
476 slotChangeDir( it->path() );
477 else
478 QTimer::singleShot(0, this, SLOT(slotShowImage()) );
479}
480
481/*
463 * got thumb info add to the cache if items is visible 482 * got thumb info add to the cache if items is visible
464 * we later need update after processing of slave is done 483 * we later need update after processing of slave is done
465 */ 484 */
466void PIconView::slotThumbInfo( const QString& _path, const QString& str ) { 485void PIconView::slotThumbInfo( const QString& _path, const QString& str ) {
467 IconViewItem* item = g_stringInf[_path]; 486 IconViewItem* item = g_stringInf[_path];
468 if (!item ) 487 if (!item )
469 return; 488 return;
470 489
471 if (m_mode == 2) { 490 if (m_mode == 2) {
472 return; 491 return;
473 } 492 }
474 if ( item->intersects(QRect( m_view->contentsX(),m_view->contentsY(), 493 if ( item->intersects(QRect( m_view->contentsX(),m_view->contentsY(),
diff --git a/noncore/graphics/opie-eye/gui/iconview.h b/noncore/graphics/opie-eye/gui/iconview.h
index 14ad168..a424c5c 100644
--- a/noncore/graphics/opie-eye/gui/iconview.h
+++ b/noncore/graphics/opie-eye/gui/iconview.h
@@ -67,24 +67,25 @@ private slots:
67 void slotShowImage(); 67 void slotShowImage();
68 void slotShowImage( const QString& ); 68 void slotShowImage( const QString& );
69 void slotImageInfo(); 69 void slotImageInfo();
70 void slotImageInfo( const QString& ); 70 void slotImageInfo( const QString& );
71 71
72 void slotStart(); 72 void slotStart();
73 void slotEnd(); 73 void slotEnd();
74 74
75/* for performance reasons make it inline in the future */ 75/* for performance reasons make it inline in the future */
76 void addFolders( const QStringList& ); 76 void addFolders( const QStringList& );
77 void addFiles( const QStringList& ); 77 void addFiles( const QStringList& );
78 void slotClicked(QIconViewItem* ); 78 void slotClicked(QIconViewItem* );
79 void slotRetrun(QIconViewItem* );
79 80
80/**/ 81/**/
81 void slotThumbInfo(const QString&, const QString&); 82 void slotThumbInfo(const QString&, const QString&);
82 void slotThumbNail(const QString&, const QPixmap&); 83 void slotThumbNail(const QString&, const QPixmap&);
83 84
84 void slotChangeMode( int ); 85 void slotChangeMode( int );
85private: 86private:
86 Opie::Core::OKeyConfigManager *m_viewManager; 87 Opie::Core::OKeyConfigManager *m_viewManager;
87 Opie::Core::OConfig *m_cfg; 88 Opie::Core::OConfig *m_cfg;
88 QComboBox* m_views; 89 QComboBox* m_views;
89 QIconView* m_view; 90 QIconView* m_view;
90 QString m_path; 91 QString m_path;