From 9b29302d42f168b998b926b64d7a77480ad59d74 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 12 Jul 2009 06:07:20 +0000 Subject: [PATCH] - Cleanly fixed popup menus position in lists (no more workarounds) --- Changelog | 1 + src/FinishedTorrents.cpp | 5 ++--- src/downloadingTorrents.cpp | 5 ++--- src/properties_imp.cpp | 5 ++--- src/torrentAddition.h | 5 ++--- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Changelog b/Changelog index 5bb067cb1..51c715cf7 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,7 @@ - BUGFIX: Fixed a little bug in search engine plugins helper file - BUGFIX: Fixed compilation problems with Qt 4.3 - BUGFIX: Percentages no longer disapear with default cleanlooks style + - BUGFIX: Cleanly fixed popup menus position in lists (no more workarounds) * Sun Apr 5 2009 - Christophe Dumez - v1.3.3 - BUGFIX: Fixed Web UI torrent upload form diff --git a/src/FinishedTorrents.cpp b/src/FinishedTorrents.cpp index a0777234e..3c7bb1dfe 100644 --- a/src/FinishedTorrents.cpp +++ b/src/FinishedTorrents.cpp @@ -355,7 +355,7 @@ void FinishedTorrents::forceRecheck(){ } } -void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){ +void FinishedTorrents::displayFinishedListMenu(const QPoint&){ QMenu myFinishedListMenu(this); // Enable/disable pause/start action given the DL state QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes(); @@ -399,8 +399,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){ myFinishedListMenu.addAction(actionBuy_it); // Call menu - // XXX: why mapToGlobal() is not enough? - myFinishedListMenu.exec(mapToGlobal(pos)+QPoint(10,58)); + myFinishedListMenu.exec(QCursor::pos()); } diff --git a/src/downloadingTorrents.cpp b/src/downloadingTorrents.cpp index f091d6f6b..3d85a80ab 100644 --- a/src/downloadingTorrents.cpp +++ b/src/downloadingTorrents.cpp @@ -236,7 +236,7 @@ void DownloadingTorrents::forceRecheck() { } } -void DownloadingTorrents::displayDLListMenu(const QPoint& pos) { +void DownloadingTorrents::displayDLListMenu(const QPoint&) { QMenu myDLLlistMenu(this); // Enable/disable pause/start action given the DL state QModelIndexList selectedIndexes = downloadList->selectionModel()->selectedIndexes(); @@ -285,8 +285,7 @@ void DownloadingTorrents::displayDLListMenu(const QPoint& pos) { myDLLlistMenu.addSeparator(); myDLLlistMenu.addAction(actionBuy_it); // Call menu - // XXX: why mapToGlobal() is not enough? - myDLLlistMenu.exec(mapToGlobal(pos)+QPoint(10,35)); + myDLLlistMenu.exec(QCursor::pos()); } diff --git a/src/properties_imp.cpp b/src/properties_imp.cpp index 1b2a67f53..7466e56db 100644 --- a/src/properties_imp.cpp +++ b/src/properties_imp.cpp @@ -362,7 +362,7 @@ void properties::getPriorities(QStandardItem *parent, int *priorities) { } } -void properties::displayFilesListMenu(const QPoint& pos){ +void properties::displayFilesListMenu(const QPoint&){ if(h.get_torrent_info().num_files() == 1) return; QMenu myFilesLlistMenu(this); QModelIndex index; @@ -374,8 +374,7 @@ void properties::displayFilesListMenu(const QPoint& pos){ myFilesLlistMenu.addAction(actionHigh); myFilesLlistMenu.addAction(actionMaximum); // Call menu - // XXX: why mapToGlobal() is not enough? - myFilesLlistMenu.exec(mapToGlobal(pos)+QPoint(22,95)); + myFilesLlistMenu.exec(QCursor::pos()); } void properties::ignoreSelection(){ diff --git a/src/torrentAddition.h b/src/torrentAddition.h index f6e661125..1e45d1031 100644 --- a/src/torrentAddition.h +++ b/src/torrentAddition.h @@ -290,7 +290,7 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{ return true; } - void displayFilesListMenu(const QPoint& pos){ + void displayFilesListMenu(const QPoint&){ if(nbFiles == 1) return; QMenu myFilesLlistMenu(this); QModelIndex index; @@ -302,8 +302,7 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{ myFilesLlistMenu.addAction(actionHigh); myFilesLlistMenu.addAction(actionMaximum); // Call menu - // XXX: why mapToGlobal() is not enough? - myFilesLlistMenu.exec(mapToGlobal(pos)+QPoint(10,145)); + myFilesLlistMenu.exec(QCursor::pos()); } void ignoreSelection(){