Substitute an SVG Konqi image provided by @bruns and scale it appropriately depending on the scale factor so it always looks crisp and clear.
Details
- Reviewers
broulik cfeck bruns - Group Reviewers
Frameworks VDG - Commits
- R263:7b119a0a03bb: Make Konqi look good in HiDPI
Looks the same at 1x. Looks better at anything larger than 1x:
1.2x:
1.5x:
1.75x:
2x:
...etc.
Diff Detail
- Repository
- R263 KXmlGui
- Branch
- hidpi-konqi (branched from master)
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 2039 Build 2057: arc lint + arc unit
If the increased image memory is payed only when the dialog is shown i don't see it as a problem tbh.
Funny story: after multiple attempts to use Inkscape to make an SVG of this, all versions were much larger than the new png! I don't think that's an option. @broulik, does the current approach look sane to you? I wasn't able to make it work simply adding an @2x image without code changes.
If the increased image memory is payed only when the dialog is shown i don't see it as a problem tbh.
Well, it's compiled into .qrc and potentially shipped for bundled applications? The RAM will be shared, I guess? I don't really know how this qt resource stuff works :)
Whatever the size/memory penalty is, I'm not sure we can get around paying it since the vector approach was a no-go. I tried my best to reduce the size of the image as much as possible, at least.
I have traced the image with GIMPs selection tool, "convert selection to path" and export path as SVG. IMHO works best for tracing pixel art.
Thanks! But where seems to be something wrong with that SVG. Qt complains when I try to load it into a QPixmap:
couldn't create image from "file:///home/sbruens/Downloads/aboutkde_doubled2.png"
Looking inside the SVG file itself, I see the following:
<image sodipodi:absref="/home/sbruens/Downloads/aboutkde_doubled2.png" y="0.000955912" x="-0.000238418" id="image946" xlink:href="file:///home/sbruens/Downloads/aboutkde_doubled2.png" preserveAspectRatio="none" height="749.999" width="449.999" />
If I understand it correctly, the SVG only contains the outline of the selection, but not the actual colors. What I see is just a black silhouette.
The outline exported from the GIMP is just an outline. The SVG I attached are all outlines properly stacked and filled.
If you see only an outline, your SVG viewer is broken. Try opening it in Inkscape.
Minimal working application:
#include <QIcon> #include <QGuiApplication> int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); QIcon icon(QStringLiteral("./konqui.svg")); QPixmap pixmap = icon.pixmap(64, 64); pixmap.save("./konqui.png"); }
src/aboutkde.svg | ||
---|---|---|
2 ↗ | (On Diff #40081) | The file mode is odd. It should be '644', but not '755'. Not sure what the initial '1' flag indicates. |