* Set the visibility of the screenshot window when taking a screenshot. * @param hide Are we hiding the window or showing it again after the screenshot is taken? */
| 82 | * @param hide Are we hiding the window or showing it again after the screenshot is taken? |
| 83 | */ |
| 84 | void SetScreenshotWindowVisibility(bool hide) |
| 85 | { |
| 86 | ScreenshotWindow *scw = dynamic_cast<ScreenshotWindow *>(FindWindowById(WC_SCREENSHOT, 0)); |
| 87 | |
| 88 | if (scw == nullptr) return; |
| 89 | |
| 90 | if (hide) { |
| 91 | /* Set dirty the screen area where the window is covering (not the window itself), then move window off screen. */ |
| 92 | scw->SetDirty(); |
| 93 | scw->left += 2 * _screen.width; |
| 94 | } else { |
| 95 | /* Return window to original position. */ |
| 96 | scw->left -= 2 * _screen.width; |
| 97 | scw->SetDirty(); |
| 98 | } |
| 99 | } |
no test coverage detected