Commit aff12784 authored by Bharadwaj Raju's avatar Bharadwaj Raju 📚 Committed by Nate Graham
Browse files

Use independent toolTipDelegate for each item.

BUG: 434657
parent 603c0b5a
......@@ -314,6 +314,11 @@ MouseArea {
Component.onCompleted: timer.start()
}
}
ToolTipDelegate {
id: toolTipDelegate
visible: false
}
PlasmaCore.FrameSvgItem {
id: frame
......
......@@ -221,7 +221,6 @@ MouseArea {
id: backend
taskManagerItem: tasks
toolTipItem: toolTipDelegate
groupDialog: groupDialog
highlightWindows: plasmoid.configuration.highlightWindows
......@@ -410,12 +409,6 @@ MouseArea {
}
}
ToolTipDelegate {
id: toolTipDelegate
visible: false
}
TaskList {
id: taskList
......
......@@ -109,22 +109,6 @@ void Backend::setTaskManagerItem(QQuickItem *item)
}
}
QQuickItem *Backend::toolTipItem() const
{
return m_toolTipItem;
}
void Backend::setToolTipItem(QQuickItem *item)
{
if (item != m_toolTipItem) {
m_toolTipItem = item;
connect(item, &QQuickItem::windowChanged, this, &Backend::toolTipWindowChanged);
emit toolTipItemChanged();
}
}
QQuickWindow *Backend::groupDialog() const
{
return m_groupDialog;
......@@ -432,13 +416,6 @@ QVariantList Backend::recentDocumentActions(const QUrl &launcherUrl, QObject *pa
return actions;
}
void Backend::toolTipWindowChanged(QQuickWindow *window)
{
Q_UNUSED(window)
updateWindowHighlight();
}
void Backend::handleRecentDocumentAction() const
{
const QAction *action = qobject_cast<QAction *>(sender());
......@@ -605,4 +582,28 @@ void Backend::updateWindowHighlight()
auto message = QDBusMessage::createMethodCall(highlightWindowName, highlightWindowPath, highlightWindowInterface, QStringLiteral("highlightWindows"));
message << (m_highlightWindows ? m_windowsToHighlight : QStringList());
QDBusConnection::sessionBus().asyncCall(message);
if (!m_highlightWindows) {
if (m_panelWinId) {
KWindowEffects::highlightWindows(m_panelWinId, QList<WId>());
m_panelWinId = 0;
}
return;
}
if (m_taskManagerItem && m_taskManagerItem->window()) {
m_panelWinId = m_taskManagerItem->window()->winId();
} else {
return;
}
QList<WId> windows = m_windowsToHighlight;
if (!windows.isEmpty() && m_groupDialog) {
windows.append(m_groupDialog->winId());
}
KWindowEffects::highlightWindows(m_panelWinId, windows);
}
......@@ -42,7 +42,6 @@ class Backend : public QObject
Q_OBJECT
Q_PROPERTY(QQuickItem *taskManagerItem READ taskManagerItem WRITE setTaskManagerItem NOTIFY taskManagerItemChanged)
Q_PROPERTY(QQuickItem *toolTipItem READ toolTipItem WRITE setToolTipItem NOTIFY toolTipItemChanged)
Q_PROPERTY(QQuickWindow *groupDialog READ groupDialog WRITE setGroupDialog NOTIFY groupDialogChanged)
Q_PROPERTY(bool highlightWindows READ highlightWindows WRITE setHighlightWindows NOTIFY highlightWindowsChanged)
Q_PROPERTY(bool canPresentWindows READ canPresentWindows NOTIFY canPresentWindowsChanged)
......@@ -65,9 +64,6 @@ public:
QQuickItem *taskManagerItem() const;
void setTaskManagerItem(QQuickItem *item);
QQuickItem *toolTipItem() const;
void setToolTipItem(QQuickItem *item);
QQuickWindow *groupDialog() const;
void setGroupDialog(QQuickWindow *dialog);
......@@ -101,7 +97,6 @@ public Q_SLOTS:
Q_SIGNALS:
void taskManagerItemChanged() const;
void toolTipItemChanged() const;
void groupDialogChanged() const;
void highlightWindowsChanged() const;
void addLauncher(const QUrl &url) const;
......@@ -110,7 +105,6 @@ Q_SIGNALS:
void showAllPlaces();
private Q_SLOTS:
void toolTipWindowChanged(QQuickWindow *window);
void handleRecentDocumentAction() const;
private:
......@@ -119,7 +113,6 @@ private:
QVariantList systemSettingsActions(QObject *parent) const;
QQuickItem *m_taskManagerItem = nullptr;
QQuickItem *m_toolTipItem = nullptr;
QQuickWindow *m_groupDialog = nullptr;
bool m_highlightWindows;
QStringList m_windowsToHighlight;
......
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