Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions panels/notification/center/notifyitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,19 @@ void AppNotifyItem::updateActions()
return;
}

auto hints = m_entity.hints();
auto processed = m_entity.processed();
QVariantList array;
for (int i = 0; i < actions.size(); i += 2) {
const auto id = actions[i];
const auto text = actions[i + 1];
QVariantMap item;
item["id"] = id;
item["text"] = text;

// we only allow to invoke the action if we have the extension hint and it's not in the notify center.
item["enabled"] = hints.contains("x-deepin-action-" + id) || !processed;

array.append(item);
}

Expand Down
1 change: 1 addition & 0 deletions panels/notification/plugin/NotifyAction.qml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Control {
id: actionButton
required property var actionData
text: actionData ? actionData.text : ""
enabled: actionData ? actionData.enabled : false
topPadding: undefined
bottomPadding: undefined
leftPadding: undefined
Expand Down