Fixed issue with ctrl s not saving text

This commit is contained in:
Jeremy Borgman
2020-09-27 19:06:18 -05:00
committed by borgmanJeremy
parent ca57215172
commit 931ac154e7

View File

@@ -26,7 +26,6 @@
#include "capturewidget.h"
#include "src/core/controller.h"
#include "src/utils/colorutils.h"
#include "src/utils/globalvalues.h"
#include "src/utils/screengrabber.h"
#include "src/utils/screenshotsaver.h"
#include "src/utils/systemnotification.h"
@@ -37,17 +36,14 @@
#include "src/widgets/orientablepushbutton.h"
#include "src/widgets/panel/sidepanelwidget.h"
#include <QApplication>
#include <QBuffer>
#include <QDesktopWidget>
#include <QGuiApplication>
#include <QMouseEvent>
#include <QPaintEvent>
#include <QPainter>
#include <QScreen>
#include <QShortcut>
#include <QUndoView>
#include <draggablewidgetmaker.h>
// CaptureWidget is the main component used to capture the screen. It contains
// an area of selection with its respective buttons.
@@ -1006,6 +1002,11 @@ void CaptureWidget::childLeave()
void CaptureWidget::copyScreenshot()
{
m_captureDone = true;
if (m_activeTool != nullptr) {
QPainter painter(&m_context.screenshot);
m_activeTool->process(painter, m_context.screenshot, true);
}
ScreenshotSaver().saveToClipboard(pixmap());
close();
}
@@ -1013,6 +1014,10 @@ void CaptureWidget::copyScreenshot()
void CaptureWidget::saveScreenshot()
{
m_captureDone = true;
if (m_activeTool != nullptr) {
QPainter painter(&m_context.screenshot);
m_activeTool->process(painter, m_context.screenshot, true);
}
hide();
if (m_context.savePath.isEmpty()) {
ScreenshotSaver().saveToFilesystemGUI(pixmap());
@@ -1047,4 +1052,4 @@ QRect CaptureWidget::extendedRect(QRect* r) const
r->top() * devicePixelRatio,
r->width() * devicePixelRatio,
r->height() * devicePixelRatio);
}
}