Changeset View
Changeset View
Standalone View
Standalone View
src/Gui/KSMainWindow.cpp
Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Line(s) | 275 | { | |||
---|---|---|---|---|---|
292 | }; | 292 | }; | ||
293 | auto delayAnimation = new QVariantAnimation(timer); | 293 | auto delayAnimation = new QVariantAnimation(timer); | ||
294 | delayAnimation->setStartValue(0.0); | 294 | delayAnimation->setStartValue(0.0); | ||
295 | delayAnimation->setEndValue(1.0); | 295 | delayAnimation->setEndValue(1.0); | ||
296 | delayAnimation->setDuration(timer->interval()); | 296 | delayAnimation->setDuration(timer->interval()); | ||
297 | connect(delayAnimation, &QVariantAnimation::valueChanged, this, [=] { | 297 | connect(delayAnimation, &QVariantAnimation::valueChanged, this, [=] { | ||
298 | const double progress = delayAnimation->currentValue().toDouble(); | 298 | const double progress = delayAnimation->currentValue().toDouble(); | ||
299 | const double timeoutInSeconds = theTimeout / 1000.0; | 299 | const double timeoutInSeconds = theTimeout / 1000.0; | ||
300 | mKSWidget->setProgress(progress); | ||||
300 | unityUpdate({ {QStringLiteral("progress"), progress} }); | 301 | unityUpdate({ {QStringLiteral("progress"), progress} }); | ||
301 | setWindowTitle(i18ncp("@title:window", "%1 second", "%1 seconds", | 302 | setWindowTitle(i18ncp("@title:window", "%1 second", "%1 seconds", | ||
302 | qMin(int(timeoutInSeconds), qCeil((1 - progress) * timeoutInSeconds)))); | 303 | qMin(int(timeoutInSeconds), qCeil((1 - progress) * timeoutInSeconds)))); | ||
303 | }); | 304 | }); | ||
304 | connect(timer, &QTimer::timeout, this, [=] { | 305 | connect(timer, &QTimer::timeout, this, [=] { | ||
305 | this->hide(); | 306 | this->hide(); | ||
306 | timer->deleteLater(); | 307 | timer->deleteLater(); | ||
308 | mKSWidget->setProgress(0); | ||||
307 | unityUpdate({ {QStringLiteral("progress-visible"), false} }); | 309 | unityUpdate({ {QStringLiteral("progress-visible"), false} }); | ||
308 | emit newScreenshotRequest(theCaptureMode, 0, theIncludePointer, theIncludeDecorations); | 310 | emit newScreenshotRequest(theCaptureMode, 0, theIncludePointer, theIncludeDecorations); | ||
309 | }); | 311 | }); | ||
310 | 312 | | |||
311 | connect(mKSWidget, &KSWidget::screenshotCanceled, timer, [=] { | 313 | connect(mKSWidget, &KSWidget::screenshotCanceled, timer, [=] { | ||
312 | timer->stop(); | 314 | timer->stop(); | ||
313 | timer->deleteLater(); | 315 | timer->deleteLater(); | ||
314 | restoreWindowTitle(); | 316 | restoreWindowTitle(); | ||
▲ Show 20 Lines • Show All 201 Lines • Show Last 20 Lines |