mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #2324 from antis81:ngf/fix/screen-grabber
This commit is contained in:
commit
cfe6462fef
@ -181,14 +181,20 @@ void ScreenshotGrabber::chooseHelperTooltipText(QRect rect)
|
|||||||
useRegionSelectedTooltip();
|
useRegionSelectedTooltip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* Align the tooltip centred at top of screen with the mouse cursor.
|
||||||
|
*/
|
||||||
void ScreenshotGrabber::adjustTooltipPosition()
|
void ScreenshotGrabber::adjustTooltipPosition()
|
||||||
{
|
{
|
||||||
QRectF size = this->helperToolbox->childrenBoundingRect();
|
QRect recGL = QGuiApplication::primaryScreen()->virtualGeometry();
|
||||||
QRect screenRect = QApplication::desktop()->screen()->rect();
|
QRect rec = qApp->desktop()->screenGeometry(QCursor::pos());
|
||||||
|
const QRectF ttRect = this->helperToolbox->childrenBoundingRect();
|
||||||
// Align the toolbox center-top.
|
int x = abs(recGL.x()) + rec.x() + ((rec.width() - ttRect.width()) / 2);
|
||||||
helperToolbox->setX(screenRect.x() + (screenRect.width() - size.width() + size.x()) / 2);
|
int y = abs(recGL.y()) + rec.y();
|
||||||
helperToolbox->setY(screenRect.y());
|
helperToolbox->setX(x);
|
||||||
|
helperToolbox->setY(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenshotGrabber::reject()
|
void ScreenshotGrabber::reject()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user