feat: Shift+Click to use color-inverted checkerboard

This commit is contained in:
Gary Wang
2021-03-01 00:44:50 +08:00
parent aecc3cf163
commit b146150528
6 changed files with 28 additions and 10 deletions

View File

@ -38,7 +38,7 @@ signals:
void requestGallery(const QString &filePath);
public slots:
void toggleCheckerboard();
void toggleCheckerboard(bool invertCheckerboardColor = false);
private:
void mousePressEvent(QMouseEvent * event) override;
@ -53,13 +53,14 @@ private:
bool isThingSmallerThanWindowWith(const QTransform &transform) const;
bool shouldIgnoreMousePressMoveEvent(const QMouseEvent *event) const;
void setCheckerboardEnabled(bool enabled);
void setCheckerboardEnabled(bool enabled, bool invertColor = false);
void applyTransformationModeByScaleFactor();
void resetWithScaleAndRotate(qreal scaleFactor, qreal rotateAngle);
bool m_enableFitInView = false;
bool m_checkerboardEnabled = false;
bool m_isLastCheckerboardColorInverted = false;
qreal m_rotateAngle = 0;
};