Code refactoring - remove Q_OS_MAC64 (is not required, is covered by Q_OS_DARWIN)
(cherry picked from commit e511b521cec6edd9f77916c6ee753329326a5f91)
This commit is contained in:
@@ -46,7 +46,7 @@ bool AbstractPathTool::showMousePreview() const
|
||||
void AbstractPathTool::undo(QPixmap& pixmap)
|
||||
{
|
||||
QPainter p(&pixmap);
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS))
|
||||
#if defined(Q_OS_MACOS)
|
||||
// Not sure how will it work on 4k and fullHd on Linux or Windows with a
|
||||
// capture of different displays with different DPI, so let it be MacOS
|
||||
// specific only.
|
||||
@@ -85,7 +85,7 @@ void AbstractPathTool::updateBackup(const QPixmap& pixmap)
|
||||
QRect AbstractPathTool::backupRect(const QPixmap& pixmap) const
|
||||
{
|
||||
const QRect& limits = pixmap.rect();
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS))
|
||||
#if defined(Q_OS_MACOS)
|
||||
// Not sure how will it work on 4k and fullHd on Linux or Windows with a
|
||||
// capture of different displays with different DPI, so let it be MacOS
|
||||
// specific only.
|
||||
|
||||
@@ -73,7 +73,7 @@ bool AbstractTwoPointTool::showMousePreview() const
|
||||
void AbstractTwoPointTool::undo(QPixmap& pixmap)
|
||||
{
|
||||
QPainter p(&pixmap);
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS))
|
||||
#if defined(Q_OS_MACOS)
|
||||
// Not sure how will it work on 4k and fullHd on Linux or Windows with a
|
||||
// capture of different displays with different DPI, so let it be MacOS
|
||||
// specific only.
|
||||
@@ -121,7 +121,7 @@ QRect AbstractTwoPointTool::backupRect(const QPixmap& pixmap) const
|
||||
{
|
||||
const QRect& limits = pixmap.rect();
|
||||
QRect r = QRect(m_points.first, m_points.second).normalized();
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS))
|
||||
#if defined(Q_OS_MACOS)
|
||||
// Not sure how will it work on 4k and fullHd on Linux or Windows with a
|
||||
// capture of different displays with different DPI, so let it be MacOS
|
||||
// specific only.
|
||||
|
||||
@@ -52,7 +52,7 @@ QString PinTool::description() const
|
||||
QWidget* PinTool::widget()
|
||||
{
|
||||
qreal devicePixelRatio = 1;
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS))
|
||||
#if defined(Q_OS_MACOS)
|
||||
QScreen* currentScreen = QGuiAppCurrentScreen().currentScreen();
|
||||
if (currentScreen) {
|
||||
devicePixelRatio = currentScreen->devicePixelRatio();
|
||||
@@ -62,7 +62,7 @@ QWidget* PinTool::widget()
|
||||
const int m = w->margin() * devicePixelRatio;
|
||||
QRect adjusted_pos = m_geometry + QMargins(m, m, m, m);
|
||||
w->setGeometry(adjusted_pos);
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS))
|
||||
#if defined(Q_OS_MACOS)
|
||||
if (currentScreen) {
|
||||
QPoint topLeft = currentScreen->geometry().topLeft();
|
||||
adjusted_pos.setX((adjusted_pos.x() - topLeft.x()) / devicePixelRatio +
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "savetool.h"
|
||||
#include "src/utils/screenshotsaver.h"
|
||||
#include <QPainter>
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS))
|
||||
#if defined(Q_OS_MACOS)
|
||||
#include "src/widgets/capture/capturewidget.h"
|
||||
#include <QApplication>
|
||||
#include <QWidget>
|
||||
@@ -60,7 +60,7 @@ CaptureTool* SaveTool::copy(QObject* parent)
|
||||
|
||||
void SaveTool::pressed(const CaptureContext& context)
|
||||
{
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS))
|
||||
#if defined(Q_OS_MACOS)
|
||||
for (QWidget* widget : qApp->topLevelWidgets()) {
|
||||
QString className(widget->metaObject()->className());
|
||||
if (0 ==
|
||||
|
||||
@@ -130,7 +130,7 @@ CaptureTool* TextTool::copy(QObject* parent)
|
||||
void TextTool::undo(QPixmap& pixmap)
|
||||
{
|
||||
QPainter p(&pixmap);
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS))
|
||||
#if defined(Q_OS_MACOS)
|
||||
// Not sure how will it work on 4k and fullHd on Linux or Windows with a
|
||||
// capture of different displays with different DPI, so let it be MacOS
|
||||
// specific only.
|
||||
@@ -165,7 +165,7 @@ QRect TextTool::backupRect(const QPixmap& pixmap) const
|
||||
{
|
||||
const QRect& limits = pixmap.rect();
|
||||
QRect r = m_backupArea.normalized();
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS))
|
||||
#if defined(Q_OS_MACOS)
|
||||
const qreal pixelRatio = pixmap.devicePixelRatio();
|
||||
const int val = 5 * pixelRatio;
|
||||
if (1 != pixelRatio) {
|
||||
|
||||
@@ -92,7 +92,7 @@ CaptureTool* ToolFactory::CreateTool(CaptureToolButton::ButtonType t,
|
||||
case CaptureToolButton::TYPE_REDO:
|
||||
tool = new RedoTool(parent);
|
||||
break;
|
||||
#if not(defined(Q_OS_MAC64) || defined(Q_OS_MACOS))
|
||||
#if not defined(Q_OS_MACOS)
|
||||
case CaptureToolButton::TYPE_OPEN_APP:
|
||||
tool = new AppLauncher(parent);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user