Skip to content

Commit 836bfb2

Browse files
committed
fix: Display bubble icon normally
as title Log: as title Bug: https://pms.uniontech.com/bug-view-286813.html
1 parent 785ef25 commit 836bfb2

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

panels/notification/bubble/bubbleitem.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ static QString imagePathOfNotification(const QVariantMap &hints, const QString &
121121
static const QStringList HintsOrder {
122122
"desktop-entry",
123123
"image-data",
124-
"image-path",
125-
"image_path",
126124
"icon_data"
127125
};
128126

@@ -147,10 +145,9 @@ static QString imagePathOfNotification(const QVariantMap &hints, const QString &
147145
img.save(file.fileName());
148146
return file.fileName();
149147
}
150-
QIcon icon = decodeIconFromPath(imageData, appName);
151-
if (icon.isNull()) {
152-
qCWarning(notifyLog) << "Can't get icon for notification, appName:" << appName;
153-
}
148+
149+
DGUI_USE_NAMESPACE;
150+
auto icon = DIconTheme::findQIcon(appName, DIconTheme::findQIcon("application-x-desktop"));
154151
return icon.name();
155152
}
156153

@@ -197,6 +194,10 @@ QString BubbleItem::appName() const
197194

198195
QString BubbleItem::appIcon() const
199196
{
197+
if (!m_entity.appIcon().isEmpty()) {
198+
return m_entity.appIcon();
199+
}
200+
200201
return imagePathOfNotification(m_entity.hints(), m_entity.appIcon(), m_entity.appName());
201202
}
202203

panels/notification/plugin/NotifyItemContent.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ NotifyItem {
242242
}
243243
}
244244

245-
background: NotifyItemBackground {
245+
background: Rectangle {
246+
color: Qt.rgba(0, 0, 0, 0.3)
246247
}
247248
}

0 commit comments

Comments
 (0)