author | alwin <alwin> | 2004-04-04 14:10:59 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-04 14:10:59 (UTC) |
commit | c978418067f228bd21cef23a13009d591e55f8df (patch) (side-by-side diff) | |
tree | 8330f83fc484ee3be9cf3bf867b5ccca5dae4db9 | |
parent | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (diff) | |
download | opie-c978418067f228bd21cef23a13009d591e55f8df.zip opie-c978418067f228bd21cef23a13009d591e55f8df.tar.gz opie-c978418067f228bd21cef23a13009d591e55f8df.tar.bz2 |
resizing when getting larger thumbnails works
default thumbnail for that is 128 pix instead of 64
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageinfoui.cpp | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.cpp b/noncore/graphics/opie-eye/gui/imageinfoui.cpp index 177df77..2580215 100644 --- a/noncore/graphics/opie-eye/gui/imageinfoui.cpp +++ b/noncore/graphics/opie-eye/gui/imageinfoui.cpp @@ -13,2 +13,3 @@ #include <qstring.h> +#include <qfileinfo.h> @@ -20,2 +21,4 @@ +#define THUMBSIZE 128 + imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WFlags fl ) @@ -32,7 +35,8 @@ imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WF imageinfoLayout->setSpacing(2); - imageinfoLayout->setMargin(2); + imageinfoLayout->setMargin(4); PixmapLabel1 = new QLabel( this, "PixmapLabel1" ); - PixmapLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1->sizePolicy().hasHeightForWidth() ) ); - PixmapLabel1->setScaledContents( TRUE ); + PixmapLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, PixmapLabel1->sizePolicy().hasHeightForWidth() ) ); + QWhatsThis::add( PixmapLabel1, tr("Displays an thumbnail of the image") ); + imageinfoLayout->addWidget( PixmapLabel1 ); @@ -47,5 +51,8 @@ imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WF TextView1 = new QTextView( this, "TextView1" ); - TextView1->setFrameShadow( QTextView::Plain ); - QToolTip::add( TextView1, tr( "Displays info of selected image" ) ); - QWhatsThis::add( TextView1, tr( "Displays info of selected image" ) ); + TextView1->setFrameShadow( QTextView::Sunken ); + TextView1->setResizePolicy( QTextView::AutoOneFit ); + TextView1->setBackgroundOrigin( QTextView::ParentOrigin ); + TextView1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, TextView1->sizePolicy().hasHeightForWidth() ) ); +// TextView1->setVScrollBarMode(QScrollView::AlwaysOn); + QWhatsThis::add( TextView1, tr("Displays info of selected image") ); imageinfoLayout->addWidget( TextView1 ); @@ -63,8 +70,10 @@ void imageinfo::slotChangeName(const QString&_path) currentFile=_path; - fnameLabel->setText("<qt><center><b>"+currentFile+"</b></center></qt>"); + QFileInfo fi(_path); + fnameLabel->setText("<qt><center><b>"+fi.fileName()+"</b></center></qt>"); SlaveMaster::self()->imageInfo( currentFile ); - QPixmap*m_pix = PPixmapCache::self()->cachedImage( _path, 64, 64 ); + QPixmap*m_pix = PPixmapCache::self()->cachedImage( _path, THUMBSIZE,THUMBSIZE ); if (!m_pix) { PixmapLabel1->setPixmap(QPixmap( Resource::loadPixmap( "UnknownDocument" ))); + SlaveMaster::self()->thumbNail(currentFile,THUMBSIZE,THUMBSIZE); } else { @@ -87,2 +96,4 @@ void imageinfo::slot_fullInfo(const QString&_path, const QString&_t) t.replace(QRegExp("\n"),"<br>"); +/* t.replace(QRegeExp("<qt>",""); + t.replace(QRegeExp("</qt>","");*/ TextView1->setText(t); @@ -93,6 +104,8 @@ void imageinfo::slotThumbNail(const QString&_path, const QPixmap&_pix) { - if (_pix.width()>0) - PPixmapCache::self()->insertImage( _path, _pix, 64, 64 ); if (_path == currentFile) { - PixmapLabel1->setPixmap( _pix ); + if (_pix.width()>0) { + PPixmapCache::self()->insertImage( _path, _pix, THUMBSIZE, THUMBSIZE ); + PixmapLabel1->setPixmap( _pix ); + PixmapLabel1->resize(QSize(_pix.width(),_pix.height())); + } } |