Skip to content

Commit

Permalink
Merge pull request #37 from namecheap/bugfix/RND-570-change-color-wid…
Browse files Browse the repository at this point in the history
…get-circle-doesn-t-disappear-on-windows

Fix - Change color widget circle doesn't disappear on Windows (left or right button click will choose a color and hide it after this fix)
  • Loading branch information
panpuchkov authored Sep 7, 2020
2 parents cc485f8 + 3378b78 commit 18b0f27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/widgets/capture/capturewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ void CaptureWidget::mousePressEvent(QMouseEvent *e) {
m_rightClick = true;
m_colorPicker->move(e->pos().x()-m_colorPicker->width()/2,
e->pos().y()-m_colorPicker->height()/2);
m_colorPicker->raise();
m_colorPicker->show();
} else if (e->button() == Qt::LeftButton) {
m_showInitialMsg = false;
Expand Down Expand Up @@ -427,7 +428,7 @@ void CaptureWidget::mouseMoveEvent(QMouseEvent *e) {
}

void CaptureWidget::mouseReleaseEvent(QMouseEvent *e) {
if (e->button() == Qt::RightButton) {
if (e->button() == Qt::RightButton || m_colorPicker->isVisible()) {
m_colorPicker->hide();
m_rightClick = false;
// when we end the drawing we have to register the last point and
Expand Down Expand Up @@ -665,7 +666,6 @@ void CaptureWidget::handleButtonSignal(CaptureTool::Request r) {
m_panel->toggle();
break;
case CaptureTool::REQ_SHOW_COLOR_PICKER:
// TODO
break;
case CaptureTool::REQ_MOVE_MODE:
setState(m_activeButton); // Disable the actual button
Expand Down

0 comments on commit 18b0f27

Please sign in to comment.