Merge remote-tracking branch 'origin/master'

This commit is contained in:
Hosted Weblate
2021-09-14 16:53:21 +02:00
3 changed files with 7 additions and 4 deletions

View File

@@ -750,7 +750,6 @@ void CaptureWidget::mouseReleaseEvent(QMouseEvent* e)
newGeometry.setBottom(top);
}
m_selection->setGeometry(newGeometry);
m_context.selection = extendedRect(newGeometry);
updateSizeIndicator();
m_buttonHandler->updatePosition(newGeometry);
m_buttonHandler->show();
@@ -1046,6 +1045,11 @@ void CaptureWidget::initSelection()
connect(m_selection, &SelectionWidget::animationEnded, this, [this]() {
this->m_buttonHandler->updatePosition(this->m_selection->geometry());
});
connect(m_selection, &SelectionWidget::resized, this, [this]() {
QRect constrainedToCaptureArea =
m_selection->geometry().intersected(rect());
m_context.selection = extendedRect(constrainedToCaptureArea);
});
m_selection->setVisible(false);
m_selection->setGeometry(QRect());
}
@@ -1289,8 +1293,6 @@ void CaptureWidget::repositionSelection(QRect r)
{
if (m_selection->isVisible()) {
m_selection->setGeometry(r);
QRect newGeometry = m_selection->geometry().intersected(rect());
m_context.selection = extendedRect(newGeometry);
m_buttonHandler->updatePosition(m_selection->geometry());
updateSizeIndicator();
update();
@@ -1329,7 +1331,6 @@ void CaptureWidget::selectAll()
{
QRect newGeometry = rect();
m_selection->setGeometry(newGeometry);
m_context.selection = extendedRect(newGeometry);
m_selection->setVisible(true);
m_buttonHandler->updatePosition(m_selection->geometry());
updateSizeIndicator();

View File

@@ -97,6 +97,7 @@ void SelectionWidget::resizeEvent(QResizeEvent*)
void SelectionWidget::moveEvent(QMoveEvent*)
{
updateAreas();
emit resized();
}
void SelectionWidget::updateColor(const QColor& c)

View File

@@ -40,6 +40,7 @@ protected:
signals:
void animationEnded();
void resized();
public slots:
void updateColor(const QColor& c);