diff --git a/.github/workflows/Windows-pack.yml b/.github/workflows/Windows-pack.yml index 96e71f4f..4a431461 100644 --- a/.github/workflows/Windows-pack.yml +++ b/.github/workflows/Windows-pack.yml @@ -76,7 +76,9 @@ jobs: echo ${last_committed_tag:1} echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}" echo "================================" - echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV + # This will allow to build pre-preleases without git tag + # echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV + echo "VERSION=$(cat CMakeLists.txt |grep 'set.*(.*FLAMESHOT_VERSION' | sed 's/[^0-9.]*//' |sed 's/)//g')" >> $GITHUB_ENV - name: Restore from cache and run vcpkg uses: lukka/run-vcpkg@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ad3c3b4..cda1da36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,8 +39,6 @@ set(PROJECT_NAME_CAPITALIZED "Flameshot") # This can be read from ${PROJECT_NAME} after project() is called if (APPLE) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version") - # # Required to generate MOC - # add_subdirectory(external/QHotkey) endif() 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; };