highlight the thumbnail under the mouse
svn path=/trunk/KDE/kdelibs/; revision=1047608
This commit is contained in:
parent
fda0f6c4de
commit
01790c83c3
@ -45,6 +45,7 @@ WindowPreview::WindowPreview(QWidget *parent)
|
|||||||
m_background = new Plasma::FrameSvg(this);
|
m_background = new Plasma::FrameSvg(this);
|
||||||
m_background->setImagePath("widgets/frame");
|
m_background->setImagePath("widgets/frame");
|
||||||
m_background->setElementPrefix("raised");
|
m_background->setElementPrefix("raised");
|
||||||
|
setMouseTracking(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowPreview::setWindowIds(const QList<WId> wids)
|
void WindowPreview::setWindowIds(const QList<WId> wids)
|
||||||
@ -193,6 +194,25 @@ void WindowPreview::mousePressEvent(QMouseEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WindowPreview::mouseMoveEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
foreach (QRect rect, m_thumbnailRects) {
|
||||||
|
if (rect.contains(event->pos())) {
|
||||||
|
WindowEffects::highlightWindows(effectiveWinId(), QList<WId>()<<effectiveWinId()<<ids[i]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
WindowEffects::highlightWindows(effectiveWinId(), QList<WId>());
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowPreview::leaveEvent(QEvent *event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(event)
|
||||||
|
WindowEffects::highlightWindows(effectiveWinId(), QList<WId>());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Plasma
|
} // namespace Plasma
|
||||||
|
|
||||||
#include "windowpreview_p.moc"
|
#include "windowpreview_p.moc"
|
||||||
|
@ -56,6 +56,8 @@ Q_SIGNALS:
|
|||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *e);
|
void paintEvent(QPaintEvent *e);
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent *event);
|
||||||
|
void mouseMoveEvent(QMouseEvent *event);
|
||||||
|
void leaveEvent(QEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user