Browse Source

- Cleanly fixed popup menu positions in lists (no more workarounds)

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
106f7cdd32
  1. 5
      src/FinishedTorrents.cpp
  2. 5
      src/downloadingTorrents.cpp
  3. 5
      src/properties_imp.cpp
  4. 5
      src/torrentAddition.h

5
src/FinishedTorrents.cpp

@ -387,7 +387,7 @@ void FinishedTorrents::forceRecheck(){ @@ -387,7 +387,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();
@ -431,8 +431,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){ @@ -431,8 +431,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){
myFinishedListMenu.addAction(actionBuy_it);
// Call menu
// XXX: why mapToGlobal() is not enough?
myFinishedListMenu.exec(mapToGlobal(pos)+QPoint(12,35));
myFinishedListMenu.exec(QCursor::pos());
}

5
src/downloadingTorrents.cpp

@ -236,7 +236,7 @@ void DownloadingTorrents::forceRecheck() { @@ -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) { @@ -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());
}

5
src/properties_imp.cpp

@ -362,7 +362,7 @@ void properties::getPriorities(QStandardItem *parent, int *priorities) { @@ -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){ @@ -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(){

5
src/torrentAddition.h

@ -290,7 +290,7 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{ @@ -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{ @@ -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(){

Loading…
Cancel
Save