Commit b0542ca0 authored by Nicolas Fella's avatar Nicolas Fella Committed by Albert Astals Cid
Browse files

Use QIcon::fromTheme instead of GuiUtils::iconLoader

The only relevant behavior of the custom icon loader is the automatic
fallback to <share>/okular/pics, which we can do ourselves with QIcon
API.
parent 1e9711ba
......@@ -188,13 +188,7 @@ QPixmap loadStamp(const QString &nameOrPath, int size, bool keepAspectRatio)
}
// _name is an icon name
const KIconLoader *il = iconLoader();
QString path;
pixmap = il->loadIcon(name, KIconLoader::User, size, KIconLoader::DefaultState, QStringList(), &path, true);
if (path.isEmpty())
pixmap = il->loadIcon(name, KIconLoader::NoGroup, size);
return pixmap; // can be a null pixmap
return QIcon::fromTheme(name).pixmap(size);
}
void addIconLoader(KIconLoader *loader)
......
......@@ -572,10 +572,7 @@ void PagePainter::paintCroppedPageOnPainter(QPainter *destPainter,
mixedPainter->drawImage(annotBoundary.topLeft(), image);
} else if (text->textType() == Okular::TextAnnotation::Linked) {
// get pixmap, colorize and alpha-blend it
QString path;
QPixmap pixmap = GuiUtils::iconLoader()->loadIcon(text->textIcon().toLower(), KIconLoader::User, 32, KIconLoader::DefaultState, QStringList(), &path, true);
if (path.isEmpty())
pixmap = GuiUtils::iconLoader()->loadIcon(text->textIcon().toLower(), KIconLoader::NoGroup, 32);
QPixmap pixmap = QIcon::fromTheme(text->textIcon().toLower()).pixmap(32);
QPixmap scaledCroppedPixmap = pixmap.scaled(TEXTANNOTATION_ICONSIZE * dpr, TEXTANNOTATION_ICONSIZE * dpr).copy(dInnerRect.toAlignedRect());
scaledCroppedPixmap.setDevicePixelRatio(dpr);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment