Index: applets/kicker/package/contents/ui/ItemListDelegate.qml =================================================================== --- applets/kicker/package/contents/ui/ItemListDelegate.qml +++ applets/kicker/package/contents/ui/ItemListDelegate.qml @@ -77,103 +77,113 @@ } } - MouseArea { - id: mouseArea + PlasmaCore.ToolTipArea { + id: toolTip - anchors { - left: parent.left - right: parent.right - verticalCenter: parent.verticalCenter - } - - height: parent.height + property string text: model.comment - property int mouseCol - property bool pressed: false - property int pressX: -1 - property int pressY: -1 + anchors.fill: parent + active: !hasChildren && model.comment !== undefined && model.comment != "" + mainItem: toolTipDelegate - hoverEnabled: true - acceptedButtons: Qt.LeftButton | Qt.RightButton + MouseArea { + id: mouseArea - onPressed: { - if (mouse.buttons & Qt.RightButton) { - if (hasActionList) { - openActionMenu(mouseArea, mouse.x, mouse.y); - } - } else { - pressed = true; - pressX = mouse.x; - pressY = mouse.y; + anchors { + left: parent.left + right: parent.right + verticalCenter: parent.verticalCenter } - } - onReleased: { - if (pressed && !hasChildren) { - item.ListView.view.model.trigger(index, "", null); - plasmoid.expanded = false; + height: parent.height + + property int mouseCol + property bool pressed: false + property int pressX: -1 + property int pressY: -1 + + hoverEnabled: true + acceptedButtons: Qt.LeftButton | Qt.RightButton + + onPressed: { + if (mouse.buttons & Qt.RightButton) { + if (hasActionList) { + openActionMenu(mouseArea, mouse.x, mouse.y); + } + } else { + pressed = true; + pressX = mouse.x; + pressY = mouse.y; + } } - pressed = false; - pressX = -1; - pressY = -1; - } + onReleased: { + if (pressed && !hasChildren) { + item.ListView.view.model.trigger(index, "", null); + plasmoid.expanded = false; + } - onPositionChanged: { - if (pressX != -1 && model.url && dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y)) { - dragHelper.startDrag(kicker, model.url, model.decoration); pressed = false; pressX = -1; pressY = -1; - - return; } - // FIXME: Correct escape angle calc for right screen edge. - if (justOpenedTimer.running || !hasChildren) { - item.ListView.view.currentIndex = index; - } else { - mouseCol = mouse.x; + onPositionChanged: { + if (pressX != -1 && model.url && dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y)) { + dragHelper.startDrag(kicker, model.url, model.decoration); + pressed = false; + pressX = -1; + pressY = -1; - if (index == item.ListView.view.currentIndex) { - updateCurrentItem(); - } else if ((index == item.ListView.view.currentIndex - 1) && mouse.y < (itemHeight - 6) - || (index == item.ListView.view.currentIndex + 1) && mouse.y > 5) { + return; + } + + // FIXME: Correct escape angle calc for right screen edge. + if (justOpenedTimer.running || !hasChildren) { + item.ListView.view.currentIndex = index; + } else { + mouseCol = mouse.x; - if ((childDialog != null && childDialog.facingLeft) - ? mouse.x > item.ListView.view.eligibleWidth - 5 : mouse.x < item.ListView.view.eligibleWidth + 5) { + if (index == item.ListView.view.currentIndex) { + updateCurrentItem(); + } else if ((index == item.ListView.view.currentIndex - 1) && mouse.y < (itemHeight - 6) + || (index == item.ListView.view.currentIndex + 1) && mouse.y > 5) { + + if ((childDialog != null && childDialog.facingLeft) + ? mouse.x > item.ListView.view.eligibleWidth - 5 : mouse.x < item.ListView.view.eligibleWidth + 5) { + updateCurrentItem(); + } + } else if ((childDialog != null && childDialog.facingLeft) + ? mouse.x > item.ListView.view.eligibleWidth : mouse.x < item.ListView.view.eligibleWidth) { updateCurrentItem(); } - } else if ((childDialog != null && childDialog.facingLeft) - ? mouse.x > item.ListView.view.eligibleWidth : mouse.x < item.ListView.view.eligibleWidth) { - updateCurrentItem(); - } - updateCurrentItemTimer.start(); + updateCurrentItemTimer.start(); + } } - } - onContainsMouseChanged: { - if (!containsMouse) { - pressed = false; - pressX = -1; - pressY = -1; - updateCurrentItemTimer.stop(); + onContainsMouseChanged: { + if (!containsMouse) { + pressed = false; + pressX = -1; + pressY = -1; + updateCurrentItemTimer.stop(); + } } - } - function updateCurrentItem() { - item.ListView.view.currentIndex = index; - item.ListView.view.eligibleWidth = Math.min(width, mouseCol); - } + function updateCurrentItem() { + item.ListView.view.currentIndex = index; + item.ListView.view.eligibleWidth = Math.min(width, mouseCol); + } - Timer { - id: updateCurrentItemTimer + Timer { + id: updateCurrentItemTimer - interval: 50 - repeat: false + interval: 50 + repeat: false - onTriggered: parent.updateCurrentItem() + onTriggered: parent.updateCurrentItem() + } } } Index: applets/kicker/plugin/abstractentry.h =================================================================== --- applets/kicker/plugin/abstractentry.h +++ applets/kicker/plugin/abstractentry.h @@ -44,6 +44,7 @@ virtual QString name() const; virtual QString group() const; virtual QString description() const; + virtual QString comment() const; virtual QString id() const; virtual QUrl url() const; Index: applets/kicker/plugin/abstractentry.cpp =================================================================== --- applets/kicker/plugin/abstractentry.cpp +++ applets/kicker/plugin/abstractentry.cpp @@ -61,6 +61,11 @@ return QString(); } +QString AbstractEntry::comment() const +{ + return QString(); +} + QString AbstractEntry::id() const { return QString(); Index: applets/kicker/plugin/abstractmodel.cpp =================================================================== --- applets/kicker/plugin/abstractmodel.cpp +++ applets/kicker/plugin/abstractmodel.cpp @@ -44,6 +44,7 @@ roles.insert(Kicker::HasActionListRole, "hasActionList"); roles.insert(Kicker::ActionListRole, "actionList"); roles.insert(Kicker::UrlRole, "url"); + roles.insert(Kicker::CommentRole, "comment"); return roles; } Index: applets/kicker/plugin/actionlist.h =================================================================== --- applets/kicker/plugin/actionlist.h +++ applets/kicker/plugin/actionlist.h @@ -40,7 +40,8 @@ HasChildrenRole, HasActionListRole, ActionListRole, - UrlRole + UrlRole, + CommentRole }; QVariantMap createActionItem(const QString &label, const QString &actionId, const QVariant &argument = QVariant()); Index: applets/kicker/plugin/appentry.h =================================================================== --- applets/kicker/plugin/appentry.h +++ applets/kicker/plugin/appentry.h @@ -48,6 +48,8 @@ QIcon icon() const override; QString name() const override; QString description() const override; + QString comment() const override; + KService::Ptr service() const; QString id() const override; @@ -69,6 +71,7 @@ QString m_id; QString m_name; QString m_description; + QString m_comment; mutable QIcon m_icon; KService::Ptr m_service; static MenuEntryEditor *m_menuEntryEditor; Index: applets/kicker/plugin/appentry.cpp =================================================================== --- applets/kicker/plugin/appentry.cpp +++ applets/kicker/plugin/appentry.cpp @@ -79,6 +79,14 @@ } else { m_description = nameFromService(m_service, GenericNameOnly); } + + m_comment = m_service->comment(); + if(m_comment.isEmpty()) { + m_comment = m_service->genericName(); + if(m_comment.isEmpty()) { + m_comment = m_service->name(); + } + } } bool AppEntry::isValid() const @@ -104,6 +112,11 @@ return m_description; } +QString AppEntry::comment() const +{ + return m_comment; +} + KService::Ptr AppEntry::service() const { return m_service; Index: applets/kicker/plugin/appsmodel.cpp =================================================================== --- applets/kicker/plugin/appsmodel.cpp +++ applets/kicker/plugin/appsmodel.cpp @@ -141,6 +141,8 @@ return entry->name(); } else if (role == Qt::DecorationRole) { return entry->icon(); + } else if (role == Kicker::CommentRole) { + return entry->comment(); } else if (role == Kicker::DescriptionRole) { return entry->description(); } else if (role == Kicker::FavoriteIdRole && entry->type() == AbstractEntry::RunnableType) {