Skip to content

Commit

Permalink
chore: add fallback icon for applicaiton-tray
Browse files Browse the repository at this point in the history
avoid displaying empty area due to not obtaining icons.
  • Loading branch information
18202781743 authored and deepin-bot[bot] committed Aug 28, 2024
1 parent 773a315 commit 524b529
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/application-tray/traywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ void TrayWidget::paintEvent(QPaintEvent* event)
if(m_attentionTimer->isActive()) {
m_handler->attentionIcon().paint(&painter, QRect(0, 0, trayIconSize, trayIconSize));
} else {
m_handler->icon().paint(&painter, QRect(0, 0, trayIconSize, trayIconSize));

QIcon icon = m_handler->icon();
if (icon.isNull()) {
static const QIcon defaultIcon = QIcon::fromTheme("application-x-desktop");
icon = defaultIcon;
}
icon.paint(&painter, QRect(0, 0, trayIconSize, trayIconSize));
}
}
}
}

0 comments on commit 524b529

Please sign in to comment.