Commit 9e7baa82 authored by Adrian Page's avatar Adrian Page

- Only paint the marching ants when a selection is active.

- Remove the ants when the selection is removed.
- Update the selection status in the status bar when the selection is removed.


svn path=/trunk/koffice/; revision=658799
parent 6792b0f3
......@@ -327,25 +327,33 @@ void KisSelectionManager::updateGUI()
}
void KisSelectionManager::updateStatusBar()
{
if (m_parent && m_parent->statusBar()) {
m_parent->statusBar()->setSelection( m_parent->image() );
}
}
bool KisSelectionManager::selectionIsActive()
{
KisImageSP img = m_parent->image();
if (img) {
KisPaintDeviceSP dev = img->activeDevice();
if (dev) {
if (dev->hasSelection()) {
QRect r = dev->selection()->selectedExactRect();
m_parent->statusBar()->setSelection( img );
return;
return true;
}
}
}
}
return false;
}
void KisSelectionManager::imgSelectionChanged(KisImageSP img)
{
if (img == m_parent->image()) {
updateGUI();
paths.clear();
KisPaintDeviceSP dev = img->activeDevice();
if (dev)
......@@ -1654,9 +1662,11 @@ void KisSelectionManager::computeTransition (quint8* transition, quint8** buf, q
void KisSelectionManager::timerEvent()
{
offset++;
if(offset>7) offset = 0;
m_parent->canvasBase()->updateCanvas(QRectF(0.0,0.0,1000.0,1000.0));
if (selectionIsActive()) {
offset++;
if(offset>7) offset = 0;
m_parent->canvasBase()->updateCanvas(QRectF(0.0,0.0,1000.0,1000.0));
}
}
void KisSelectionManager::paint(QPainter& gc, KoViewConverter &converter)
......
......@@ -106,6 +106,7 @@ public:
private:
void fill(const KoColor& color, bool fillWithPattern, const QString& transactionText);
void updateStatusBar();
bool selectionIsActive();
void computeBorder (qint32 *circ, qint32 xradius, qint32 yradius);
inline void rotatePointers (quint8 **p, quint32 n);
......
Markdown is supported
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