Merge pull request #1365 from namecheap/merge_full_nc_to_upstream

Merge full nc to upstream
This commit is contained in:
borgmanJeremy
2021-02-20 12:52:48 -06:00
committed by GitHub
6 changed files with 23 additions and 19 deletions

View File

@@ -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

View File

@@ -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()

View File

@@ -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 = "";
}

View File

@@ -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
}

View File

@@ -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

View File

@@ -51,5 +51,4 @@ private:
QVBoxLayout* m_layout;
QPropertyAnimation* m_showAnimation;
QPropertyAnimation* m_hideAnimation;
QPushButton* m_hide;
};