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