1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-02-03 09:44:01 -05:00

Open spectrum markers dialog at current mouse position

This commit is contained in:
f4exb 2022-10-01 07:32:55 +02:00
parent 44b0ef63c8
commit 7e35eeb69c

View File

@ -23,6 +23,7 @@
#include <QToolTip>
#include <QFileDialog>
#include <QMessageBox>
#include <QDesktopWidget>
#include "gui/glspectrumgui.h"
#include "dsp/fftwindow.h"
@ -475,6 +476,12 @@ void GLSpectrumGUI::on_markers_clicked(bool checked)
connect(m_markersDialog, SIGNAL(updateMarkersDisplay()), this, SLOT(updateMarkersDisplay()));
connect(m_markersDialog, SIGNAL(finished(int)), this, SLOT(closeMarkersDialog()));
QPoint globalCursorPos = QCursor::pos();
int mouseScreen = qApp->desktop()->screenNumber(globalCursorPos);
QRect mouseScreenGeometry = qApp->desktop()->screen(mouseScreen)->geometry();
QPoint localCursorPos = globalCursorPos - mouseScreenGeometry.topLeft();
m_markersDialog->move(localCursorPos);
m_markersDialog->show();
}