~blue-shell/kdebase-workspace/tasks-qml

« back to all changes in this revision

Viewing changes to plasma/desktop/applets/tasks/support/tooltip.cpp

  • Committer: Eike Hein
  • Date: 2013-04-10 14:13:37 UTC
  • Revision ID: git-v1:36c75f2e191de7e252877da097581582a9a7d413
Window highlights on preview hover.

Taking a short break with an easy one off the todo list while
fighting the big fight on launcher layouts :).

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include <KDE/Plasma/ToolTipManager>
36
36
 
37
37
ToolTipProxy::ToolTipProxy(QObject *parent)
38
 
    : QObject(parent), m_mainText(""), m_subText(""), m_widget(0)
 
38
    : QObject(parent), m_mainText(""), m_subText(""), m_widget(0), m_highlightWindows(false)
39
39
{
40
40
    connect(this, SIGNAL(targetChanged()), this, SLOT(updateToolTip()));
41
41
    connect(this, SIGNAL(mainTextChanged()), this, SLOT(updateToolTip()));
42
42
    connect(this, SIGNAL(subTextChanged()), this, SLOT(updateToolTip()));
43
43
    connect(this, SIGNAL(imageChanged()), this, SLOT(updateToolTip()));
44
44
    connect(this, SIGNAL(windowsToPreviewChanged()), this, SLOT(updateToolTip()));
 
45
    connect(this, SIGNAL(highlightWindowsChanged()), this, SLOT(updateToolTip()));
45
46
 
46
47
    connect(Plasma::ToolTipManager::self(),
47
48
        SIGNAL(windowPreviewActivated(WId,Qt::MouseButtons,Qt::KeyboardModifiers,QPoint)),
180
181
    emit windowsToPreviewChanged();
181
182
}
182
183
 
 
184
bool ToolTipProxy::highlightWindows() const
 
185
{
 
186
    return m_highlightWindows;
 
187
}
 
188
 
 
189
void ToolTipProxy::setHighlightWindows(bool highlight)
 
190
{
 
191
    if (highlight != m_highlightWindows) {
 
192
        m_highlightWindows = highlight;
 
193
        emit highlightWindowsChanged();
 
194
    }
 
195
}
 
196
 
183
197
void ToolTipProxy::hide() const
184
198
{
185
199
    if (m_widget) {
205
219
    data.setMainText(m_mainText);
206
220
    data.setSubText(m_subText);
207
221
    data.setWindowsToPreview(m_windowsToPreview);
 
222
    data.setHighlightWindows(m_highlightWindows);
208
223
 
209
224
    // set image
210
225
    switch (m_image.type()) {