Skip to content

Commit

Permalink
fix: [emblem] gio emblem show error
Browse files Browse the repository at this point in the history
Logic error,the gio emblem not show the right pos.

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-278805.html
  • Loading branch information
GongHeng2017 authored and deepin-bot[bot] committed Dec 2, 2024
1 parent 92de566 commit 8fdf215
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/plugins/common/dfmplugin-emblem/utils/emblemmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,18 @@ bool EmblemManager::paintEmblems(int role, const FileInfoPointer &info, QPainter
if (!helper->isExtEmblemProhibited(info, url)) {
// add gio embelm icons
helper->pending(info);
emblems.append(helper->gioEmblemIcons(url));
int systemEmblemsSize = emblems.size();
if (systemEmblemsSize == 0) {
emblems.append(helper->gioEmblemIcons(url));
} else if (systemEmblemsSize > 0 && systemEmblemsSize < 4) {
const QList<QIcon> &gioIcons { helper->gioEmblemIcons(url) };
int gioIconsSize { gioIcons.size() };
if (gioIconsSize > systemEmblemsSize) {
for (int i = systemEmblemsSize; i < gioIconsSize; ++i) {
emblems.append(gioIcons[i]);
}
}
}

// add custom emblem icons
EmblemEventSequence::instance()->doFetchCustomEmblems(url, &emblems);
Expand Down

0 comments on commit 8fdf215

Please sign in to comment.