mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Screen grabber: Don't wait for the flyout to collapse
The menu is now collapsed in the background half a second after the user clicked on the screenshot button. This is to let the WM have some time to open the fullscreen window, which itself is now shown immediately.
This commit is contained in:
parent
e83aac7af7
commit
be194e6fa8
|
@ -866,18 +866,17 @@ void ChatForm::loadHistory(QDateTime since, bool processUndelivered)
|
|||
|
||||
void ChatForm::onScreenshotClicked()
|
||||
{
|
||||
connect(fileFlyout, &FlyoutOverlayWidget::hidden, this, &ChatForm::doScreenshot);
|
||||
hideFileMenu();
|
||||
doScreenshot();
|
||||
|
||||
// Give the window manager a moment to open the fullscreen grabber window
|
||||
QTimer::singleShot(500, this, &ChatForm::hideFileMenu);
|
||||
}
|
||||
|
||||
void ChatForm::doScreenshot()
|
||||
{
|
||||
disconnect(fileFlyout, &FlyoutOverlayWidget::hidden, this, &ChatForm::doScreenshot);
|
||||
|
||||
ScreenshotGrabber* screenshotGrabber = new ScreenshotGrabber(this);
|
||||
connect(screenshotGrabber, &ScreenshotGrabber::screenshotTaken, this, &ChatForm::onScreenshotTaken);
|
||||
screenshotGrabber->showGrabber();
|
||||
|
||||
}
|
||||
|
||||
void ChatForm::onScreenshotTaken(const QPixmap &pixmap) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user