Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Use a correct signal to update OverviewDocker

Dmitry Kazakov3dd502284721
diff --git a/libs/flake/KoCanvasController.h b/libs/flake/KoCanvasController.h
index 7a5d7ff64b..bc620d622f 100644
--- a/libs/flake/KoCanvasController.h
+++ b/libs/flake/KoCanvasController.h
@@ -237,6 +237,7 @@ public:
void emitDocumentRectInWidgetPixelsChanged(const QRectF &documentRectInWidgetPixels) { Q_EMIT documentRectInWidgetPixelsChanged(documentRectInWidgetPixels); }
void emitDocumentRotationChanged(qreal angle) { Q_EMIT documentRotationChanged(angle); }
void emitDocumentMirrorStatusChanged(bool mirrorX, bool mirrorY) { Q_EMIT documentMirrorStatusChanged(mirrorX, mirrorY); }
+ void emitCanvasStateChanged() { Q_EMIT canvasStateChanged(); }
// Convenience method to retrieve the canvas controller for who needs to use QPointer
KoCanvasController *canvasController() const { return m_canvasController; }
@@ -305,6 +306,8 @@ Q_SIGNALS:
void documentRotationChanged(qreal angle);
void documentMirrorStatusChanged(bool mirrorX, bool mirrorY);
+ void canvasStateChanged();
+
private:
KoCanvasController *m_canvasController;
};
diff --git a/libs/ui/canvas/KoCanvasControllerWidget.cpp b/libs/ui/canvas/KoCanvasControllerWidget.cpp
index f24dfed923..fc569cb264 100644
--- a/libs/ui/canvas/KoCanvasControllerWidget.cpp
+++ b/libs/ui/canvas/KoCanvasControllerWidget.cpp
@@ -218,6 +218,10 @@ void KoCanvasControllerWidget::emitSignals(const KisCanvasState &oldState, const
if (oldState.imageRectInWidgetPixels != newState.imageRectInWidgetPixels) {
proxyObject->emitDocumentRectInWidgetPixelsChanged(newState.imageRectInWidgetPixels);
}
+
+ if (oldState != newState) {
+ proxyObject->emitCanvasStateChanged();
+ }
}
void KoCanvasControllerWidget::zoomTo(const QRect &viewRect)
diff --git a/plugins/dockers/overview/overviewwidget.cc b/plugins/dockers/overview/overviewwidget.cc
index b83d015570..d2495a0a70 100644
--- a/plugins/dockers/overview/overviewwidget.cc
+++ b/plugins/dockers/overview/overviewwidget.cc
@@ -52,8 +52,7 @@ void OverviewWidget::setCanvas(KisCanvas2 *canvas)
if (m_canvas) {
connect(m_canvas->displayColorConverter(), SIGNAL(displayConfigurationChanged()), SLOT(startUpdateCanvasProjection()));
- // TODO: we need a proper "any signal changed" here
- connect(m_canvas->canvasController()->proxyObject, SIGNAL(canvasOffsetChanged()), this, SLOT(update()), Qt::UniqueConnection);
+ connect(m_canvas->canvasController()->proxyObject, SIGNAL(canvasStateChanged()), this, SLOT(update()), Qt::UniqueConnection);
connect(m_canvas->viewManager()->mainWindow(), SIGNAL(themeChanged()), this, SLOT(slotThemeChanged()), Qt::UniqueConnection);
}
}