Update buttonArea after resize

This commit is contained in:
lupoDharkael
2018-04-15 16:25:48 +02:00
parent 7b36148c05
commit 2f29179213
3 changed files with 9 additions and 1 deletions

View File

@@ -368,3 +368,7 @@ void ButtonHandler::updateScreenRegions(const QVector<QRect> &rects) {
m_screenRegions += rect;
}
}
void ButtonHandler::updateScreenRegions(const QRect &rect) {
m_screenRegions = QRegion(rect);
}

View File

@@ -38,12 +38,13 @@ public:
bool buttonsAreInside() const;
size_t size() const;
void updatePosition(const QRect &selection);
void setButtons(const QVector<CaptureButton*>);
bool contains(const QPoint &p) const;
void updateScreenRegions(const QVector<QRect> &rects);
void updateScreenRegions(const QRect &rect);
public slots:
void updatePosition(const QRect &selection);
void hide();
void show();

View File

@@ -475,6 +475,9 @@ void CaptureWidget::resizeEvent(QResizeEvent *e) {
QWidget::resizeEvent(e);
m_context.widgetDimensions = rect();
m_context.widgetOffset = mapToGlobal(QPoint(0,0));
if (!m_context.fullscreen) {
m_buttonHandler->updateScreenRegions(rect());
}
}
void CaptureWidget::moveEvent(QMoveEvent *e) {