Changeset View
Changeset View
Standalone View
Standalone View
src/QuickEditor/QuickEditor.cpp
Context not available. | |||||
44 | const int QuickEditor::magPixels = 16; | 44 | const int QuickEditor::magPixels = 16; | ||
---|---|---|---|---|---|
45 | const int QuickEditor::magOffset = 32; | 45 | const int QuickEditor::magOffset = 32; | ||
46 | 46 | | |||
47 | QuickEditor::QuickEditor(const QPixmap& pixmap) : | 47 | QuickEditor::QuickEditor(const QPixmap& thePixmap, QWidget *parent) : | ||
48 | QWidget(parent), | ||||
48 | mMaskColor(QColor::fromRgbF(0, 0, 0, 0.15)), | 49 | mMaskColor(QColor::fromRgbF(0, 0, 0, 0.15)), | ||
49 | mStrokeColor(palette().highlight().color()), | 50 | mStrokeColor(palette().highlight().color()), | ||
50 | mCrossColor(QColor::fromRgbF(mStrokeColor.redF(), mStrokeColor.greenF(), mStrokeColor.blueF(), 0.7)), | 51 | mCrossColor(QColor::fromRgbF(mStrokeColor.redF(), mStrokeColor.greenF(), mStrokeColor.blueF(), 0.7)), | ||
Context not available. | |||||
60 | mBottomHelpTextFont(font()), | 61 | mBottomHelpTextFont(font()), | ||
61 | mBottomHelpGridLeftWidth(0), | 62 | mBottomHelpGridLeftWidth(0), | ||
62 | mMouseDragState(MouseState::None), | 63 | mMouseDragState(MouseState::None), | ||
63 | mPixmap(pixmap), | 64 | mPixmap(thePixmap), | ||
64 | mMagnifierAllowed(false), | 65 | mMagnifierAllowed(false), | ||
65 | mShowMagnifier(SpectacleConfig::instance()->showMagnifierChecked()), | 66 | mShowMagnifier(SpectacleConfig::instance()->showMagnifierChecked()), | ||
66 | mToggleMagnifier(false), | 67 | mToggleMagnifier(false), | ||
Context not available. | |||||
78 | setMouseTracking(true); | 79 | setMouseTracking(true); | ||
79 | setAttribute(Qt::WA_StaticContents); | 80 | setAttribute(Qt::WA_StaticContents); | ||
80 | setWindowFlags(Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint | Qt::Popup | Qt::WindowStaysOnTopHint); | 81 | setWindowFlags(Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint | Qt::Popup | Qt::WindowStaysOnTopHint); | ||
81 | show(); | | |||
82 | 82 | | |||
83 | dprI = 1.0 / devicePixelRatioF(); | 83 | dprI = 1.0 / devicePixelRatioF(); | ||
84 | setGeometry(0, 0, static_cast<int>(mPixmap.width() * dprI), static_cast<int>(mPixmap.height() * dprI)); | 84 | setGeometry(0, 0, static_cast<int>(mPixmap.width() * dprI), static_cast<int>(mPixmap.height() * dprI)); | ||
Context not available. | |||||
429 | setCursor(Qt::OpenHandCursor); | 429 | setCursor(Qt::OpenHandCursor); | ||
430 | } | 430 | } | ||
431 | else if(mMouseDragState == MouseState::Outside && mReleaseToCapture) { | 431 | else if(mMouseDragState == MouseState::Outside && mReleaseToCapture) { | ||
432 | acceptSelection(); | 432 | event->accept(); | ||
433 | mMouseDragState = MouseState::None; | ||||
434 | return acceptSelection(); | ||||
433 | } | 435 | } | ||
434 | } else if (button == Qt::RightButton) { | 436 | } else if (button == Qt::RightButton) { | ||
435 | mSelection.setWidth(0); | 437 | mSelection.setWidth(0); | ||
Context not available. |