Commit b1723489 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

Apply patch #89724 from Maik Qualmann to update corrdinates/size and histogram...

Apply patch #89724 from Maik Qualmann to update corrdinates/size and histogram when canvas selection is changed.
BUGS: 338996
FIXED-IN: 4.6.0
parent 66af9246
......@@ -12,4 +12,5 @@ BUGFIXES FROM KDE BUGZILLA (https://www.digikam.org/changelog):
004 ==> 340945 - libkgeomap, libmediawiki, libkvkontakte, libkface not found.
005 ==> 338532 - Sidecar files are neither created nor updated under Windows.
006 ==> 335661 - CANVAS : image is displayed with wrong magnification after crop.
007 ==>
007 ==> 338996 - CANVAS : Selection coordinates/size do not show either during selection or update when using selection area adjust controls [patch].
008 ==>
......@@ -312,6 +312,9 @@ void EditorWindow::setupStandardConnections()
connect(m_canvas, SIGNAL(signalSelectionChanged(QRect)),
this, SLOT(slotSelectionChanged(QRect)));
connect(m_canvas, SIGNAL(signalSelectionSetText(QRect)),
this, SLOT(slotSelectionSetText(QRect)));
connect(m_canvas->interface(), SIGNAL(signalFileOriginChanged(QString)),
this, SLOT(slotFileOriginChanged(QString)));
......@@ -1614,7 +1617,7 @@ void EditorWindow::slotSelected(bool val)
// Update status bar
if (val)
{
setToolInfoMessage(QString("(%1, %2) (%3 x %4)").arg(sel.x()).arg(sel.y()).arg(sel.width()).arg(sel.height()));
slotSelectionSetText(sel);
}
else
{
......@@ -2739,6 +2742,12 @@ void EditorWindow::slotToggleSlideShow()
}
void EditorWindow::slotSelectionChanged(const QRect& sel)
{
slotSelectionSetText(sel);
emit signalSelectionChanged(sel);
}
void EditorWindow::slotSelectionSetText(const QRect& sel)
{
setToolInfoMessage(QString("(%1, %2) (%3 x %4)").arg(sel.x()).arg(sel.y()).arg(sel.width()).arg(sel.height()));
}
......
......@@ -316,6 +316,7 @@ private Q_SLOTS:
void slotZoomTo100Percents();
void slotZoomChanged(bool isMax, bool isMin, double zoom);
void slotSelectionChanged(const QRect& sel);
void slotSelectionSetText(const QRect& sel);
void slotToggleFitToWindow();
void slotToggleOffFitToWindow();
void slotFitToSelect();
......
......@@ -463,6 +463,19 @@ void Canvas::slotSelected()
}
d->core->setSelectedArea(sel);
emit signalSelectionChanged(sel);
}
void Canvas::slotSelectionMoved()
{
QRect sel = QRect(0, 0, 0, 0);
if (d->rubber)
{
sel = calcSelectedArea();
}
emit signalSelectionSetText(sel);
}
QRect Canvas::calcSelectedArea() const
......
......@@ -147,6 +147,7 @@ Q_SIGNALS:
void signalSavingFinished(const QString& filename, bool success);
void signalSavingProgress(const QString& filePath, float progress);
void signalSelectionChanged(const QRect&);
void signalSelectionSetText(const QRect&);
void signalToggleOffFitToWindow();
void signalUndoSteps(int);
void signalRedoSteps(int);
......@@ -173,6 +174,7 @@ public Q_SLOTS:
void slotSelectAll();
void slotSelectNone();
void slotSelected();
void slotSelectionMoved();
protected:
......
......@@ -60,4 +60,10 @@ void RubberItem::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
d->canvas->slotSelected();
}
void RubberItem::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
{
RegionFrameItem::mouseMoveEvent(event);
d->canvas->slotSelectionMoved();
}
} // namespace Digikam
......@@ -54,6 +54,7 @@ public:
protected:
void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
private:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment