Browse Source

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.
pull/1552/merge
Stefan Merettig 11 years ago committed by tux3
parent
commit
be194e6fa8
  1. 9
      src/widget/form/chatform.cpp

9
src/widget/form/chatform.cpp

@ -866,18 +866,17 @@ void ChatForm::loadHistory(QDateTime since, bool processUndelivered) @@ -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…
Cancel
Save