author | alwin <alwin> | 2004-04-04 14:10:59 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-04 14:10:59 (UTC) |
commit | c978418067f228bd21cef23a13009d591e55f8df (patch) (unidiff) | |
tree | 8330f83fc484ee3be9cf3bf867b5ccca5dae4db9 /noncore | |
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 | 31 |
1 files changed, 22 insertions, 9 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 @@ | |||
13 | #include <qstring.h> | 13 | #include <qstring.h> |
14 | #include <qfileinfo.h> | ||
14 | 15 | ||
@@ -20,2 +21,4 @@ | |||
20 | 21 | ||
22 | #define THUMBSIZE 128 | ||
23 | |||
21 | imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WFlags fl ) | 24 | 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 | |||
32 | imageinfoLayout->setSpacing(2); | 35 | imageinfoLayout->setSpacing(2); |
33 | imageinfoLayout->setMargin(2); | 36 | imageinfoLayout->setMargin(4); |
34 | 37 | ||
35 | PixmapLabel1 = new QLabel( this, "PixmapLabel1" ); | 38 | PixmapLabel1 = new QLabel( this, "PixmapLabel1" ); |
36 | PixmapLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1->sizePolicy().hasHeightForWidth() ) ); | 39 | PixmapLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, PixmapLabel1->sizePolicy().hasHeightForWidth() ) ); |
37 | PixmapLabel1->setScaledContents( TRUE ); | 40 | QWhatsThis::add( PixmapLabel1, tr("Displays an thumbnail of the image") ); |
41 | |||
38 | imageinfoLayout->addWidget( PixmapLabel1 ); | 42 | imageinfoLayout->addWidget( PixmapLabel1 ); |
@@ -47,4 +51,7 @@ imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WF | |||
47 | TextView1 = new QTextView( this, "TextView1" ); | 51 | TextView1 = new QTextView( this, "TextView1" ); |
48 | TextView1->setFrameShadow( QTextView::Plain ); | 52 | TextView1->setFrameShadow( QTextView::Sunken ); |
49 | QToolTip::add( TextView1, tr( "Displays info of selected image" ) ); | 53 | TextView1->setResizePolicy( QTextView::AutoOneFit ); |
54 | TextView1->setBackgroundOrigin( QTextView::ParentOrigin ); | ||
55 | TextView1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, TextView1->sizePolicy().hasHeightForWidth() ) ); | ||
56 | // TextView1->setVScrollBarMode(QScrollView::AlwaysOn); | ||
50 | QWhatsThis::add( TextView1, tr( "Displays info of selected image" ) ); | 57 | QWhatsThis::add( TextView1, tr( "Displays info of selected image" ) ); |
@@ -63,8 +70,10 @@ void imageinfo::slotChangeName(const QString&_path) | |||
63 | currentFile=_path; | 70 | currentFile=_path; |
64 | fnameLabel->setText("<qt><center><b>"+currentFile+"</b></center></qt>"); | 71 | QFileInfo fi(_path); |
72 | fnameLabel->setText("<qt><center><b>"+fi.fileName()+"</b></center></qt>"); | ||
65 | SlaveMaster::self()->imageInfo( currentFile ); | 73 | SlaveMaster::self()->imageInfo( currentFile ); |
66 | 74 | ||
67 | QPixmap*m_pix = PPixmapCache::self()->cachedImage( _path, 64, 64 ); | 75 | QPixmap*m_pix = PPixmapCache::self()->cachedImage( _path, THUMBSIZE,THUMBSIZE ); |
68 | if (!m_pix) { | 76 | if (!m_pix) { |
69 | PixmapLabel1->setPixmap(QPixmap( Resource::loadPixmap( "UnknownDocument" ))); | 77 | PixmapLabel1->setPixmap(QPixmap( Resource::loadPixmap( "UnknownDocument" ))); |
78 | SlaveMaster::self()->thumbNail(currentFile,THUMBSIZE,THUMBSIZE); | ||
70 | } else { | 79 | } else { |
@@ -87,2 +96,4 @@ void imageinfo::slot_fullInfo(const QString&_path, const QString&_t) | |||
87 | t.replace(QRegExp("\n"),"<br>"); | 96 | t.replace(QRegExp("\n"),"<br>"); |
97 | /* t.replace(QRegeExp("<qt>",""); | ||
98 | t.replace(QRegeExp("</qt>","");*/ | ||
88 | TextView1->setText(t); | 99 | TextView1->setText(t); |
@@ -93,6 +104,8 @@ void imageinfo::slotThumbNail(const QString&_path, const QPixmap&_pix) | |||
93 | { | 104 | { |
94 | if (_pix.width()>0) | ||
95 | PPixmapCache::self()->insertImage( _path, _pix, 64, 64 ); | ||
96 | if (_path == currentFile) { | 105 | if (_path == currentFile) { |
106 | if (_pix.width()>0) { | ||
107 | PPixmapCache::self()->insertImage( _path, _pix, THUMBSIZE, THUMBSIZE ); | ||
97 | PixmapLabel1->setPixmap( _pix ); | 108 | PixmapLabel1->setPixmap( _pix ); |
109 | PixmapLabel1->resize(QSize(_pix.width(),_pix.height())); | ||
110 | } | ||
98 | } | 111 | } |