diff --git a/src/utils/screenshotsaver.cpp b/src/utils/screenshotsaver.cpp index bb46fa83..2dead3c6 100644 --- a/src/utils/screenshotsaver.cpp +++ b/src/utils/screenshotsaver.cpp @@ -95,18 +95,19 @@ bool ScreenshotSaver::saveToFilesystem(const QPixmap& capture, QString completePath = FileNameHandler().generateAbsolutePath(path); completePath += QLatin1String(".png"); bool ok = capture.save(completePath); - QString saveMessage; + QString saveMessage = messagePrefix; QString notificationPath = completePath; + if (!saveMessage.isEmpty()) { + saveMessage += " "; + } if (ok) { ConfigHandler().setSavePath(path); - saveMessage = - messagePrefix + QObject::tr("Capture saved as ") + completePath; + saveMessage += QObject::tr("Capture saved as ") + completePath; Controller::getInstance()->sendCaptureSaved( m_id, QFileInfo(completePath).canonicalFilePath()); } else { - saveMessage = messagePrefix + QObject::tr("Error trying to save as ") + - completePath; + saveMessage += QObject::tr("Error trying to save as ") + completePath; notificationPath = ""; } diff --git a/src/widgets/capture/capturewidget.cpp b/src/widgets/capture/capturewidget.cpp index eb5bf31d..6607c22d 100644 --- a/src/widgets/capture/capturewidget.cpp +++ b/src/widgets/capture/capturewidget.cpp @@ -112,9 +112,12 @@ CaptureWidget::CaptureWidget(const uint id, for (QScreen* const screen : QGuiApplication::screens()) { QPoint topLeftScreen = screen->geometry().topLeft(); - if (topLeft.x() > topLeftScreen.x() || - topLeft.y() > topLeftScreen.y()) { - topLeft = topLeftScreen; + + if (topLeftScreen.x() < topLeft.x()) { + topLeft.setX(topLeftScreen.x()); + } + if (topLeftScreen.y() < topLeft.y()) { + topLeft.setY(topLeftScreen.y()); } } move(topLeft); @@ -716,13 +719,7 @@ void CaptureWidget::initPanel() { QRect panelRect = rect(); if (m_context.fullscreen) { -#if (defined(Q_OS_LINUX) && QT_VERSION < QT_VERSION_CHECK(5, 10, 0)) - panelRect = QGuiApplication::primaryScreen()->geometry(); - auto devicePixelRatio = - QGuiApplication::primaryScreen()->devicePixelRatio(); - panelRect.moveTo(panelRect.x() / devicePixelRatio, - panelRect.y() / devicePixelRatio); -#else +#if (defined(Q_OS_MACOS) || defined(Q_OS_LINUX)) QScreen* currentScreen = QGuiAppCurrentScreen().currentScreen(); if (currentScreen) { @@ -737,6 +734,12 @@ void CaptureWidget::initPanel() panelRect.moveTo(panelRect.x() / devicePixelRatio, panelRect.y() / devicePixelRatio); } +#else + panelRect = QGuiApplication::primaryScreen()->geometry(); + auto devicePixelRatio = + QGuiApplication::primaryScreen()->devicePixelRatio(); + panelRect.moveTo(panelRect.x() / devicePixelRatio, + panelRect.y() / devicePixelRatio); #endif } diff --git a/src/widgets/panel/utilitypanel.cpp b/src/widgets/panel/utilitypanel.cpp index ced9231e..10e7fab5 100644 --- a/src/widgets/panel/utilitypanel.cpp +++ b/src/widgets/panel/utilitypanel.cpp @@ -46,6 +46,7 @@ UtilityPanel::UtilityPanel(QWidget* parent) #if (defined(Q_OS_WIN) || defined(Q_OS_MACOS)) move(0, 0); #endif + hide(); } QWidget* UtilityPanel::toolWidget() const diff --git a/src/widgets/panel/utilitypanel.h b/src/widgets/panel/utilitypanel.h index 1aec25ac..7486a347 100644 --- a/src/widgets/panel/utilitypanel.h +++ b/src/widgets/panel/utilitypanel.h @@ -51,5 +51,4 @@ private: QVBoxLayout* m_layout; QPropertyAnimation* m_showAnimation; QPropertyAnimation* m_hideAnimation; - QPushButton* m_hide; };