mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
ksnapshot: use the same pixmap size as KPixmapWidget for the drag
because the preview pixmap size depends on the size of ksnapshot itself it may be very big and the drag pixmap itself may be big covering way too much screen space if not down-scaled to a reasonable size Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e24e22a4af
commit
089a085061
1 changed files with 7 additions and 1 deletions
|
@ -347,7 +347,13 @@ void KSnapshot::slotDragSnapshot()
|
|||
drag->setMimeData(new QMimeData);
|
||||
drag->mimeData()->setImageData(snapshot);
|
||||
drag->mimeData()->setData("application/x-kde-suggestedfilename", filename.fileName().toUtf8());
|
||||
drag->setPixmap(preview());
|
||||
const QPixmap previewPixmap = preview();
|
||||
if (!previewPixmap.isNull()) {
|
||||
// NOTE: keep in sync with:
|
||||
// kdelibs/kdeui/widgets/kpixmapwidget.cpp
|
||||
drag->setPixmap(previewPixmap.scaled(QSize(96, 96), Qt::KeepAspectRatio));
|
||||
drag->setHotSpot(QPoint(-5,-7));
|
||||
}
|
||||
QList<QUrl> urls;
|
||||
urls << urlToOpen();
|
||||
drag->mimeData()->setUrls(urls);
|
||||
|
|
Loading…
Add table
Reference in a new issue