diff options
| author | Peter Penz <[email protected]> | 2008-08-22 21:47:22 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-08-22 21:47:22 +0000 |
| commit | ad0a321b7dfd57d7d666ac87ef44813f8e16129e (patch) | |
| tree | 62927110bc4957fe22a330e7d780559b8ddc12e4 /src/dolphintooltip.cpp | |
| parent | aa3e271ce39e7cbbd546d5f9197a1f83ba53fcde (diff) | |
tooltip improvements (patch provided by Laurens Vanhove):
* do a slightly delayed generation of previews to avoid expensive thumbnail creation when shortly hovering items
* prevent a resizing of the tooltip if the preview cannot be generated within a specific timeout
CCMAIL: [email protected]
svn path=/trunk/KDE/kdebase/apps/; revision=851104
Diffstat (limited to 'src/dolphintooltip.cpp')
| -rw-r--r-- | src/dolphintooltip.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/dolphintooltip.cpp b/src/dolphintooltip.cpp index 4b7031360..84eb2ed70 100644 --- a/src/dolphintooltip.cpp +++ b/src/dolphintooltip.cpp @@ -28,44 +28,6 @@ const int PREVIEW_WIDTH = 256; const int PREVIEW_HEIGHT = 256; -DolphinToolTipItem::DolphinToolTipItem(const KFileItem& fileItem) : - KToolTipItem(KIcon(fileItem.iconName()), fileItem.getToolTipText(), UserType) -{ - - //if (icon().actualSize(QSize(256,256)).width() != PREVIEW_WIDTH) - /*{ - QPixmap paddedImage(QSize(PREVIEW_WIDTH, PREVIEW_HEIGHT)); - paddedImage.fill(Qt::transparent); - QPainter painter(&paddedImage); - KIcon kicon(fileItem.iconName()); - painter.drawPixmap((PREVIEW_WIDTH - 128) / 2, (PREVIEW_HEIGHT - 128) / 2, kicon.pixmap(QSize(128,128))); - setData(Qt::DecorationRole, QIcon(paddedImage)); - }*/ - - // Initiate the preview job. - KFileItemList fileItems; - fileItems << fileItem; - KIO::PreviewJob* job = KIO::filePreview(fileItems, PREVIEW_WIDTH, PREVIEW_HEIGHT ); - connect(job, SIGNAL(gotPreview(const KFileItem&, const QPixmap&)), - this, SLOT(setPreview(const KFileItem&, const QPixmap&))); -} - -DolphinToolTipItem::~DolphinToolTipItem() -{ -} - -void DolphinToolTipItem::setPreview(const KFileItem& fileItem, const QPixmap& preview) -{ - Q_UNUSED(fileItem); - /* QPixmap paddedImage(QSize(PREVIEW_WIDTH, PREVIEW_HEIGHT)); - paddedImage.fill(Qt::transparent); - QPainter painter(&paddedImage); - KIcon kicon(fileItem.iconName()); - painter.drawPixmap((PREVIEW_WIDTH - preview.width()) / 2, (PREVIEW_HEIGHT - preview.height()) / 2, preview); - setData(Qt::DecorationRole, QIcon(paddedImage));*/ - setData(Qt::DecorationRole, QIcon(preview)); -} - DolphinBalloonTooltipDelegate::DolphinBalloonTooltipDelegate() { } |
