Verified Commit 21bd2a92 authored by Antonio Prcela's avatar Antonio Prcela 🏞
Browse files

Canceling a screenshot shall not disable buttons if previous screenshot is visible

Problem: take screenshot, it shows up in Spectacle. Take, for example, new screenshot with
    rectangluar region. Cancel it, the previous screenshot is still in Spectacle, but most
    of the buttons are disabled.

Solution: if checking that the new Pixmap has been forwarded to setScreenshotAndShow()
    is empty, because the 'shot' was canceled, check if a previous screenshot is already
    visible in Spectacle and set mPixmapExists to true so the buttons don't get disabled.
    Do not check for mKSWidget->isScreenshotSet() before the 'if (mPixmapExists) {}', in
    case the empty pixmap will overwrite the old screenshot.
parent 0def3032
Pipeline #165215 passed with stage
in 49 seconds
......@@ -398,6 +398,10 @@ void KSMainWindow::setScreenshotAndShow(const QPixmap &pixmap, bool showAnnotato
} else {
// check if there is an screenshot already visible, if true, don't disable buttons
// this check has to be done after if (mPixmapExists), otherwise it
// might set a new empty screenshot, overwriting the previous one
mPixmapExists = mKSWidget->isScreenshotSet();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment